Step 4: Install the Object Code and Configuration File


Step 4: Install the Object Code and Configuration File

The make modules_install command has already done part of this installation step, placing all of the modular kernel executables into a /lib/modules subdirectory based on the version number of the kernel. Now you just need to install the main part of the kernel by copying the kernel executable from the kernel source tree to a directory where your boot loader can find it at system boot time. Because boot loaders normally look for the kernel in the /boot directory, we'll place a copy of the kernel executable there.

Enter this command to copy the kernel executable file you just compiled, named bzImage, to where your boot loader expects to find it when the system first starts:

 #cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-<version> 

Replace <version> in this example command with the version number of your kernel, and i386 with the proper name of the hardware architecture you are using. (Remember to also add the EXTRAVERSION number if you specified one in the Makefile in Step 2.)

image from book
WHEN MAKE FAILS

If the nohup.out file ends with an error, or if the bzImage file is not created, or if the /lib/modules subdirectory does not exist,[5] try copying different versions of the .config file into place or use the make mrproper and make oldconfig commands to build a new .config file from scratch.[6] Then rerun the make commands to compile the kernel again to see if the kernel will compile with a different .config file.

You should also try turning on SMP support for your kernel through the make menuconfig command (if you are not already using one of the SMP .config files from your distribution).

If the nohup.out file contains just a few lines of output, and you see error messages about the .hdepend file, try removing this temporary file (if you are using a 2.4 or earlier kernel), and then enter the nohup make dep clean bzImage modules modules_install command again. Or, if you cannot get a newer kernel to compile, try an older, more stable version from the 2.4 series.

If none of this helps, try entering each of the make commands separately: make dep, then make clean, then make bzImage, and so forth, and send the output of each command to the screen and to a separate log file:

 #make dep 2>&1 | tee /tmp/dep.log #make clean 2>&1 |tee /tmp/clean.log #make bzImage 2>&1 | tee /tmp/bzimage.log #make modules 2>&1 | tee /tmp/modules.log #make modules_install _2>&1 | tee /tmp/modules_install.log 

This should help you isolate the problem, at which point you can go online to find a solution. Try the comp.os.linux newsgroups (or comp.os.linux.redhat, dedicated to problems with Red Hat Linux). Also, see the Linux section at http://marc.theaimsgroup.com.

Before posting a kernel compilation question to one of these newsgroups, read the Linux FAQ (http://www.tldp.org), the Linux-kernel mailing list FAQ (http://www.tux.org/lkml), and the Linux-kernel HOWTO.

image from book

Install the System.map

Your system may need a file called System.map when it loads a module to resolve any module dependencies (a module may require other modules for normal operation).[7]

Copy the System.map file into place with this command:

 #cp /usr/src/linux/System.map /boot/System.map 

Save the Kernel Configuration File

For documentation purposes, you can now save the configuration file used to build this kernel. Use the following command:

 #cp /usr/src/linux/.config /boot/config-<version> 

Again, <version> in this command should be replaced with the kernel version you have just built.

[5]The /lib/modules subdirectory should be created when building a modular kernel.

[6]This method should at least get the kernel to compile even if it doesn't have the options you want. You can then go back and use the make menuconfig command to set the options you need.

[7]The System.map file is only consulted by the modutils package when the currently running kernel's symbols (in /proc/ksyms) don't match what is stored in the /lib/modules directory.



The Linux Enterprise Cluster. Build a Highly Available Cluster with Commodity Hardware and Free Software
Linux Enterprise Cluster: Build a Highly Available Cluster with Commodity Hardware and Free Software
ISBN: 1593270364
EAN: 2147483647
Year: 2003
Pages: 219
Authors: Karl Kopper

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