Centos kernel Compilation
(22:50:51)
ReprintedBytes
Centos kernel Compilation
Download linux-2.6.29.4.tar.bz2 to/usr/src
# Wgethttp: // www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.4.tar.bz2
# Tar-jxvf linux-2.6.29.4.tar.bz2
# Cd linux-2.6.29.4
# Make mrproper
# Make menuconfig
# Make clean
# Make bzimage
# Make modules
# Make modules_install
# Mkinitrd/boot/initrd_2.6.29.4.img 2.6.29.4
When the message "No module DM-Mem-Cache found for kernel2.6.29.4, aborting." is displayed when the mkinitrd command is executed, the mkinitrd version has a bug. Upgrade mkinitrd or refer to this article to solve this problem.
Solution: 1. When using mkinitrd, use the "-without-dmraid" parameter. 2. Create a noraid file before using mkinitrd. The creation method is as follows:
# Echo "dmraid = No">/etc/sysconfig/mkinitrd/noraid
# Chmod 755/etc/sysconfig/mkinitrd/noraid
Then run the mkinitrd command.
Here I use the first method.
# Mkinitrd/boot/initrd-2.6.29.4.img 2.6.29.4 -- without-dmraid
After mkinitrd is executed, you need to add the compiled kernel information in the Startup menu so that you can select the kernel version during startup.
# Cp/usr/src/linux-2.6.29.4/ARCH/i386/boot/bzimage/boot/vmlinuz-2.6.29.4
# Cp/usr/src/linux-2.6.29.4/system. MAP/boot/system. Map-2.6.29.4
Open the/etc/grub. conf file and add the following content to the end of the file.
Title centos (2.6.29.4)
Root (hd0, 0)
Kernel/vmlinuz-2.6.29.4 Ro root =/dev/volgroup00/logvol00 rhgbquiet
Initrd/initrd-2.6.29.4.img
Save, restart, and select "centos (2.6.29.4)" from the grub Startup menu to use the compiled kernel.
If you think the steps after make modules_install are too troublesome, you can directly use the following command to make the system ready for you.
# Make install
The following is the prompt message during running:
SH/usr/src/linux-2.6.29.4/ARCH/x86/boot/install. Sh 2.6.29.4arch/x86/boot/bzimage system. Map "/Boot"
Warning: No module DM-Mem-Cache found for Kernel 2.6.29.4, continuing anyway
Warning: No module DM-message found for Kernel 2.6.29.4, continuing anyway
Warning: No module dm-raid45 found for Kernel 2.6.29.4, continuing anyway
In the/etc/grub. conf file, the following information is automatically written, but you can rest assured that it will not set the new kernel to start by default.
Title centos (2.6.29.4)
Root (hd0, 0)
Kernel/vmlinuz-2.6.29.4 Ro root =/dev/volgroup00/logvol00 rhgbquiet
Initrd/initrd-2.6.29.4.img