10 May 2011

Building The Kernel Binary

Setting up an appropriate .config file is the most important part of the Linux kernel configuration process, but you must jump through several more hoops to turn that file into a finished kernel.

Here’s an outline of the entire process:

cd to the top level of the kernel source directory.
• Run make xconfig,make gconfig, or make menuconfig.
• Run make dep (not required for kernels 2.6.x and later).
• Run make clean.
• Run make.
• Run make modules_install.
• Copy arch/i386/boot/bzImage to /boot/vmlinuz.
• Copy arch/i386/boot/System.map to /boot/System.map.
• Edit /etc/lilo.conf (LILO) or /boot/grub/grub.conf (GRUB) to add a configuration line for the new kernel.
• If you’re using LILO, run /sbin/lilo to install the reconfigured boot loader.

The make clean step is not always strictly necessary, but it is generally a good idea to start with a clean build environment. In practice, many problems can be traced back to this step having been skipped.


See Also:
Linux Administration Handbook (2nd Edition)


biOos

No comments: