LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: feynman

再问一个编译内核的问题

[复制链接]
发表于 2006-1-7 20:44:39 | 显示全部楼层
关於initrd在启动时如何加载根文件系统,可以拜读日月教主两篇关於initrd的大作

http://www.linuxsir.cn/bbs/showthread.php?t=184629
http://www.linuxsir.cn/bbs/showthread.php?t=113586
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-1-7 20:55:48 | 显示全部楼层
Post by goldeagle
如果是自己编译的,initrd可以不用的,直接#注释掉就可以了

不行啊,注释掉那行启动不了啊,什么VFS什么什么的
回复 支持 反对

使用道具 举报

发表于 2006-1-7 21:43:36 | 显示全部楼层
请说明一下partition的layout并把menu.lst贴出看看
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-1-7 21:58:10 | 显示全部楼层
# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.           
default                2

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout                10

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title                Windows 95/98/NT/2000
# root                (hd0,0)
# makeactive
# chainloader        +1
#
# title                Linux
# root                (hd0,1)
# kernel        /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hda6 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,5)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## ## End Default Options ##

title                Debian GNU/Linux, kernel 2.6.8-2-686
root                (hd0,5)
kernel                /boot/vmlinuz-2.6.8-2-686 root=/dev/hda6 ro
initrd                /boot/initrd.img-2.6.8-2-686
savedefault
boot

title                Debian GNU/Linux, kernel 2.6.8-2-686 (recovery mode)
root                (hd0,5)
kernel                /boot/vmlinuz-2.6.8-2-686 root=/dev/hda6 ro single
initrd                /boot/initrd.img-2.6.8-2-686
savedefault
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

title                Debian GNU/Linux, kernel 2.6.15
root                (hd0,5)
kernel                /boot/vmlinuz-2.6.15 root=/dev/hda6 ro
#initrd                /boot/initrd.img-2.6.8-2-686
savedefault
boot


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title                Microsoft Windows XP Professional
root                (hd0,0)
savedefault
makeactive
chainloader        +1
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-1-7 21:59:23 | 显示全部楼层
Post by d00m3d
请说明一下partition的layout并把menu.lst贴出看看

什么叫partition的layout啊?真不好意思,什么都不懂。
回复 支持 反对

使用道具 举报

发表于 2006-1-7 22:47:17 | 显示全部楼层
partition的layout指分区的布局,即是fdisk -l 的结果

看来你的Debian装在hda6, menu.lst并无不对
不行啊,注释掉那行启动不了啊,什么VFS什么什么的
能否说说这个错误的提示是什麽?
我看了啊,我就是照着那个新手篇编译的。可是就是那步# /sbin/mkinitrd initrd-2.6.12.3.img 2.6.12.3这步看不懂啊。也找不到initrd...img的文件。怎么设置grub啊
在Debian,2.6.14以上的内核不能用mkinitrd来做initrd,要先装yaird,即是要用mkinitrd.yaird来制作
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-1-7 22:53:11 | 显示全部楼层
Post by d00m3d

在Debian,2.6.14以上的内核不能用mkinitrd来做initrd,要先装yaird,即是要用mkinitrd.yaird来制作

这个是什么啊,能不能具体说说怎么操作啊?我apt-get install yaird也找不到这个。

另外:
# fdisk -l

Disk /dev/hda: 40.0 GB, 40027029504 bytes
255 heads, 63 sectors/track, 4866 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        1530    12289693+   c  W95 FAT32 (LBA)
/dev/hda2            1531        4866    26796420    f  W95 Ext'd (LBA)
/dev/hda5            1531        3835    18514881    b  W95 FAT32
/dev/hda6   *        3836        4209     3004123+  83  Linux
/dev/hda7            4210        4275      530113+  82  Linux swap / Solaris
/dev/hda8            4276        4866     4747176   83  Linux

那个新内核的出错信息是这样的:
Kernel panic- not syncing VFS: Unable to mount root fs on unknown-block(0,0)

请大侠指教啊!太感谢了。
回复 支持 反对

使用道具 举报

发表于 2006-1-7 23:00:49 | 显示全部楼层
我面前的机器没有装yaird,无法告诉你操作方法

你先装好yaird,然後再man mkinitrd.yaird就有答案了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-1-7 23:10:34 | 显示全部楼层
再顶
怎么安装啊apt-get 不行啊
回复 支持 反对

使用道具 举报

发表于 2006-1-7 23:17:36 | 显示全部楼层
yaird现时只在testing及unstable里,你要修改一下source.list
回复 支持 反对

使用道具 举报

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

本版积分规则

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