While Busybox offers us many essential Unix utilities, we still miss a few essential programs for our mission. We cannot partition a hard disk, we cannot select an appropriate keyboard layout and we cannot create or repair ext2 file systems. Busybox can be made to include mkfs and fsck for Minix file systems, but not for the much more common Ext2 file system. Both util-linx and e2fsprogs complain if you had not built uClibc with large file support.
First start another shell and type the following command:
export PATH=$MYBOOT/uclibc-dev/usr/bin:$PATHFrom now on, the uClibc version of gcc will be used instead of the normal version.
For now we need util-linux only for the fdisk and cfdisk utilities. The build procedure is as follows:
cp $MYBOOT/uclibc-dev/include/ncurses/curses.h \ $MYBOOT/uclibc-dev/include make HAVE_NCURSES=yes LIBCURSES=-lncursesAll the trouble is to get cfdisk compiled, so we can use it in addition to or instead of the stone age fdisk program.
Now we will build e2fsprogs as follows:
./configure make BUILD_CC=/usr/bin/gcc
strip e2fsck/e2fsck.shared mv e2fsck/e2fsck.shared $MYBOOT/rootfs/sbin/e2fsck strip misc/mke2fs mv misc/mke2fs $MYBOOT/rootfs/sbin
Now we still need to be able to load keyboard definitions for foreign keyboards. Now enter the kbd subdirectory. Run the local configure command and then create the file defines.h with the following contents:
#define LC_ALL 0Now you can make the program without errors, but apparently it is a bit buggy. Move the loadkeys binary and key maps to the rootfs directory.
strip src/loadkeys mv src/loadkeys $MYBOOT/rootfs/usr/bin mkdir $MYBOOT/rootfs/usr/share/kbd cp -a data/keymaps $MYBOOT/usr/share/kbdNow you can weed out a lot of those keymap files that we do not need. Start with removing the amiga, atari, mac and sun directories. In the i386 directories there are probably only a few maps you want to keep, one for each country that your product may need to be used. All files that are left can be compressed with gzip. I kept the keymaps for Belgium, France, Germany, UK and US (used almost exclusively in the Netherlands) and all include directories (and these are probably not even needed). If you want to test loadkeys using the familiar chroot trick, this only works on a text console and you may need some of the device nodes already in place (see next chapter).
This is the time to build any other programs you will need. Link them
with uClibc and move them to the one of the binary
subdirectories in the
$MYBOOT/rootfs directory. If linking with uClibc does not work, try to link statically using the ordinary gcc.