Menu

Buildroot with Raspberry Pi - Automating and sharing

Automation is an important part of every software project. If you need to do something repeatedly, chances are, that it can be easily put in a script and done for you. It is especially important in build systems, that is why I would like to automate all the steps, that are needed for building a custom Linux for RPi using Buildroot.

Basically, I copied the existing repo to another, hosted on bitbucket. This allows me to make all the changes, and, when needed, merge any new code that is added to the original repository. From now on, I can clone the repository directly from:

$ git clone git@bitbucket.org:ltekieli/buildroot_rpi.git

Most of the configuration changes made to Buildroot up until now were made using make nconfig. The configuration can be saved using:

$ make savedefconfig

The outcome of this command is a new configuration file which can be found in configs/raspberrypi_defconfig. Just copy this configuration to the newly setup repo, and from now on, Buildroot will use this config by default.

post-image.sh is a script which is automatically run by Buildroot after compilation and rootfs preparation. In case of Raspberry Pi, this scripts generates the sdcard.img using genimage tool, based on board/raspberrypi/genimage-raspberrypi.cfg

The genimage-raspberrypi.cfg needs to be changed to add u-boot, scripts and initial root file system: