Installing a kernel

Estimated build time:           Depends on options selected
Estimated required disk space:  Depends on options selected

Building the kernel involves a few steps: configuring it and compiling it. There are a few ways to configure the kernel. If you don't like the way this book does it, read the README that comes with the kernel source tree, and find out what the other options are.

Something you could do, is take the .config file from your host distribution's kernel source tree and copy it to $LFS/usr/src/linux. This way you don't have to configure the entire kernel from scratch and can use your current values. If you choose to do this, first run the make mrproper command below, then copy the .config file over, then run make menuconfig (make oldconfig may be better in some situations. See the README file for more details when to use make oldconfig).

The following commands are run to build the kernel:

cd /usr/src/linux &&
make mrproper &&
make menuconfig &&
make dep &&
make bzImage &&
make modules &&
make modules_install &&
cp arch/i386/boot/bzImage /boot/lfskernel &&
cp System.map /boot

Note: the arch/i386/boot/bzImage path may vary on different platforms.

Dependencies

Linux-2.4.8 needs the following to be installed:


sh from the bash package

ar from the binutils package
as from the binutils package
ld from the binutils package
nm from the binutils package
objcopy from the binutils package

chown from the fileutils package
cp from the fileutils package
ln from the fileutils package
mkdir from the fileutils package
mv from the fileutils package
rm from the fileutils package

find from the findutils package
xargs from the findutils package

gcc from the gcc package

grep from the grep package

make from the make package

awk from the mawk package

depmod from the modutils package
genksyms from the modutils package

hostname from the net-tools package

sed from the sed package

basename from the sh-utils package
date from the sh-utils package
expr from the sh-utils package
pwd from the sh-utils package
uname from the sh-utils package
whoami from the sh-utils package
yes from the sh-utils package

cat from the textutils package
md5sum from the textutils package
sort from the textutils package
tail from the textutils package
touch from the textutils package
tr from the textutils package