next up previous contents
Next: Automated configuration and installation Up: Compilation and installation Previous: Magic SysRq   Contents


Installation

Some distributions allow you to install a newly compiled kernel by running

# make install
as root from within the directory that contains the kernel sources. Usually, however, you will need to change the boot loader configuration file manually and if you use lilo, you will need to run /sbin/lilo to make the new kernel available to it.

Moreover, if you use a modern distribution, you will need to generate the initrd image corresponding to the new kernel. The initrd images contain the kernel modules that should be loaded before the root filesystem is mounted as well as some scripts and utilities that should be executed before the kernel lets init run. To create the initrd image for your kernel and copy it to the system's /boot directory, you can do:

# mkinitrd -k vmlinuz-<kernel_version> -i initrd-<kernel_version>
where <kernel_version> is the kernel's release string. The kernel itself has to be copied to the file /boot/vmlinuz-<kernel_version> and the map of its symbols has to be saved in the file /boot/System.map-<kernel_version> before mkinitrd is run. The release string of the running kernel can be obtained by executing
$ uname -r
It usually corresponds to the version of the source code from which the kernel has been built.

After generating the initrd image for the new kernel, you have to adjust the configuration of the boot loader so that it can use this kernel. If you use GRUB, the configuration file should be /boot/grub/menu.lst . Open it in your favorite text editor and add the following lines:

title Linux <kernel_version>
       root (hdX,Y)
       kernel /boot/vmlinuz-<kernel_version> ro root=/dev/<root_partition>
#      If initrd is used
       initrd /boot/initrd-<kernel_version>
where X and Y are numbers used by GRUB to identify the partition that contains your system's /boot directory (please refer to the documentation of GRUB for more details), <kernel_version> is the kernel's release string and <root_partition> is the identification of you root partition that will be used by the kernel to mount the root filesystem and run init.

The users of LILO should add the following lines to its configuration file /etc/lilo.conf:

image=/boot/vmlinuz-<kernel_version>
label=linux
# If initrd is used
initrd=/boot/initrd-<kernel_version>
read-only
root=/dev/<root_partition>
It also is necessary to make lilo actually use the new kernel by running /sbin/lilo (please refer to the documentation of LILO for more information).


next up previous contents
Next: Automated configuration and installation Up: Compilation and installation Previous: Magic SysRq   Contents
MichaƂ Piotrowski 2007-06-21