This chapter describes building the Linux kernel using the
GCC/uClibc toolchain described in Chapter 2, Toolchain and libraries.
This toolchain is then used to build
a small footprint
coreutils. Finally it describes
how to write the kernel and root file system to Compact Flash (CF).
This chapter is a part of the "Secure Internet Appliance for Small Office / Home Office HOWTO". It relies on environment variables listed in Section 2.1, “Environment Variables”.
I have evaluated linux kernel releases 2.6.11, 22.214.171.124 and 126.96.36.199 and found 2.6.11 the most stable for use in SISO. I recently switched to 2.6.22-4. Download and extract it using the commands below.
wget -P $DL_DIR ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.tar.bz2 # was 2.6.11, 2.6.22-4, 2.6.23-9 mkdir -p $PRJ_DIR/kernel tar -C $PRJ_DIR/kernel -xvjf $DL_DIR/linux-2.6.24.tar.bz2 cd $LINUX_DIR
Configure the kernel using the commands listed below. An example
.config can be found in
Example A.3, “linux-2.6.24 .config”.
Enable serial communications to the
console device drv → char → serial → 8250/16550 → Console. Otherwise the kernel
might boot, but will lack any signs of life on the console.
General Purpose I/O (GPIO) is supported by the
make oldconfig make xconfig
The configuration uses CONFIG_UID16=y. Otherwise, busybox initialization will fail with a ": setuid" error message when it reverts the sticky bit for commands that do not need high permissions.
For NAT, NF_NAT is needed, and depends on IP_NF_IPTABLES && NF_CONTRACK_IPV4
Start the compilation and install the modules to
make CROSS_COMPILE=$TOOLCHAIN_CROSS INSTALL_MOD_PATH=$ROOTFS_DIR \ bzImage modules modules_install
qt-devel package is required for
make xconfig. Ensure that the package is installed
rpm -q qt-devel). Install as needed using
yum install qt-devel.