新内核启动问题求救

crazychinaunix
新内核启动问题求救

我自己编译2.6.22内核后,make;make modules_install 以及mkinitrd, 修改menu.lst(grub)使用新的bzImage和initrd后重启得到如下错误提示:
"modprobe: FATAL: Could not load /lib/modules/2.6.22/moduels.dep: No such file or directory"
"umount: devfs: not mounted"
"pivot_root: No such file or directory"
"/sbin/init: 432 cannot open dev/console: No such file"
"Kernel panic - not syncing: Attempted to kill init!"
而modules.dep是存在的

simon@lionteeth:/lib/modules/2.6.22$ ls
build           modules.dep          modules.ofmap     modules.usbmap
kernel          modules.ieee1394map  modules.pcimap    source
modules.alias   modules.inputmap     modules.seriomap
modules.ccwmap  modules.isapnpmap    modules.symbols

如下是grub configuration文件:
grub menu.lst:
title           Ubuntu, kernel 2.6.22 simon
root            (hd0,0)
kernel          /boot/vmlinuz.2.6.22-newest root=/dev/sda1 ro quiet splash
initrd          /boot/initrd.img.2.6.22-newest
savedefault
boot

在网上查找听说要disable ROM File system. 我也照做去掉了.config中的ROMFS support,结果还是不行.
各位大牛帮忙诊断诊断, 谢了

crazychinaunix
自己顶一下,我用的是vmware
看了一下以前的一些帖子, make install也做过了。

附上屏幕抓图如下:

crazychinaunix
是initrd的问题吗?
我重做了initrd image:
root@lionteeth:/usr/src/linux #  mkinitrd -o /boot/initrd.img.2.6.22-newest2 2.6.22

root@lionteeth:/boot/grub # tail -15 menu.lst

title           Ubuntu, kernel 2.6.22 simon
root            (hd0,0)
kernel          /boot/vmlinuz.2.6.22-newest root=/dev/sda1 ro quiet splash
initrd          /boot/initrd.img.2.6.22-newest2
savedefault
boot
...

然后出现新的错误如下:

crazychinaunix
自己顶一下

crazychinaunix
编译2.6.22内核后的启动问题

查了一些资料, 自 kernel 2.6, "mkinitrd" 被 "mkinitramfs" 所代替, 它们分别产生不同格式的initrd
"2.6 has a newer format, initramfs, which is an cpio gzipped archive."
mkinitrd 产生的是一个loop device file system|gzip 格式
mkinitramfs产生的是一个cpio|gzip 格式

mkinitramfs -o /boot/initrd.img.2.6.22-newest2 2.6.22

shutdown -r now

看起来又有了新的问题:
上网查了很多资料,还没有得到解决的方法

crazychinaunix
感觉可能和scsi/devfs有些关系,
读了 [url]http://sg.torque.net/sg/devfs_scsi.html[/url]
"Well if you ignore the documentation < [url]www.atnf.csiro.au/~rgooch/linux/docs/devfs.html[/url]> and just select devfs in your kernel configuration (and its "mount" option) then build and reboot you will probably not get far. On my box (i386 with a RH 6.2 distro) it found the kernel, mounted the root file system read-only and crashed into single user mode."

启动时会halt好大一会时间(5 min左右), 然后进入了一个单用户shell界面,内核倒是2.6.22了,  / 好像就是initrd

/dev里就没有scsi硬盘:

crazychinaunix
已经加入boot parameter :  devfs=nomount 至menu.lst
kernel          /boot/vmlinuz.2.6.22-newest root=/dev/sda1 devfs=nomount ro quiet splash
问题依旧.....

jerrywjl
哥们知道为什么没人搭理你吗?

因为没有人知道你是在什么系统上按照什么步骤编译的。也没有人知道你在编译的时候模块和内核是怎么定义的。

platinum
看提示与缺少 scsi 驱动有关,不排除用的 SCSI 硬盘的可能

crazychinaunix
谢谢楼上两位的回复, 在此补上漏掉的信息
1.  用的VMware 1.04, 模拟SCSI硬盘
    ubuntu kernel 2.6.10-5-386

2.  编译步骤:
(1)  cd /usr/src/linux  =>linux.2.6.22
     make menuconfig  (已经将SCSI模块,ROM file system , RAM disk support 放进内核)
     make clean;make;  make modules_install;make install
     附上.config文件

(2)   cp arch/i386/boot/bzImage /boot/vmlinux.2.6.22.withSCSI
      mkinitramfs -o /boot/initrd.img.2.6.22-withSCSI 2.6.22

(3)   用的grub, menu.lst
===
title           Ubuntu, kernel 2.6.22 simon scsi
root            (hd0,0)
kernel          /boot/vmlinux.2.6.22.withSCSI root=/dev/sda1 ro quiet splash
#kernel         /boot/vmlinux.2.6.22.withSCSI root=/dev/sda1 devfs=nomount ro quiet splash
initrd          /boot/initrd.img.2.6.22-withSCSI
savedefault
boot
===

crazychinaunix
目前出错屏幕如下:

justin033
[root@uni-linux linux]# [color=Red]make install[/color]
sh /usr/src/linux-2.6.22/arch/i386/boot/install.sh 2.6.22 arch/i386/boot/bzImage System.map "/boot"
WARNING: Couldn't open directory /lib/modules/2.6.22: No such file or directory
FATAL: Could not open /lib/modules/2.6.22/modules.dep.temp for writing: No such file or directory
/lib/modules/2.6.22 is not a directory.
mkinitrd failed
make[1]: *** [install] Error 1
make: *** [install] Error 2
[root@uni-linux linux]# [color=Red]mkinitrd /boot/initrd-2.6.22.EL.img 2.6.22[/color]
/lib/modules/2.6.22 is not a directory.
You have mail in /var/spool/mail/root
[root@uni-linux linux]# man lilo
No manual entry for lilo
[root@uni-linux linux]# [color=Red]cat /proc/version[/color]
Linux version 2.6.9-55.EL ([email]brewbuilder@ls20-bc2-14.build.redhat.com[/email]) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)) #1 Fri Apr 20 16:35:59 EDT 2007


同样的错误! 不过网上别人升级内核都没这么错误的,搜索来的信息太少了

[[i] 本帖最后由 justin033 于 2008-5-20 08:54 编辑 [/i]]

justin033
解决了, 如下:


1). 在[color=Red]make install[/color]之前建个文件夹, 如下: [color=Red]mkdir /lib/modules/2.6.22[/color] ; 接着make install就通过了!

[url]http://www.baidu.com/s?tn=ichuner_4_pg&ct=0&ie=gb2312&bs=%2Flib%2Fmodules%2F2.6.22%2Fmodules.dep.temp&sr=&z=&cl=3&f=8&wd=modules.dep.temp[/url]


2). the following errors of boot in the new kernel-2.6.22:

mount: error 6 mounting ext3
mount: error 2 mounting none
switchroot: mount failed: 22
umount /initrd/dev failed: 2
Kernel panic - not syncing: Attempted to kill init!


1>>. 是VM的bug; 内核2.6.21、2.6.22使用Fusion MPT 3.04.04有问题,使用原来的3.04.03即可(至少LSI53C1030可以正常加载)


2>>.
另一解决方法.
Edit [color=Red]/usr/src/linux/drivers/message/fusion/mptbase.c[/color] to match the following:

[color=Red]pfacts->IOCStatus = le16_to_cpu(pfacts->IOCStatus);
pfacts->IOCLogInfo = le32_to_cpu(pfacts->IOCLogInfo);
pfacts->MaxDevices = le16_to_cpu(pfacts->MaxDevices);
/* Fix VMware bug */
if(pfacts->MaxDevices == 0) {
pfacts->MaxDevices = 16;
}
pfacts->PortSCSIID = le16_to_cpu(pfacts->PortSCSIID);
pfacts->ProtocolFlags = le16_to_cpu(pfacts->ProtocolFlags);
pfacts->MaxPostedCmdBuffers = le16_to_cpu(pfacts->MaxPostedCmdBuffers);  [/color]

这是VMware的模拟lsi的一个bug.
我照方法二改源代码,然后重新编译生成就可以了!

[url]http://topic.csdn.net/u/20070908/09/aa765e91-251b-402f-bfd2-1e9c902d78da.html[/url]
[url]http://blog.akaka.com.cn/2007/09/kernel-26-vmware-esx-lsi-hba-support.html[/url]

[[i] 本帖最后由 justin033 于 2008-5-21 21:26 编辑 [/i]]