During the past two days, I had to re-compile the kernel. Now we can record the process of compiling and configuring the kernel.
Operating System: Ubuntu 10.04
Steps:
1. download the required kernel package and decompress it to/usr/src;
2 CD to the kernel source code root directory, run make mrproper to clear the last compiled result file and configuration file;[Optional]
3. Go to the kernel source code root directory and run make oldconfig to generate the kernel based on common configurations;
-There are other options, such as defconfig, which is the default configuration.
4. Run make menuconfig (ncurses software package is required). This is the kernel configuration in menu mode. You can choose to compile built-in (set *) or the kernel module (set to m );
-Other menu configurations, such as xconfig
5. Confirm the dependency make Dep;[Optional]
6. Compile the kernel image file and make bzimage. This step takes about 0.5 ~ 1 hour;
7. Compile the kernel module. The component previously selected as the kernel module is now compiled and run make modules;
8. Install the kernel module and run make modules_install. In this step, put the compiled kernel module under/lib/modules/kernel version/to load the corresponding kernel module after the new kernel is started;
9 create the kernel image file to be loaded, this step is to put the compiled kernel under the/boot directory, execute mkinitramfs-O/boot/initrd-linux2.6.XX.img 2.6.xx;
10. Install the kernel and run make install to copy all kernel-related files to/boot;
11. In the last step, configure grub to boot the system from the new kernel. In general, this step varies by system. In ubuntu10.04, You need to modify/boot/GRUB/grub. CFG (the previous version was to modify menu. LST). The syntax rules are easy to understand.
-You must note that the system may still need to put two soft links vmlinuz and initrd under the root directory (I .e. IMG can be modified to the corresponding new kernel image file under/boot.