|
编译内核完成后安装生成的deb包,用mkinitrd.yaird 制作initrd.img文件不成功,报错:
- yaird error: bad device link in /sys/block/hda (fatal)
复制代码
改用mkinitramfs做成一个,无奈启动的时候到了usbcore之类的加载好之后就卡住了,等了很久冒出下面的提示:
- Gave up waiting for root device.
- Common problems: -Boot args(cat /proc/cmdline)
- -check rootdelay=(did the system wait long enough)
- -check root=(did the system wait for the right device)
- -Missing modules (cat /proc/modules;ls /dev)
- Alert /dev/hdb3 doesn\'t exist
复制代码
有人说是rootdelay设置的时间太短 导致系统还没有正常加载完设备驱动就已经开始寻找root分区,而导致找不到/root分区。我在引导语句里加上rootdelay=10,只不过是停了10s左右,错误如约而至。
我用源里安装的内核配置文件不加任何改动编译一遍,做个initrd.img引导居然跟上边的提示一样就卡住了。
之前看过相关帖子知道initrd并不是必须的,那我试试摆脱它。
不敢再蛮干,体恤一下电脑。找了找资料:
http://www.linuxsir.cn/bbs/thread143253.html
d00m3d说
- 想去掉 initd,重点是要确保内核启动时能辨认根分区的文件系统格式然後加载根分区,所以相关的支援要直接编入内核,不要编成模块
- 其次是硬件支援,这关乎 SATA、SCSI、IDE 之类的,有了这些,基本上行矣
复制代码
chaisave说
- 一般来说,把 IDE 驱动(或者 SATA,SCSI 驱动) 和芯片组驱动、/ 和 /boot 的文件系统驱动,编进内核就行了。其它的诸如网络相关和声卡等驱动编译成模块也无妨。
复制代码
我重新修改内核配置,凡是看到IDE、PCI、SCSI相关的选项,“高度重视”,把一些打上*(built-in)。
我的/boot文件系统是ext3,这里有个问题,就是我在grub命令行下输root (hd0,2) 回车得到的结果是:
- File system type is ext2fs,partition type 0x83。
复制代码
我又用df -T查看:
- Filesystem Type 1K-blocks Used Available Use% Mounted on
- /dev/hdb3 ext3 264443 117024 133764 47% /
- ………………………………………………………………
复制代码
算了,为了保险,就把ext2,ext3都编进去吧。编译完一启动,报出以下错误:
- kernel panic-not syncing VFS:unable to mount root fs on unknown-block(0,0)
复制代码
估计问题出在IDE或者芯片组上
lspci -v
- ……………………………………………………………………
- 00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01) (prog-if 8a [Master SecP PriP])
- ……………………………………………………………………
- Kernel driver in use: PIIX_IDE
- 00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA IDE Controller (rev 01) (prog-if 8f [Master SecP SecO PriP PriO])
- ……………………………………………………………………
- Kernel driver in use: ata_piix
- ……………………………………………………………………
复制代码
对照一下自己的config:
CONFIG_BLK_DEV_PIIX is not set,赶紧改过来,编译好,终于能够成功引导了。
目前的vmlinuz是2M,有待继续精简,请问有什么方法能查看被编译进内核的模块占用情况吗?就像lsmod那样。 |
|