next up previous contents
Next: Other Essential Binaries Up: Getting Linux into Small Previous: Building uClibc   Contents

Building Busybox

First cd into the myboot/busybox-0.60.3 subdirectory.

Edit the file Conf.h as follows:

Edit the Makefile as follows:

Now build the program.

make
make PREFIX=/home/lennartb/myboot/rootfs install

Because you have linked with the dynamic uClibc library and these are not installed in the host system's /lib directory, the program cannot run. There is a trick to work around it: by using the chroot command, you can run a program whose root directory is the specified directory. Become root and type the following command:

/usr/sbin/chroot /home/lennartb/myboot/rootfs /bin/sh
The shell that you are now in is the shell inside the
/home/lennartb/myboot/rootfs directory. This shell thinks that this rootfs directory is in fact the root directory: even the shared libraries of uClibc in the /lib directory will be found. Type the command ls / and it will be clear. Exit the chroot subshell with Control-D and everything will be back to normal.

Now you have most common Unix utilities including an editor and a shell and you've spent only 576kB of disk space!


next up previous contents
Next: Other Essential Binaries Up: Getting Linux into Small Previous: Building uClibc   Contents
Lennart Benschop 2003-05-29