Compiling the kernel Once the .config and Makefile (Web hosting ecommerce)
Friday, November 30th, 2007Compiling the kernel Once the .config and Makefile files are customized, the new kernel can be compiled by running the following commands: 1. make dep In this step, source files (.c) are examined for dependencies on header files. A file called .depend is created in each directory containing source files to hold the resulting list, with a line for each compiled object file (.o). The .depend files are automatically included in subsequent make operations to be sure that changes in header files are compiled into new objects. Since kernel code isn t being developed here, no header file changes are needed. Nevertheless, make dep is an essential first step in the compilation process. 2. make clean The clean operation removes old output files that may exist from previous kernel builds. These include core files, system map files, and others. They must be removed in order to compile a new, clean kernel. 3. make bzImage The bzImage file is our ultimate goal, a bootable kernel image file, compressed using the bzip2 utility.* It is created in this step along with some additional support files needed for boot time. 4. make modules Device drivers and other items that were configured as modules are compiled in this step. 5. make modules_install All of the modules compiled during make modules are installed under /lib/ modules/kernel-version in this step. A directory are created there for each kernel version, including various extraversions. The bzImage and modules portions of the kernel-compilation process will take the most time. Overall, the time required to build a kernel depends on your system s capabilities. After completing this series of make processes, compilation is complete. The new kernel image is now located in /usr/src/linux/arch/i386/boot/bzImage. Installing the new kernel and configuring LILO Now that the new kernel has been compiled, the system can be configured to boot it: 1. The first step is to put a copy of our new bzImage on the root partition so it can be booted by LILO. The copy is named just as it was named during compilation, including the extraversion: # cp -p /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-2.2.5-15-pentium * bzip2 is a compression utility similar to the more familiar gzip. bzip2 uses a different compression algorithm that generally produces better compression results. See the bzip2 manpage for more information. Study Guide102 Reconfigure, Build, and Install a Custom Kernel and Modules 317
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.