Changes between Version 25 and Version 26 of buildroot

09/11/2020 08:39:23 PM (3 years ago)
Tim Harvey

added sections on busybox init and file overlay


  • buildroot

    v25 v26  
    111111 * Target packages -> !BusyBox -> !BusyBox configuration file to use
    112112 * defaults to package/busybox/busybox.config
     116== Adding or modifying files in the rootfs
     117A common need is to add or modify existing files in the root filesystem. Buildroot makes this very easy by allowing a set of directories to be specified that it will overlay on the target root filesytem.
     120 * Add firmware for the Sterling LWB wireless module (obtained from
     121  1. make menuconfig and set BR2_ROOTFS_OVERLAY=files
     122  2. create an overlay directory. For example, add firmware for the LAIRD sterling-lwb wifi module:
     124mkdir -p files
     125tar xvf firmware- -C files
     127  3. build with 'make'
     128  4. notice your files are now in output/target/lib/firmware/brcm
     130If you wish to modify a file simply provide your version of it in your overlay and it will be copied over the original. If you wish to remove a file you can provide a 0-byte version of the file which may meet your needs.
     133== Create a custom init script
     134The {{{init}}} program is the first userspace program started by the kernel (with PID 1) and is responsible for starting the userspace services. There are three different types of init provided by buildroot which can be chosen under 'System cnfiguration, Init system' but the default solution provided by busybox is usually just fine for embedded systems.
     136The busybox init system is configured vi an /etc/inittab which has a fairly simple syntax. The important items in this file do the following:
     137 * mount various psuedo-filesystems such as proc
     138 * execute /etc/init.d/rcS on startup
     139 * execute /etc/init.d/rcK on shutdown
     140 * kick off a getty process on the console tty allowing login
     142The /etc/init.d/rcS script executes the scripts in /etc/init.d which match the 'S??*' pattern. If you want a custom init script you can add one here. A good example to start with is the /etc/init.d/S40network example.
     144For more information see the Buildroot user manual 'init system' section.