Table of Contents
- Get the busybox source code
- Change configuration
- Compile the busybox
- Install the minimal filesystem
In the earlier articles, we compiled toolchain, U-boot, Linux kernel for the Raspberry Pi 3 Model B.
In order for a Linux system to function fully, a few applications are required. When the Linux kernel boots, it tries to mount the filesystem and then looks for an
init program to execute. If the init program is not found, the kernel panicks and boot process will be stopped.
A shell to execute the commands and some basic utilities are also required to make the Linux system usable.
Busybox is a software suite, that generates a minimal root file system with an init program, the shell and basic Linux utilities.
Get the busybox source code
cd ~/rpi3/ git clone git://busybox.net/busybox.git cd busybox # Checkout to latest stable version. Can be found with `git tag --sort=v:refname` git checkout 1_31_1
- Build busybox statically (without shared liraries) by enabling Settings -> Build static binary (no shared libraries)
- Add cross compiler prefix (aarch64-rpi3-linux-uclibc-) by going into Settings -> Cross compiler prefix
- Add installation directory by going into Settings -> Destination path for ‘make install’. Give the full path. Ex:
/home/USERNAME/rpi/nfs. Replace USERNAME with you Ubuntu system username.
- Disable IPV6 support for busybox by going into Networking Utilities -> Enable IPV6 support.
Compile the busybox
export PATH=$PATH:~/x-tools/aarch64-rpi3-linux-uclibc/bin/ make
Install the minimal filesystem
This will install the minimal root filesystem to the path
~/rpi3/nfs. Verify the content with following command.
The list should be similar to the following.
bin linuxrc sbin usr
In the next section, we will make the Linux kernel mount the root file system over network.