| name | busybox |
| description | BusyBox configuration and usage for embedded Linux systems. Use when creating minimal Linux environments, building rescue systems, or replacing standard utilities with BusyBox applets. |
BusyBox for Embedded Systems
Single binary providing common Unix utilities for minimal systems.
Installation
# Install from package manager
apt-get install busybox-static
# Or download and compile
wget https://busybox.net/downloads/busybox-1.36.1.tar.bz2
tar xf busybox-1.36.1.tar.bz2
cd busybox-1.36.1
Configuration
# Default configuration (all applets)
make defconfig
# Minimal configuration
make allnoconfig
# Interactive configuration
make menuconfig
Key Configuration Options
# Enable static linking (recommended for initramfs)
CONFIG_STATIC=y
# Essential applets
CONFIG_ASH=y # Shell
CONFIG_MOUNT=y # Mount filesystems
CONFIG_UMOUNT=y # Unmount filesystems
CONFIG_MKDIR=y # Create directories
CONFIG_LS=y # List files
CONFIG_CAT=y # Display files
CONFIG_ECHO=y # Print text
CONFIG_INIT=y # Init system
CONFIG_SWITCH_ROOT=y # Switch root filesystem
Building
# Build BusyBox
make -j$(nproc)
# Install to directory
make CONFIG_PREFIX=/path/to/initramfs install
Symlink Installation
BusyBox uses symlinks for applets:
# Manual symlink creation
cd initramfs/bin
ln -s busybox sh
ln -s busybox ls
ln -s busybox mount
# Or use --install flag
./busybox --install -s /path/to/initramfs/bin
Using as Init
Create /init using BusyBox shell:
#!/bin/busybox sh
/bin/busybox mount -t proc none /proc
/bin/busybox mount -t sysfs none /sys
/bin/busybox mount -t devtmpfs none /dev
exec /bin/busybox sh
Common Applets
| Applet | Description |
|---|---|
| sh/ash | Shell interpreter |
| init | System init |
| mount/umount | Filesystem mounting |
| ls/cat/cp/mv/rm | File operations |
| grep/sed/awk | Text processing |
| ifconfig/ip | Network configuration |
| switch_root | Root filesystem switch |
| mdev | Device manager |
Cross-Compilation
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j$(nproc)