The trickiest part to get right is probably the C library, especially because we want to use shared libraries. The space savings are tremendous and once this is done right, you can fit many more utilities on a diskette. The directory where the shared libraries exist on the target system (where they will be used) is different from the directory where they exist on the host system. Without special tricks, the binaries that are compiled with uClibc won't run on the host system.
First create the following subdirectories under the myboot directory.
Next cd into the myboot/uClibc directory. There run the following command:
ln -s extra/Configs/Config.i386 Config
Next edit the Config file as follows:
KERNEL_SOURCE=/home/lennartb/myboot/linuxIt is important that this directory matches the kernel that will eventually be used on the boot diskette.
Run the following commands to make and install the library. Note that we do not install the library as root as we do not install it in a system-wide directory.
make make install make PREFIX=/home/lennartb/myboot/rootfs install_target
The first command compiles the libraries, the second command installs the development code into the uclibc-dev directory and the last command installs the shared libraries into the rootfs directory. These will end up on the root file system of the bootable diskette.
Compiling with uClibc can be as simple as putting the uclibc-dev directory first in your path and just running make. Note that you cannot run the programs you have just made on the host system.