|
||
Chapter 6. Installing and Booting From a KernelTable of Contents 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 sudo , by using the su command to become root , or actually by logging in as root . To see if you have sudo installed and the proper access set up, do the following: $ sudo ls ~/linux/linux-2.6.17.11/Makefile Password: Makefile Enter either your own password at the password prompt, or the password of the system administrator (root). The choice depends on how the sudo command is set up. If this is successful, and you see the line containing: Makefile then you can skip to the next section. If sudo is not installed or giving you the proper rights, then try using the su command: $ su Password: # exit exit $ At the password prompt, enter the password of the system administrator ( root ). When the su program successfully accepts the password, you are transferred to running everything with full root privileges. Be very careful while as root , and do only the minimum needed; then exit the program to continue back as your normal user account. Using a Distribution's Installation ScriptsAlmost 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. [6] NoteDistributions that offer installkernel 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: # 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:
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. [6] 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. |