Setting up Buildroot for Hardware Builds - cu-ecen-aeld/buildroot-assignments-base GitHub Wiki

Overview

This page contains common shared steps used to setup a buildroot project to build a hardware specific build.

  1. Ensure your build scripts build.sh, save_config.sh and shared.sh are up to date with the versions in the master branch. If you are in sync with the master branch you can use:
git remote add buildroot-base https://github.com/cu-ecen-5013/buildroot-assignments-base.git
git fetch buildroot-base
git merge buildroot-base/master

If you face merge issues, do a

git pull buildroot-base master --allow-unrelated-histories

to merge in the changes. You can also copy the content of your scripts manually.

  1. See your specific hardware instructions for this step.

  2. Run clean.sh and then build.sh to remove your buildroot/.config file and generate a new one based on the hardware configuration file.

  3. Make any changes to the buildroot configuration necessary using make menuconfig in the buildroot directory to pull in your base external packages, enable dropbear and any other necessary packages, and change the root password.

  4. Save configuration using save_config.sh

  5. Run build.sh to build the project. When build completes you should see a buildroot/output/images/sdcard.img file generated. This is an image you can write to an sdcard.

Upgrading to new buildroot releases or Changing Hardware Platforms

The contents of the hw-rpi and similar branches on the buildroot-assignments-base repository assume a specific configuration for a specific type of hardware as well as a specific buildroot release branch commit.

After upgrading the buildroot submodule or changing the buildroot configuraiton referenced in shared.sh you must:

  1. Delete the configuration file under base_external/configs.
  2. Run a clean build.

Emulating Raspberry Pi 3 on QEMU

  1. If trying to emulate Rpi3 on QEMU, then please note that Rpi3 is only supported in qemu-system-aarch64 as a 64-bit machine. This means the shared.sh must be modified to tell buildroot to compile for RPi3 64-bit.
  2. Ensure QEMU_DEFCONFIG=configs/raspberrypi3_64_defconfig is present in shared.sh
  3. Delete the configuration file under base_external/configs.
  4. Run a clean build.

Buildroot on Raspberry Pi 4

For Raspberry Pi 4 modify the shared.sh file as per the this link.

Troubleshooting

The buildroot files for the boot partition of the image contains a config.txt which may not be correctly configured. Ensure that below lines are commented out.

start_file=start.elf
fixup_file=fixup.dat