各位前辈:
我在FC5(linux-2.6.15)下编译linux-2.4.34.2时遇到了一个问题,已经耗了很长时间还未得到解决,现在贴出来,盼望各位前辈能不吝赐教。谢谢。
我从www.kernel.org下载linux-2.4.34.2后,将其拷贝到/usr/src目录下,然后解压缩,然后cd到/usr/src/linux-2.4.34.2下,然后依序执行下列命令:
[root@myhost linux-2.4.34.2]#make mrproper
[root@myhost linux-2.4.34.2]#make menuconfig (后面附有我的内核选项设置文件)
[root@myhost linux-2.4.34.2]#make dep
[root@myhost linux-2.4.34.2]#make clean
[root@myhost linux-2.4.34.2]#make bzImage
[root@myhost linux-2.4.34.2]#make modules
[root@myhost linux-2.4.34.2]#make modules_install
[root@myhost linux-2.4.34.2]#make install
在执行上述一系列命令的过程中没有出现错误提示。
上述命令结束后有下列结果出现
[root@myhost linux-2.4.34.2]# ls /lib/modules/
2.4.34.2 2.6.15-1.2054_FC5
[root@myhost linux-2.4.34.2]# ls /lib/modules/2.4.34.2 -l
total 96
lrwxrwxrwx 1 root root 23 Apr 30 11:01 build -> /usr/src/linux-2.4.34.2
drwxr-xr-x 8 root root 4096 Apr 30 11:01 kernel
-rw-r--r-- 1 root root 45 Apr 30 11:04 modules.alias
-rw-r--r-- 1 root root 69 Apr 30 11:04 modules.ccwmap
-rw-r--r-- 1 root root 0 Apr 30 11:04 modules.dep
-rw-r--r-- 1 root root 73 Apr 30 11:04 modules.ieee1394map
-rw-r--r-- 1 root root 132 Apr 30 11:04 modules.inputmap
-rw-r--r-- 1 root root 81 Apr 30 11:04 modules.isapnpmap
-rw-r--r-- 1 root root 99 Apr 30 11:04 modules.pcimap
-rw-r--r-- 1 root root 43 Apr 30 11:04 modules.seriomap
-rw-r--r-- 1 root root 49 Apr 30 11:04 modules.symbols
-rw-r--r-- 1 root root 189 Apr 30 11:04 modules.usbmap
drwxr-xr-x 2 root root 4096 Apr 30 11:01 pcmcia
[root@myhost linux-2.4.34.2]# ls /boot/ -l
total 6365
-rw-r--r-- 1 root root 63896 Mar 15 2006 config-2.6.15-1.2054_FC5
drwxr-xr-x 2 root root 1024 Apr 30 13:11 grub
-rw-r--r-- 1 root root 836579 Apr 30 11:04 initrd-2.4.34.2.img
-rw-r--r-- 1 root root 1023012 Dec 30 06:05 initrd-2.6.15-1.2054_FC5.img
drwx------ 2 root root 12288 Dec 30 13:50 lost+found
-rw-r--r-- 1 root root 94600 Feb 8 2006 memtest86+-1.65
lrwxrwxrwx 1 root root 19 Apr 30 11:04 System.map -> System.map-2.4.34.2
-rw-r--r-- 1 root root 637352 Apr 30 11:04 System.map-2.4.34.2
-rw-r--r-- 1 root root 811765 Mar 15 2006 System.map-2.6.15-1.2054_FC5
lrwxrwxrwx 1 root root 16 Apr 30 11:04 vmlinuz -> vmlinuz-2.4.34.2
-rw-r--r-- 1 root root 1476337 Apr 30 11:04 vmlinuz-2.4.34.2
-rw-r--r-- 1 root root 1510257 Mar 15 2006 vmlinuz-2.6.15-1.2054_FC5
[root@myhost linux-2.4.34.2]#vi /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda2
# initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title My Linux (2.4.34.2)
root (hd0,0)
kernel /vmlinuz-2.4.34.2 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.4.34.2.img
title Fedora Core (2.6.15-1.2054_FC5)
root (hd0,0)
kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.15-1.2054_FC5.img
然后我重启机器,欲使用新编译的linux-2.4.34.2进行boot。从开机到进入grub选单画面都很正常,但是当我在grub选单画面选择My Linux (2.4.34.2)后,却出现如下提示
...
Uncompressing Linux... OK, booting the kernel.
Kernel panic: VFS: Unable to mount root fs on 00:00
然后系统就停在这里不走了。
后来我查了一些资料,将/boot/grub/grub.conf文件的内容修改成如下的模样
[root@myhost linux-2.4.34.2]#vi /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hda2
# initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title My Linux (2.4.34.2)
root (hd0,0)
kernel /vmlinuz-2.4.34.2 ro root=/dev/hda2 (我的根文件系统在/dev/hda2分区上)
initrd /initrd-2.4.34.2.img
title Fedora Core (2.6.15-1.2054_FC5)
root (hd0,0)
kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.15-1.2054_FC5.img
然后我重启机器,从开机到进入grub选单画面都很正常,我在grub选单画面选择My Linux(2.4.34.2)后,屏幕上有很多东西出来,但是出现如下字符后系统就不动了:
...
EXT3-fs: mounted filesystem with ordered data mode.
Freeing: unused kernel memory: 124k freed
Warning: unable to open an initial console.
Kernel panic: Attempted to kill init!
(此时Caps Lock、Scroll Lock两个灯在不停地闪)
这是怎么一回事呢?是不是因为在linux-2.6.15环境下编译linux-2.4.34.2造成的呀(两个版本差别太大)?若是这个缘故为何在编译过程中没有出错提示呀?我用的是P4的CPU,2.40GHz。