Installing and Booting From a Kernel
Previous chapters showed you how to download and build your
kernel. Now that you have an executable file -- along with any
modules you built -- it is time to install the kernel and
attempt to boot it. In this chapter, unlike earlier ones, all of the
commands need to be run as the root user. This can be done by
prefixing each command with
, by using the
command to become
, or actually by logging
To see if you have
installed and the proper access
set up, do the following:
sudo ls ~/linux/linux-126.96.36.199/Makefile
Enter either your own password at the password prompt, or the password of
the system administrator (root). The choice depends on how the
command is set up. If
this is successful, and you see the line containing:
then you can skip to the next section.
is not installed or giving you the proper
rights, then try using the
At the password prompt, enter the password of the system administrator
). When the
program successfully accepts the
password, you are transferred to running everything with full root
privileges. Be very careful while as
, and do only the minimum needed; then exit the program to continue back as your normal user account.
Using a Distribution's Installation Scripts
Almost all distributions come with a script called
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
Distributions that offer
usually put it in a
package called mkinitrd, so try 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:
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/
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:
This will kick off the following process:
The kernel build system will verify that the kernel has been successfully
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.
Any needed initial ramdisk images will be automatically created, using the
modules that have just been installed during the
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 the machine is booted.
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