blob: 8d6afbcc0cc8bc4ae9c01d4b7b7c0a147d4ef7c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY busybox-version '1.19.2'>
<!ENTITY busybox-download-http "http://www.busybox.net/downloads/busybox-1.19.2.tar.bz2">
]>
<sect1 id="busybox" xreflabel="busybox &busybox-version;">
<?dbhtml filename="busybox.html"?> <title>busybox &busybox-version;</title>
<note><para>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.</para></note>
<para/>
<sect2 role="package">
<title>Introduction to busybox</title>
<para>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.</para>
<para>Busybox can be build staticly easily so we don't have to care about the shared libraries.</para>
<itemizedlist spacing="compact">
<listitem>
<para>Download (HTTP): <ulink url="&busybox-download-http;"/></para>
</listitem>
</itemizedlist>
</sect2>
<sect2>
<title>Building busybox</title>
<para>In the root of the sourcedir:</para>
<screen><userinput>make mrproper
make allnoconfig </userinput></screen>
<para>"make mrproper" will cleanup the sourcedir, previous config files etc. will be removed.</para>
<para>"make allnoconfig" will make a simple config file with all options disabled.</para>
<para/>
<para>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.</para>
<screen><userinput>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 </userinput></screen>
<para>Build the executable:</para>
<screen><userinput>make </userinput></screen>
<para>Now we have a static build busybox. Keep it for later use.</para>
</sect2>
</sect1>
|