Section 5.1. Using a Distribution s Installation Scripts


5.1. Using a Distribution's Installation Scripts

Almost all distributions come with a script called installkernel that can be used by the kernel build system to automatically install a built kernel into the proper location and modify the bootloader so that nothing extra needs to be done by the developer.[*]

[*] Notable exceptions to this rule are Gentoo and other "from scratch" types distributions, which expect users to know how to install kernels on their own. These types of distributions include documentation on how to install a new kernel, so consult it for the exact method required.

Distributions that offer installkernel usually put it in a package called mkinitrd, so try to install that package if you cannot find the script on your machine.


If you have built any modules and want to use use this method to install a kernel, first enter:

 # make modules_install 

This will install all the modules that you have built and place them in the proper location in the filesystem for the new kernel to properly find. Modules are placed in the /lib/modules/kernel_version directory, where kernel_version is the kernel version of the new kernel you have just built.

After the modules have been successfully installed, the main kernel image must be installed:

 # make install 

This will kick off the following process:

  1. The kernel build system will verify that the kernel has been successfully built properly.

  2. The build system will install the static kernel portion into the /boot directory and name this executable file based on the kernel version of the built kernel.

  3. Any needed initial ramdisk images will be automatically created, using the modules that have just been installed during the modules_install phase.

  4. The bootloader program will be properly notified that a new kernel is present, and it will be added to the appropriate menu so the user can select it the next time the machine is booted.

  5. After this is finished, the kernel is successfully installed, and you can safely reboot and try out your new kernel image. Note that this installation does not overwrite any older kernel images, so if there is a problem with your new kernel image, the old kernel can be selected at boot time.



Linux Kernel in a Nutshell
Linux Kernel in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596100795
EAN: 2147483647
Year: 2004
Pages: 113

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net