From 7df987a652b93d55dd8eca363706d3bacc469b55 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Thu, 27 Nov 2014 16:29:31 -0600 Subject: Initial commit message for lfs live howto. --- book/busybox.html | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 book/busybox.html (limited to 'book/busybox.html') diff --git a/book/busybox.html b/book/busybox.html new file mode 100644 index 0000000..adcbd96 --- /dev/null +++ b/book/busybox.html @@ -0,0 +1,60 @@ + +2.4. busybox 1.19.2

2.4. busybox 1.19.2

[Note]

Note

This chapter is mandatory for both the livecd and the livekey. Busybox is used in the initrd which will be discussed later in the book.

2.4.1. Introduction to busybox

Busybox is a utility that combines many common utilities in one. Although the functions provided by busybox would have limited options, in compare with the original utility, it would be often sufficient to do simple tasks. In this way you can save crucial space, like in a small initial ramdisk.

Busybox can be build staticly easily so we don't have to care about the shared libraries.

2.4.2. Building busybox

In the root of the sourcedir:

make mrproper 
+make allnoconfig 

"make mrproper" will cleanup the sourcedir, previous config files etc. will be removed.

"make allnoconfig" will make a simple config file with all options disabled.

Modify the config, so that we enable only the necessary functions. Note that this can be done by "make menuconfig" but for the sake of simplicity we modify the config with sed.

sed -e 's/# CONFIG_FEATURE_INSTALLER is not set/CONFIG_FEATURE_INSTALLER=y/' -i .config 
+sed -e 's/# CONFIG_INSTALL_NO_USR is not set/CONFIG_INSTALL_NO_USR=y/' -i .config 
+sed -e 's/# CONFIG_LONG_OPTS is not set/CONFIG_LONG_OPTS=y/' -i .config
+sed -e 's/# CONFIG_STATIC is not set/CONFIG_STATIC=y/' -i .config
+sed -e 's/# CONFIG_LFS is not set/CONFIG_LFS=y/' -i .config
+sed -e 's/# CONFIG_CAT is not set/CONFIG_CAT=y/' -i .config
+sed -e 's/# CONFIG_TEST is not set/CONFIG_TEST=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_TEST_64 is not set/CONFIG_FEATURE_TEST_64=y/' -i .config
+sed -e 's/# CONFIG_CUT is not set/CONFIG_CUT=y/' -i .config 
+sed -e 's/# CONFIG_ECHO is not set/CONFIG_ECHO=y/' -i .config 
+sed -e 's/# CONFIG_FEATURE_FANCY_ECHO is not set/CONFIG_FEATURE_FANCY_ECHO=y/' -i .config
+sed -e 's/# CONFIG_SLEEP is not set/CONFIG_SLEEP=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_FANCY_SLEEP is not set/CONFIG_FEATURE_FANCY_SLEEP=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_FLOAT_SLEEP is not set/CONFIG_FEATURE_FLOAT_SLEEP=y/' -i .config
+sed -e 's/# CONFIG_USLEEP is not set/CONFIG_USLEEP=y/' -i .config
+sed -e 's/# CONFIG_MODINFO is not set/CONFIG_MODINFO=y/' -i .config
+sed -e 's/# CONFIG_INSMOD is not set/CONFIG_INSMOD=y/' -i .config
+sed -e 's/# CONFIG_RMMOD is not set/CONFIG_RMMOD=y/' -i .config
+sed -e 's/# CONFIG_LSMOD is not set/CONFIG_LSMOD=y/' -i .config
+sed -e 's/# CONFIG_MODPROBE is not set/CONFIG_MODPROBE=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set/CONFIG_FEATURE_MODPROBE_BLACKLIST=y/' -i .config
+sed -e 's/# CONFIG_DEPMOD is not set/CONFIG_DEPMOD=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set/CONFIG_FEATURE_INSMOD_TRY_MMAP=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set/CONFIG_FEATURE_CHECK_TAINTED_MODULE=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_MODUTILS_ALIAS is not set/CONFIG_FEATURE_MODUTILS_ALIAS=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set/CONFIG_FEATURE_MODUTILS_SYMBOLS=y/' -i .config
+sed -e 's/CONFIG_DEFAULT_MODULES_DIR=""/CONFIG_DEFAULT_MODULES_DIR="\/lib\/modules"/' -i .config
+sed -e 's/CONFIG_DEFAULT_DEPMOD_FILE=""/CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"/' -i .config
+sed -e 's/# CONFIG_FINDFS is not set/CONFIG_FINDFS=y/' -i .config 
+sed -e 's/# CONFIG_MOUNT is not set/CONFIG_MOUNT=y/' -i .config 
+sed -e 's/# CONFIG_FEATURE_MOUNT_FAKE is not set/CONFIG_FEATURE_MOUNT_FAKE=y/' -i .config 
+sed -e 's/# CONFIG_FEATURE_MOUNT_LABEL is not set/CONFIG_FEATURE_MOUNT_LABEL=y/' -i .config 
+sed -e 's/# CONFIG_FEATURE_MOUNT_FLAGS is not set/CONFIG_FEATURE_MOUNT_FLAGS=y/' -i .config 
+sed -e 's/# CONFIG_SWITCH_ROOT is not set/CONFIG_SWITCH_ROOT=y/' -i .config 
+sed -e 's/# CONFIG_UMOUNT is not set/CONFIG_UMOUNT=y/' -i .config 
+sed -e 's/# CONFIG_FEATURE_UMOUNT_ALL is not set/CONFIG_FEATURE_UMOUNT_ALL=y/' -i .config 
+sed -e 's/# CONFIG_FEATURE_MOUNT_LOOP is not set/CONFIG_FEATURE_MOUNT_LOOP=y/' -i .config 
+sed -e 's/# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set/CONFIG_FEATURE_MOUNT_LOOP_CREATE=y/' -i .config 
+sed -e 's/# CONFIG_VOLUMEID is not set/CONFIG_VOLUMEID=y/' -i .config 
+sed -e 's/# CONFIG_FEATURE_VOLUMEID_EXT is not set/CONFIG_FEATURE_VOLUMEID_EXT=y/' -i .config
+sed -e 's/# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set/CONFIG_FEATURE_VOLUMEID_ISO9660=y/' -i .config 
+sed -e 's/# CONFIG_FEATURE_VOLUMEID_UDF is not set/CONFIG_FEATURE_VOLUMEID_UDF=y/' -i .config 
+sed -e 's/# CONFIG_FEATURE_VOLUMEID_ROMFS is not set/CONFIG_FEATURE_VOLUMEID_ROMFS=y/' -i .config 
+sed -e 's/# CONFIG_FEATURE_VOLUMEID_SYSV is not set/CONFIG_FEATURE_VOLUMEID_SYSV=y/' -i .config 
+sed -e 's/# CONFIG_ASH is not set/CONFIG_ASH=y/' -i .config 
+sed -e 's/# CONFIG_ASH_BASH_COMPAT is not set/CONFIG_ASH_BASH_COMPAT=y/' -i .config 
+sed -e 's/# CONFIG_ASH_JOB_CONTROL is not set/CONFIG_ASH_JOB_CONTROL=y/' -i .config 
+sed -e 's/# CONFIG_ASH_ALIAS is not set/CONFIG_ASH_ALIAS=y/' -i .config 
+sed -e 's/# CONFIG_ASH_GETOPTS is not set/CONFIG_ASH_GETOPTS=y/' -i .config 
+sed -e 's/# CONFIG_ASH_BUILTIN_ECHO is not set/CONFIG_ASH_BUILTIN_ECHO=y/' -i .config 
+sed -e 's/# CONFIG_ASH_BUILTIN_PRINTF is not set/CONFIG_ASH_BUILTIN_PRINTF=y/' -i .config 
+sed -e 's/# CONFIG_ASH_BUILTIN_TEST is not set/CONFIG_ASH_BUILTIN_TEST=y/' -i .config 
+sed -e 's/# CONFIG_ASH_CMDCMD is not set/CONFIG_ASH_CMDCMD=y/' -i .config 
+sed -e 's/# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set/CONFIG_ASH_OPTIMIZE_FOR_SIZE=y/' -i .config 
+sed -e 's/# CONFIG_FEATURE_SH_IS_ASH is not set/CONFIG_FEATURE_SH_IS_ASH=y/' -i .config 
+sed -e 's/# CONFIG_FEATURE_BASH_IS_ASH is not set/CONFIG_FEATURE_BASH_IS_ASH=y/' -i .config 
+sed -e 's/CONFIG_FEATURE_SH_IS_NONE=y/# CONFIG_FEATURE_SH_IS_NONE is not set/' -i .config 
+sed -e 's/CONFIG_FEATURE_BASH_IS_NONE=y/# CONFIG_FEATURE_BASH_IS_NONE is not set/' -i .config 

Build the executable:

make 

Now we have a static build busybox. Keep it for later use.

-- cgit v1.2.3-54-g00ecf