Строим свой остров: как создать минимальный Linux для Raspberry Pi

Ещё три года назад меня просили рассказать, как собрать минимальный Linux для Raspberry Pi, — и сейчас я выполняю эту просьбу. Несмотря на то, что первоначальной целью Raspberry Pi было создание дешёвого устройства для обучения базовым навыкам программирования, информации о том как, создать минимальный Linux для Raspberry Pi в интернете немного. Я хочу восполнить этот пробел для желающих начать погружение в embedded-разработку. Linux для встраиваемых систем, включая Raspberry Pi, и Linux для PC имеют ряд различий. Различия касаются используемых загрузчиков, платформо-зависимого кода ядра, файловых систем и прочего. Для встраиваемых систем большое значение имеет Board Support Package (BSP), который обычно сопровождает различные системы на кристалле (System on Chip — SoC) или одноплатные компьютеры (Single Board Computer — SBC). Чтобы сделать статью интереснее и полезнее, я рассмотрю создание Linux для Raspberry Pi 3 и для Raspberry Pi 4 и укажу на различие этих одноплатных компьютеров в контексте загрузки и сборки ядра Linux. Также мы соберём и запустим downstream и upstream Linux-ядра для Raspberry Pi. Под Raspberry Pi 3 и Raspberry Pi 4 подразумеваются модели Raspberry Pi 3 Model B и Raspberry Pi 4 Model B соответственно. А обе модели называются в статье Raspberry Pi. Как и в моей прошлой статье по сборке Linux для PC собирать мы будем без использования Buildroot или Yocto Project , только сделаем его более практичным, так как он будет поддерживать работу с SD-картой. Такие сборки минимального Linux без Buildroot и Yocto Project мне чем-то напоминают высадку на необитаемый остров, где вы вынуждены минимальным набором инструментов благоустраивать свою жизнь. Да, вашей жизни ничего не угрожает, но определённая закалка в виде полученных базовых знаний остаётся. Поэтому системе Linux, создаваемой в статье, я дал кодовое название Robinson Linux. Я надеюсь, что после прочтения статьи вам будет гораздо проще собрать Linux для другого одноплатного компьютера, например, Orange Pi. Кому интересно погрузиться в embedded-разработку, добро пожаловать под кат.

https://habr.com/ru/companies/ruvds/articles/971084/?utm_source=habrahabr&utm_medium=rss&utm_campaign=971084

#linux #embedded_linux #raspberry_pi #linux_kernel #crosscompilation #devicetree #bootloader #uart #arm #статьи_ruvds

Строим свой остров: как создать минимальный Linux для Raspberry Pi

Ещё три года назад меня просили рассказать, как собрать минимальный Linux для Raspberry Pi, — и сейчас я выполняю эту просьбу. Несмотря на то, что первоначальной целью Raspberry Pi было создание...

Хабр

Строим свой остров: как создать минимальный Linux для Raspberry Pi

Ещё три года назад меня просили рассказать, как собрать минимальный Linux для Raspberry Pi, — и сейчас я выполняю эту просьбу. Несмотря на то, что первоначальной целью Raspberry Pi было создание дешёвого устройства для обучения базовым навыкам программирования, информации о том как, создать минимальный Linux для Raspberry Pi в интернете немного. Я хочу восполнить этот пробел для желающих начать погружение в embedded-разработку. Linux для встраиваемых систем, включая Raspberry Pi, и Linux для PC имеют ряд различий. Различия касаются используемых загрузчиков, платформо-зависимого кода ядра, файловых систем и прочего. Для встраиваемых систем большое значение имеет Board Support Package (BSP), который обычно сопровождает различные системы на кристалле (System on Chip — SoC) или одноплатные компьютеры (Single Board Computer — SBC). Чтобы сделать статью интереснее и полезнее, я рассмотрю создание Linux для Raspberry Pi 3 и для Raspberry Pi 4 и укажу на различие этих одноплатных компьютеров в контексте загрузки и сборки ядра Linux. Также мы соберём и запустим downstream и upstream Linux-ядра для Raspberry Pi. Под Raspberry Pi 3 и Raspberry Pi 4 подразумеваются модели Raspberry Pi 3 Model B и Raspberry Pi 4 Model B соответственно. А обе модели называются в статье Raspberry Pi. Как и в моей прошлой статье по сборке Linux для PC собирать мы будем без использования Buildroot или Yocto Project , только сделаем его более практичным, так как он будет поддерживать работу с SD-картой. Такие сборки минимального Linux без Buildroot и Yocto Project мне чем-то напоминают высадку на необитаемый остров, где вы вынуждены минимальным набором инструментов благоустраивать свою жизнь. Да, вашей жизни ничего не угрожает, но определённая закалка в виде полученных базовых знаний остаётся. Поэтому системе Linux, создаваемой в статье, я дал кодовое название Robinson Linux. Я надеюсь, что после прочтения статьи вам будет гораздо проще собрать Linux для другого одноплатного компьютера, например, Orange Pi. Кому интересно погрузиться в embedded-разработку, добро пожаловать под кат.

https://habr.com/ru/companies/ruvds/articles/971084/

#linux #embedded_linux #raspberry_pi #linux_kernel #crosscompilation #devicetree #bootloader #uart #arm #статьи_ruvds

Строим свой остров: как создать минимальный Linux для Raspberry Pi

Ещё три года назад меня просили рассказать, как собрать минимальный Linux для Raspberry Pi, — и сейчас я выполняю эту просьбу. Несмотря на то, что первоначальной целью Raspberry Pi было создание...

Хабр
🎉🚀 OMG! #QNX finally ditches cross-compilation in favor of... the same desktop environment your grandma used in 1995. 👵💻 Welcome to 2025, where #innovation means rehashing decade-old ideas while pretending it's the Next Big Thing. 🙄✨
https://devblog.qnx.com/qnx-self-hosted-developer-desktop-initial-release/ #Nostalgia #CrossCompilation #TechTrends #DesktopEnvironment #HackerNews #ngated
QNX Self-Hosted Developer Desktop -- Initial Release

Try out the initial release of the QNX Developer Desktop -- a self-hosted development environment for QNX. No more cross-compilation!

QNX Developer Blog

So you created your favorite product system image, minimized it, tested its systemd-sysupdate over-the-air update capabilities, your CI automatically tests it in sandboxed virtual networks, and you are happy with it. Now your carefully engineered product wants to be deployed to a smaller embedded system without hassle? Maybe even from your Mac?

The final piece of the NixOS appliance image blog post series puzzle is here, and we are tackling one of the nastiest challenges in embedded systems and make it look easy: Cross-Compilation.

We started with the basics and progressively added advanced capabilities:

🔹 Part 1: Making "self-inflating" NixOS images that automatically resize their filesystems on first boot using systemd-repart
🔹 Part 2: Learn how to use builtin Nix capabilities to minimize images
🔹 Part 3: Implementing robust, atomic auto-updates with systemd-sysupdate
🔹 Part 4: Cross-compiling the image from any platform to any platform

If you are building IoT devices or optimized cloud images, you rarely build on the target hardware. You want to build here (e.g., a powerful x86 server or a MacBook) to deploy there (e.g., ARM64 Raspberry Pi, small RISCV board or whatever small system).

In this final guide, we provide a scalable Nix Flake architecture designed to handle this elegantly.
We move beyond simple cross-compilation hacks and show you how to:

✅ Strictly separate system configuration from build platform metadata.
✅ Automatically generate every combination of build/host platform (the Cartesian product).
✅ Build Linux images effortlessly even from macOS.

This is the blueprint for a maintainable, multi-architecture build pipeline.

👉 Read the Article: https://nixcademy.com/posts/cross-compile-nixos-images/
👉 Get the Code: https://nixcademy.com/posts/cross-compile-nixos-images/

#NixOS #Nix #DevOps #EmbeddedSystems #IoT #CrossCompilation #Linux

Custom Cross Compiler with Nix

How to use a custom cross compiler with nix

Hobson Space

After 12 years of cross-compiling for exotic architectures, a Tauri maintainer's comment humbled me: "Have you considered cross?"

Never heard of it.

My 63-minute native RISC-V build became 4 minutes with cross-rs. Same binary, 14x faster. A tool that's existed since 2016, solving problems I'd been wrestling with the hard way.

The curse of experience: you stop exploring alternatives when your patterns work.

https://bit.ly/4qmkYbV

#RustLang #RISCV #CrossCompilation #OpenSource #Tauri #devEco

The Old Dog Learns a New Trick: Cross-Compiling Tauri CLI for RISC-V | Bruno Verachten

The Old Dog Learns a New Trick: A Lesson in Technical Humility After 12 years of cross-compiling for exotic architectures (ARM32 since 2013, unofficial Node.js builds, Docker on RISC-V hardware) I thought I knew the landscape. Strong opinions, formed over a decade of wrestling with toolchains and sysroots. Then a Tauri maintainer left a comment on my PR: "Have you considered cross?" Cross-rs? I'd never heard of it. Let me say that again: twelve years of experience, and I'd never encountered a tool that's been solving these exact problems since 2016. Nine years of development. Excellent RISC-V support. Pre-built Docker containers with toolchains already configured. The results were humbling: • QEMU emulation: 6+ hours (killed) • Native RISC-V (Banana Pi F3): 63 minutes • cross-rs on x64: 4 minutes 27 seconds 14x faster than native hardware. 90x faster than emulation. Same code, same binary output. Here's the uncomfortable truth: I had opinions about cross-compilation. Those opinions weren't wrong (cross-compiling WebKit apps IS a nightmare). But I was solving the wrong problem. Tauri CLI doesn't need WebKit; it's just a build orchestrator. This is the curse of experience: you learn patterns that work, and you stop exploring alternatives. "I know how to do this" becomes "I know how it's done" becomes "this is how it's done." Except sometimes a tool comes along that makes your carefully accumulated knowledge... not obsolete, but certainly less essential. The gray hairs from the ARM32 era taught me A way. Not THE way. Lesson learned: Ask before assuming. A decade of experience doesn't mean you've seen everything. That's not embarrassing, that's the job. PR submitted: https://lnkd.in/eESe_khN Tool that changed everything: https://lnkd.in/e_BbXTCf #RustLang #RISCV #CrossCompilation #OpenSource #Tauri #DevOps #devEco #TechnicalLeadership #LessonsLearned

I uploaded another #LLVM #Meetup #Darmstadt talk to our YouTube.
Talking about #Buildbots and #CrossCompilation to submit patches to the #XRay system.

Check it out!

Sebastian Kreutzer - Taming the Buildbots [LLVM Meetup Darmstadt]
https://youtu.be/zsPkJmAgvOU

Sebastian Kreutzer - Taming the Buildbots [LLVM Meetup Darmstadt]

YouTube

Getting started with a cool new project: building my own minimalist Linux OS for x86_64 using Buildroot! 🛠️

Just finished the full cross-compilation with the pc_x86_64_bios_defconfig. The resulting tiny system is up and running in QEMU.

Excited to spend the next few days exploring Buildroot's potential, from custom kernels to package management. Time to dig into the embedded world! 🚀

#Buildroot #Linux #EmbeddedSystems #QEMU #CrossCompilation #OSDev #VirtIO #OpenSource

I've found out the reason for the error:

error: could not find native static library `ggml`, perhaps an -L flag is missing?

Apparently, when cross-compiling, it can sometimes happen (especially with Windows target) that the compiler searches for "lib*" as prefix in the file name.

So when renaming compiled `ggml` to `libggml`, the error disappeared.

Unfortunately, I still get a linker error, but I don't bother anymore (direct Windows compile in CI works now)

#CrossCompilation #CrossCompiling

Loko Scheme: where optimizing compilers meet the chaos of #Linux and #NetBSD bare metal 🤖. A delightful trip back to the 90s, complete with a Git clone adventure 🚀. Because who doesn't want to crosscompile while speaking fluent R6RS and R7RS? 😂
https://scheme.fail/ #LokoScheme #OptimizingCompilers #CrossCompilation #RetroTech #HackerNews #ngated
scheme.fail - Loko Scheme

Loko Scheme is a bare metal Scheme implementation