In section 2 above I mentioned you can download a new kernel from ftp://ftp.kernel.org/
However, this site is often too busy to get through and the maintainers of
this site encourage you to download the kernel from a location near you. You
can access a mirror site by going to ftp://ftp.<country code>.kernel.org/
(like ftp.ca.kernel.org).
Rename the current /usr/src/linux directory to something else (/usr/src/linux
can be a symlink rather than an actual directory. Either way, rename it) by
running mv /usr/src/linux /usr/src/linux-old
Remove /usr/include/linux and /usr/include/asm by running rm -r /usr/include/linux
/usr/include/asm
Unpack the Kernel archive in the /usr/src/ directory (this will create
a new /usr/src/linux directory)
Create the /usr/include/linux and /usr/include/asm symlinks by running:
cd /usr/include
ln -s ../src/linux/include/linux linux
ln -s ../src/linux/include/asm-<cpu> asm
Look in the /usr/src/linux/include directory and see which asm-* directories
are present. Choose the correct one for your platform. If you're on an Intel
platform, you'd run ln -s ../src/linux/include/asm-i386 asm
Choose a method to configure the kernel (see the README file for more details
on configuration methods) and make sure you don't configure anything as modules
at this point. This is because we won't have the necessary software available
to load kernel modules for a while.
After you're done with your kernel configuration, run make dep
Compile the kernel by running make bzImage
Copy the arch/<cpu>/boot/bzImage file to the /boot directory (or
some place else if your Linux system uses a different convention where kernel
images and the like are stored)
Optionally you can rename the /boot/bzImage file to something like /boot/lfskernel
Copy the entire kernel source tree to the LFS partition by running: cp
-av /usr/src/linux $LFS/usr/src
Create the $LFS/usr/include/linux and $LFS/usr/include/asm
symlinks by running:
cd $LFS/usr/include
ln -s ../src/linux/include/linux linux
ln -s ../src/linux/include/asm asm