Kernel 7: Boot the Kernel

Setting Up Your New Kernel To Boot: Automated Procedure

Life is so much easier with the 2.6 kernel….

All you need to do (under most circumstances) is issue the command:

make install

If you haven’t had your daily dose of masochism, you can refer to the manual procedure below. Otherwise, however, go to the next page.

 

Setting Up Your New Kernel To Boot: Manual Procedure

You need to copy your kernel and the System.map file to /boot. Command:

cp arch/i386/boot/bzImage /boot/bzImage-your_kernel_version

cp System.map /boot/System.map-your_kernel_version

ln -s /boot/System.map-your_kernel_version /boot/System.map

Note the symlink you’re creating. Also note that this assumes you used a bzImage; change this as necessary.

 

Setting Up LiLO

Edit /etc/lilo.conf. Find the lines like:

image=/boot/vmliniz-2.4.21-20
label=linux
initrd=/boot/initrd-2.4.21-20.img
read-only
root=/dev/hda0

DUPLICATE these lines below the current ones,

  • changing the value of image=value to the new Linux kernel you’ve created, and
  • changing the value of label=value to something like Linux_kernel_version (don’t go wild here; you’re going to have to type this name, so choose something simple like Linux_2.6).
  • Also, let the default=value stay as it is, so your previous working kernel loads unless you specify otherwise. You can change this later if things work.

Save and exit, then command:

lilo

to reinstall LiLO with new settings. You’ll see an Added message. Voila!

 

Setting Up GrUB

GrUB is more flexible and a lot more forgiving of system errors. While LiLO requires that an alternate boot disk be used if your new kernel configuration renders the system unbootable, GrUB lets you modify kernel location, boot parameters, kernel to boot, etc. “on-the-fly.”

Edit GrUB’s configuration file in /boot/grub/menu.lst. Check if /etc/grub.conf is a symbolic link to this file.

# Note that you do not have to rerun grub after making changes to this file
#boot=/dev/hda
default=0
timeout=10
title Red Hat Linux (2.4.21-20)
  root (hd0,1)
  kernel /boot/vmlinuz-2.4.21-20 ro root=LABEL=/
  initrd /boot/initrd-2.4.21-20.img
title Red Hat Linux (2.4.20-20.9)
  root (hd0,1)
  kernel /boot/vmlinuz-2.4.20-20.9 ro root=LABEL=/
  initrd /boot/initrd-2.4.20-20.9.img

Add your new kernel information in a new sectiong beginning with title. Keep in mind that the GrUB count is a 0-based array (it starts from 0), so (hd0,1) refers to the first controller, second partition. Your configuration should look like this:

title Test Kernel (2.6.0)
  root (hd0,1)
  kernel /boot/bzImage-2.6.0 ro root=LABEL=/
  initrd /boot/initrd-2.6.0.img