Download   Online Shop   Red Hat Network
Home  |  Products  |  Shop  |  Services  |  Training  |  Support   
Red Hat Documentation

Linux From Scratch: Installing a kernel Next Previous Contents

6. Installing a kernel

6.1 Note on ftp.kernel.org

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).

6.2 Configuring the kernel

  • 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

6.3 Updating LILO

  • Edit the /etc/lilo.conf file and go to the LFS section
  • Change the image name to lfskernel (or whatever you've named the originally called bzImage file)
  • Run lilo to update the boot loader.

6.4 Testing the system

Reboot your system and start your LFS system. Verify that the newly installed kernel doesn't perform out-of-the-ordinary actions (such as crashing).


Next Previous Contents

 

 
 
Search for:  on    Powered by Google
Products & Services   :   Download   :   Support   :   Training   :   Partners & Programs
© 2000 Red Hat, Inc. All right reserved.       About Red Hat   :   Legal statement   :   Privacy statement   :   Y2K statement   :   Contact Red Hat