Failed To Compile 2.6 Kernel in RHEL AS4 (VMWARE)
时间:2006-05-31 来源:rdd
Failed to compile 2.6 kernel :
1.Install a fresh RHEL AS4
2.Test creating a new ramdisk under the current kernel
#cd /boot
#mkinitrd initrd-george 2.6.9-5.EL
Ok,you will get a new ramdisk file named initrd-george.It means that there is nothing wrong with the version of 'mkinitrd'
3.Dowload the latest compressed kernel package and put it into /tmp
4.Decompress it.
#cd /tmp
#tar xjvf linux-2.6.16.18.tar.bz2 -C /usr/src
5.Go on comiling new kernel
#cd /usr/src/linux-2.6.16.18
#make menconfig
(You needn't change anything here,just highlight"Load an Alternate Configuration File" and press ENTER key,Enter the absolute path "/boot/config-2.6.9-5.EL"of the configuration file which has been used in current kernel.Press OK and then exit with saving the configrutation )
#make;make modules;make modules_install
6.Post comiling
If you want to finish this stage manually,please go to step 7
#make menuconfig
(IMPORTANT:The reason why we got such an error "no module mptbase found ...." is that we did something wrong when we executed 'make menuconfig'.It had nothing to do with the version of the package mkinitrd.So ,if you want to get through compiling a new kernel smoothly,you must be more careful of making change to kernel configuraton when you do 'make menuconfig'.Make sure you have choose to make modules for MPT by tick all options with "M" in Device Drivers->Fusion MPT Device Support)
#reboot
7.Manually copy bzImage,System.map,.config to /boot
#find /usr/src -name bzImage
#cp /usr/src/linux-2.6.16.18/arch/i386/boot/bzImage /boot/vmlinuz-2.6.16.18
#find /usr/src -name System.map
#cp /usr/src/System.map /boot/System.map-2.6.16.18
#find /usr/src -name .config
#cp /usr/src/.config /boot/config-2.6.16.18
8.Create ramdisk
#/sbin/mkinitrd /boot/initrd-2.6.16.18.img 2.6.16.18
(This command would create a new ramdisk for kernel 2.6.16.18.The kernel veresion "2.6.16.18" in the above command tells mkinitrd to search /lib/modules/2.6.16.18 for files that are needed .Because all module files are put here.)
9.Edit GRUB configuration file with vi and add some items in the end of the file:
title Red Hat Enterprise Linux AS (2.6.16.18)
root (hd0,0)
kernel /vmlinuz-2.6.16.18 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.16.18.img
10.Restart system and boot from the new kernel by choosing "Red Hat Enterprise Linux AS (2.6.16.18)" when GRUB menu appears.
There are no errors during the compiling process,but when I boot the new kernel,I still got kernel panic.This is a bug?Some guys said that because I used a wrong version mkinitrd.The version I should use may be mkinitrd-4.2.21-1.i386.rpm.Even though the latest version of mkinitrd hasn't resolve this problem yet.But ,Jesus,where can i find such a damn version?
You can read the following pages for some tips:
http://www.redhat.com/archives/fedora-ia64-list/2006-January/msg00002.html
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=169059
相关阅读 更多 +