Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Buildroot also allows user to easily apply patches to the kernel.  We apply the Preempt RT (real time) kernel patch.  This patch makes modifications to the kernel such that kernel interruptions are time-bounded.

Links

Why create a new version?

...

Buildroot versions can be found at their downloads page.  Note that if you see "rt-<version>" in the file name, that's the version of Preempt RT.

The current version that we use (2019.08) is here.

...

And now you can run "make".  It should succeed, and if so, you can find the artifacts in the "output/images/ " directory.

Here is the full sequence of commands:

Code Block
languagebash
egumtow@aird-b50-srv01 /scratch/egumtow> mkdir buildroot
egumtow@aird-b50-srv01 /scratch/egumtow> cd buildroot
egumtow@aird-b50-srv01 /scratch/egumtow/buildroot> mkdir buildroot-2019.08-2
egumtow@aird-b50-srv01 /scratch/egumtow/buildroot> cd buildroot-2019.08-2
egumtow@aird-b50-srv01 /scratch/egumtow/buildroot/buildroot-2019.08-2> mkdir host
egumtow@aird-b50-srv01 /scratch/egumtow/buildroot/buildroot-2019.08-2> mkdir download
egumtow@aird-b50-srv01 /scratch/egumtow/buildroot/buildroot-2019.08-2> git clone https://github.com/slaclab/buildroot-site.git site-top
egumtow@aird-b50-srv01 /scratch/egumtow/buildroot/buildroot-2019.08-2> wget https://buildroot.org/downloads/buildroot-2019.08.tar.gz
egumtow@aird-b50-srv01 /scratch/egumtow/buildroot/buildroot-2019.08-2> tar xzvf buildroot-2019.08.tar.gz
egumtow@aird-b50-srv01 /scratch/egumtow/buildroot/buildroot-2019.08-2> mv buildroot-2019.08 buildroot-2019.08-2-x86_64
egumtow@aird-b50-srv01 /scratch/egumtow/buildroot/buildroot-2019.08-2> cd buildroot-2019.08-2-x86_64/
egumtow@aird-b50-srv01 /scratch/egumtow/buildroot/buildroot-2019.08-2/buildroot-2019.08-2-x86_64> ln -s ../site-top site
egumtow@aird-b50-srv01 /scratch/egumtow/buildroot/buildroot-2019.08-2/buildroot-2019.08-2-x86_64> make
egumtow@aird-b50-srv01 /scratch/egumtow/buildroot/buildroot-2019.08-2/buildroot-2019.08-2-x86_64> ls -l output/images
total 58256
-rw-r--r-- 1 egumtow gu  3796944 Sep 19 16:36 bzImage
-rw-r--r-- 1 egumtow gu 62914560 Sep 19 16:36 rootfs.ext2
-rw-r--r-- 1 egumtow gu 17510981 Sep 19 16:36 rootfs.ext2.gz
drwxr-xr-x 2 egumtow gu     4096 Sep 19 16:34 syslinux/

The files in the "output/images" directory can be copied to the appropriate directory under the "boot" directory in AFS.

...

When you run the "save" commands you are saving the config files to the "site" directory where you will later push them to git.

Under which config (buildroot, linux, busybox) a config option exists isn't always obvious until you find it.

You may have different config files for different architectures.  I haven't dealt with this yet.  Will update this document when I do.

The buildroot build system has hooks that allow you to insert scripts at various points of the build.  This allows you to modify the artifacts after various points of the build.  In the repo that you cloned into the "site-top" directory, there is a "script" directory.  This directory contains these scripts.  We have a "post-build.sh" script that performs various tasks.  You can read about the post-build scripts here and here.  Note that the config options (e.g., BR2_ROOTFS_POST_BUILD_SCRIPT) described there are found in buildroot's (tool) "make menuconfig" target.

After you've made your config file changes and saved the configs, run "make clean" followed by "make".

buildroot documentation

Buildroot has ample documentation.  Be careful that the version of the documentation matches the version your buildroot.  The documentation that you should read comes with the download of buildroot at docs/manual/manual.text.

...

Archiving your buildroot

Don't forget to copy (or move) your entire buildroot-<year>.<month>-<version>-<architecture> to /afs/slac/g/lcls/tftpboot/linuxRT/boot/.