QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1968|回复: 25

内核编译问题!!参考了多篇文章。还是无法解决!!!

[复制链接]
发表于 2003-4-3 16:04:24 | 显示全部楼层 |阅读模式
我安装的是RH8.0 内核版本2.4.18
不久前下载了2.4.20的源代码。使用以下过程编译内核:
进入内核源代码目录
make mrproper
make menuconfig
make dep
make bzImage
make modules
make modules_Install
cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.20
cp System.dep /boot/System.dep-2.4.20
rm /boot/System.dep
ln /boot/System.dep-2.4.20 /boot/System.dep

然后修改了/etc/grub.conf为:
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14)
        root (hd0,0)
        kernel /vmlinuz-2.4.18-14 ro root=LABEL=/
        initrd /initrd-2.4.18-14.img
title Red Hat Linux (2.4.20)
        root (hd0,0)
        kernel /vmlinuz-2.4.20 ro root=/dev/sda2

reboot并用新内核启动,报错:
VFS:Cannot open root device"LABEL=/"or 00:00
Please append a correct "root=" boot option
kernel panic: VFS: Unable to mount root fs on 00:00

我查阅了本论坛还有其他论坛的许多贴子,好像都说是要修改root=之后的参数。可使我把这个参数改了N遍了,还是不行。

另,我这个Linux是安装在VMware虚拟机上。分区信息为:
/dev/sda1     /boot
/dev/sda2     /


我试了好几天了!高人救我!!
发表于 2003-4-3 17:03:41 | 显示全部楼层
root=(boot分区所在)
回复

使用道具 举报

 楼主| 发表于 2003-4-3 17:15:32 | 显示全部楼层
我各种参数都试过了。
root=LABEL=/
root=LABEL=/boot
root=/dev/sda1
root=/dev/sda2
这些都是一样的错。
回复

使用道具 举报

发表于 2003-4-4 00:34:13 | 显示全部楼层
can u post u .config file? do u choose scsi support in kernel, not module?
回复

使用道具 举报

发表于 2003-4-4 14:16:44 | 显示全部楼层
sda你用的是scsi硬盘?
回复

使用道具 举报

发表于 2003-4-4 20:37:30 | 显示全部楼层
make modules_Install

make install
让它自动生成你的grub.conf,看看是否能进入
不能的话,确认你的scsi支持已经加入新内核
回复

使用道具 举报

发表于 2003-4-4 22:41:34 | 显示全部楼层
usually u post u .config file, grub file, partition info. already can save much time and most posts
回复

使用道具 举报

发表于 2003-4-6 14:56:49 | 显示全部楼层
ln -sf vmlinuz-2.4.20 vmlinuz
new-kenerl-pkg --mkinitrd --depmod --install 2.4.20
不能识别root=LABEL=/ 是你编译文件系统的时候有东西漏选
回复

使用道具 举报

发表于 2003-4-6 23:40:03 | 显示全部楼层
no reply from him, must solve this already.  
回复

使用道具 举报

发表于 2003-4-7 16:58:49 | 显示全部楼层
hehe
agree  
回复

使用道具 举报

 楼主| 发表于 2003-4-8 18:22:27 | 显示全部楼层
各位。我又试了几次。还是不行。 :-(
至于maso兄所说的file system部分。需要说明的是,我另外还有一台安装了物理Linux的机器。在那台机器上内核编译,启动都通过了。现在有问题的这个Linux是运行在VMware虚拟机上。不过我基本上是使用了同样的编译配置,仅仅是增加了对SCSI的支持选项。而且所有的SCSI支持都是使用内核编译而不是模块编译。
另外我的grub.conf文件在最上面的问题中已经给出了。root=参数的各种可能也都试验过了。错误都是一样的。
不知道是不是VMware虚拟机的原因?
回复

使用道具 举报

发表于 2003-4-8 20:56:09 | 显示全部楼层
应该和scsi没关系,我的内核单块的,对scsi支持的东西我都没编译进去
安你先显示的错误信息信息表示vfs没法启动你的rootfs
你用的什么文件系统?分区有没有支持?ext2有无编译进内核?有的东西虽然可以编译成模块,但是实际用的时候必须要编译到内核才能用的,比如ext2就必须编译到内核中
你可以将所有东西都编译进去试验一下
顺便说一下initrd-xxxx.img包含使用磁盘之前初始化系统所需的RAM盘映像。在使用scsi设备的系统中这是必须的配置文件,看兄的配置文件中2.4.20好像没有。
你可以用new-kenerl-pkg --mkinitrd --depmod --install 2.4.20 来自动安装新系统,--mkinitrd就是产生initrd-xxx.img文件的,--depmod是安装模块,--install会自动修改grub等等,这程序是RH自带的。


--->>祝你成功
回复

使用道具 举报

发表于 2003-4-8 21:59:08 | 显示全部楼层
vmware exports a virtual scsi disk, so u need the scsi support in u kernel, and u had better compile it into kernel.
i remember vmware can support this, i recompile kernel several times in linux under vmware, it works fine.
btw, u cp the kernel as /boot/vmlinuz-2.4.20, then why u use "kerne /vmlinuz-2.4.20"? why not is the "kernel (hd0,0)/boot/vmlinuz-2.4.20" or "kernel /boot/vmlinuz-2.4.20"? can u also cp u vmlinuz-2.4.20 to / and try again to see which one works? sometime on my ultra80 sparc box, the vmlinux must on /, not on /boot. although it is strange.
回复

使用道具 举报

 楼主| 发表于 2003-4-9 11:14:49 | 显示全部楼层
to cheungming:
  我目前的2.4.18内核就是放在和新内核同样的目录下。而grub.conf文件上有一段注释说明了grub是以/boot为基础来定位内核的,所以这里写root=/vmlinuz-2.4.20并无不可。事实上,我另一台安装了物理的Linux也使用了这样的写法来配置grub,结果是可行的。
to maso:
  如cheungming兄所说,因为我是在VMware的基础上安装的Linux,所以设备显示为SCSI,分区类型是EXT3。/对应/dev/sda2,/boot对应/dev/sda1。在编译内核时,我有把EXT3支持编译进内核。事实上,为了保险,几乎所有的选项我都是采用的内核编译的方式。我确实没有在grub.conf中加入initrd-xxxx.img,因为根据我的了解这个文件好像只是提供一个磁盘内存映象的功能。而且在我另一台Linux中,新编译的内核没有使用它也运行的很好,当然那一台机器是IDE设备就是啦。如果SCSI必须加这个的话,我也有尝试使用mkinitrd命令去产生这个文件。可是一直报“No module BusLogic found for kernel 2.4.20”这个错误。你说的使用“new-kenerl-pkg --mkinitrd --depmod --install 2.4.20”去安装并产生该文件的方法我没有用,因为我更希望用手工的方式来安装新内核,而且我也不想用新内核取代旧内核,我希望两者共存。
BTW,在/lib/modules/2.4.20/kernel/drivers/下没有scsi这个目录。而原来的/lib/modules/2.4.18-14/kernel/drivers/下就有,且存在scsi/BusLogic.o,是不是这个原因而导致mkinitrd失败呢?可是这种情况应该是因为我把SCSI支持都编译进内核而不是模块才产生的吧?
回复

使用道具 举报

发表于 2003-4-9 11:32:08 | 显示全部楼层
o, ic. so i am wrong here. thx for the info. when i use grub, i assume from / and always use /boot in my conf file. at least now my grub works fine and that is why i never read the grub doc.

u can try to use a initrd file while i am not sure if it solves u problem.
yes, the reason u mkinitrd fails is because u do not have buslogic module. u can try to choose buslogic as module and then make modules modules_install. then choose it as linked into kernel and make bzImage. by this way your mkinitrd will works.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-5-18 12:18 , Processed in 0.100777 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表