Changes between Version 25 and Version 26 of buildroot


Ignore:
Timestamp:
09/11/2020 08:39:23 PM (4 years ago)
Author:
Tim Harvey
Comment:

added sections on busybox init and file overlay

Legend:

Unmodified
Added
Removed
Modified
  • buildroot

    v25 v26  
    111111 * Target packages -> !BusyBox -> !BusyBox configuration file to use
    112112 * defaults to package/busybox/busybox.config
     113
     114
     115[=#overlay]
     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.
     118
     119Examples
     120 * Add firmware for the Sterling LWB wireless module (obtained from https://www.lairdconnect.com/wireless-modules/wi-fi-bt-modules/sterling-lwb)
     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:
     123{{{#!bash
     124mkdir -p files
     125tar xvf firmware-7.0.0.326.tar.bz2 -C files
     126}}}
     127  3. build with 'make'
     128  4. notice your files are now in output/target/lib/firmware/brcm
     129
     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.
     131
     132[=#init]
     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.
     135
     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
     141
     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.
     143
     144For more information see the Buildroot user manual 'init system' section.
     145
    113146
    114147