summaryrefslogtreecommitdiffstats
path: root/busybox.xml
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&apos;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>&quot;make mrproper&quot; will cleanup the sourcedir, previous config files etc. will be removed.</para>
    <para>&quot;make allnoconfig&quot; 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 &quot;make menuconfig&quot; but for the sake of simplicity we modify the config with sed.</para>
    <screen><userinput>sed -e &apos;s/# CONFIG_FEATURE_INSTALLER is not set/CONFIG_FEATURE_INSTALLER=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_INSTALL_NO_USR is not set/CONFIG_INSTALL_NO_USR=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_LONG_OPTS is not set/CONFIG_LONG_OPTS=y/&apos; -i .config
sed -e &apos;s/# CONFIG_STATIC is not set/CONFIG_STATIC=y/&apos; -i .config
sed -e &apos;s/# CONFIG_LFS is not set/CONFIG_LFS=y/&apos; -i .config
sed -e &apos;s/# CONFIG_CAT is not set/CONFIG_CAT=y/&apos; -i .config
sed -e &apos;s/# CONFIG_TEST is not set/CONFIG_TEST=y/&apos; -i .config
sed -e &apos;s/# CONFIG_FEATURE_TEST_64 is not set/CONFIG_FEATURE_TEST_64=y/&apos; -i .config
sed -e &apos;s/# CONFIG_CUT is not set/CONFIG_CUT=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_ECHO is not set/CONFIG_ECHO=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_FEATURE_FANCY_ECHO is not set/CONFIG_FEATURE_FANCY_ECHO=y/&apos; -i .config
sed -e &apos;s/# CONFIG_SLEEP is not set/CONFIG_SLEEP=y/&apos; -i .config
sed -e &apos;s/# CONFIG_FEATURE_FANCY_SLEEP is not set/CONFIG_FEATURE_FANCY_SLEEP=y/&apos; -i .config
sed -e &apos;s/# CONFIG_FEATURE_FLOAT_SLEEP is not set/CONFIG_FEATURE_FLOAT_SLEEP=y/&apos; -i .config
sed -e &apos;s/# CONFIG_USLEEP is not set/CONFIG_USLEEP=y/&apos; -i .config
sed -e &apos;s/# CONFIG_MODINFO is not set/CONFIG_MODINFO=y/&apos; -i .config
sed -e &apos;s/# CONFIG_INSMOD is not set/CONFIG_INSMOD=y/&apos; -i .config
sed -e &apos;s/# CONFIG_RMMOD is not set/CONFIG_RMMOD=y/&apos; -i .config
sed -e &apos;s/# CONFIG_LSMOD is not set/CONFIG_LSMOD=y/&apos; -i .config
sed -e &apos;s/# CONFIG_MODPROBE is not set/CONFIG_MODPROBE=y/&apos; -i .config
sed -e &apos;s/# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set/CONFIG_FEATURE_MODPROBE_BLACKLIST=y/&apos; -i .config
sed -e &apos;s/# CONFIG_DEPMOD is not set/CONFIG_DEPMOD=y/&apos; -i .config
sed -e &apos;s/# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set/CONFIG_FEATURE_INSMOD_TRY_MMAP=y/&apos; -i .config
sed -e &apos;s/# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set/CONFIG_FEATURE_CHECK_TAINTED_MODULE=y/&apos; -i .config
sed -e &apos;s/# CONFIG_FEATURE_MODUTILS_ALIAS is not set/CONFIG_FEATURE_MODUTILS_ALIAS=y/&apos; -i .config
sed -e &apos;s/# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set/CONFIG_FEATURE_MODUTILS_SYMBOLS=y/&apos; -i .config
sed -e &apos;s/CONFIG_DEFAULT_MODULES_DIR=&quot;&quot;/CONFIG_DEFAULT_MODULES_DIR=&quot;\/lib\/modules&quot;/&apos; -i .config
sed -e &apos;s/CONFIG_DEFAULT_DEPMOD_FILE=&quot;&quot;/CONFIG_DEFAULT_DEPMOD_FILE=&quot;modules.dep&quot;/&apos; -i .config
sed -e &apos;s/# CONFIG_FINDFS is not set/CONFIG_FINDFS=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_MOUNT is not set/CONFIG_MOUNT=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_FEATURE_MOUNT_FAKE is not set/CONFIG_FEATURE_MOUNT_FAKE=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_FEATURE_MOUNT_LABEL is not set/CONFIG_FEATURE_MOUNT_LABEL=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_FEATURE_MOUNT_FLAGS is not set/CONFIG_FEATURE_MOUNT_FLAGS=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_SWITCH_ROOT is not set/CONFIG_SWITCH_ROOT=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_UMOUNT is not set/CONFIG_UMOUNT=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_FEATURE_UMOUNT_ALL is not set/CONFIG_FEATURE_UMOUNT_ALL=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_FEATURE_MOUNT_LOOP is not set/CONFIG_FEATURE_MOUNT_LOOP=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set/CONFIG_FEATURE_MOUNT_LOOP_CREATE=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_VOLUMEID is not set/CONFIG_VOLUMEID=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_FEATURE_VOLUMEID_EXT is not set/CONFIG_FEATURE_VOLUMEID_EXT=y/&apos; -i .config
sed -e &apos;s/# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set/CONFIG_FEATURE_VOLUMEID_ISO9660=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_FEATURE_VOLUMEID_UDF is not set/CONFIG_FEATURE_VOLUMEID_UDF=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_FEATURE_VOLUMEID_ROMFS is not set/CONFIG_FEATURE_VOLUMEID_ROMFS=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_FEATURE_VOLUMEID_SYSV is not set/CONFIG_FEATURE_VOLUMEID_SYSV=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_ASH is not set/CONFIG_ASH=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_ASH_BASH_COMPAT is not set/CONFIG_ASH_BASH_COMPAT=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_ASH_JOB_CONTROL is not set/CONFIG_ASH_JOB_CONTROL=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_ASH_ALIAS is not set/CONFIG_ASH_ALIAS=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_ASH_GETOPTS is not set/CONFIG_ASH_GETOPTS=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_ASH_BUILTIN_ECHO is not set/CONFIG_ASH_BUILTIN_ECHO=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_ASH_BUILTIN_PRINTF is not set/CONFIG_ASH_BUILTIN_PRINTF=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_ASH_BUILTIN_TEST is not set/CONFIG_ASH_BUILTIN_TEST=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_ASH_CMDCMD is not set/CONFIG_ASH_CMDCMD=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set/CONFIG_ASH_OPTIMIZE_FOR_SIZE=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_FEATURE_SH_IS_ASH is not set/CONFIG_FEATURE_SH_IS_ASH=y/&apos; -i .config 
sed -e &apos;s/# CONFIG_FEATURE_BASH_IS_ASH is not set/CONFIG_FEATURE_BASH_IS_ASH=y/&apos; -i .config 
sed -e &apos;s/CONFIG_FEATURE_SH_IS_NONE=y/# CONFIG_FEATURE_SH_IS_NONE is not set/&apos; -i .config 
sed -e &apos;s/CONFIG_FEATURE_BASH_IS_NONE=y/# CONFIG_FEATURE_BASH_IS_NONE is not set/&apos; -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>