Buildroot Raspberry Pi 4
During my previous experiments with Raspberry Pi (including clusterinng, embedded control, kiosks, etc), I've used Buildroot embedded system heavily. Many advantages include being able to prepare a reproducible SD-card image, which includes all the desired applications, their configuration files, etc - while remaining nimble, and without any unnecessary moving pieces.
As a result, Buildroot images start-up faster, provide solid ground for tweaking, and are less likely to suffer from lost work due to data corruption or forgotten changes. Unfortunately, at the time of this writing, Raspberry Pi 4 is not supported by the upstream version of buildroot - the current changes are forked on my own git repository http://github.com/qdotme/buildroot, and made available for merging.
32bit vs 64bit
The 64bit support on Raspberry Pi 4 is not ready yet - most notably, the SD/MMC support fails over with an error. That said, the buildroot changes were made in such a way as to retain 64bit support - if booted with root on a USB media, or on an initial ramdisk, the resulting infrastructure for building a 64bit userland works well, and the userland is mostly usable.
Structure
There are two ways to look at the task ahead - what needs to be done, and where it needs to be done. It's helpful to think about both approaches at once, when reviewing the changes:
What needs to be done?
- Kernel Version: Moved from: 5eeff139ea9135db6e01a58ef613338f1d0899d8 to 246113692edbef9a438b31ab2dd0172a30ed5eb2
- Kernel Config: Moved from: bcm2709_defconfig to bcm2711_defconfig
- Kernel Device Table: Moved from: bcm2710-rpi-3-b to bcm2711-rpi-4-b
- Bootloader: Extensive changes - different filenames, and different source versions
Where it needs to be done?
- configs/raspberrypi4_defconfig - this new file defines the necessary settings for building for the new platform
- board/raspberrypi4 - this new directory (actually a symlink) enabled building for a different variant of Raspberry Pi
- board/raspberrypi4/genimage-raspberrypi4.cfg - this new file specifies the layout of the SDcard
- package/rpi-firmware - changes to the package definition allows the configuration file to specify whether the Raspberry Pi 1-3 bootloader, or Raspberry Pi 4 bootloader is to be installed.
configs/raspberrypi4_defconfig - the Buildroot Configuration
This is the top-most configuration change - it ties together all subsequent modifications: