无忧启动论坛

标题: grub2如何执行根目录下的img镜像 [打印本页]

作者: vou    时间: 2008-5-30 14:42
标题: grub2如何执行根目录下的img镜像
官方例子。
# This is a grub.cfg example

function gfx
{
  insmod video
  insmod vbe
  insmod gfxterm
  insmod png
  insmod jpeg
  font (hd0,1)/boot/grub/unifont.pff
  set gfxmode="640x480"
  terminal gfxterm
  background_image (hd0,1)/boot/grub/splash.png
}

set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
gfx

menuentry "启动第一个主分区"
{
  set root=(hd0,1)
  chainloader +1
}

menuentry "啓動第二個主分區"
{
  set root=(hd0,2)
  chainloader +1
}

menuentry "测试JPEG背景图片"
{
  background_image (hd0,1)/boot/grub/splash.jpg
}

menuentry "测试PNG背景图片"
{
  background_image (hd0,1)/boot/grub/splash.png
}



现在img文件的根目录有个a.img文件,我想用通过grub2菜单来执行这个a.img

按照GGhost2008的写法是
menuentry "0, GGhost 2008" {
#    search --set /ggho/grub/gghost.img
    linux  /ggho/gnu2/memdisk  c=280 h=2 s=36 floppy
    initrd /ggho/grub/gghost.img
}


应该怎么改呢。
作者: 陌上风    时间: 2008-5-30 20:26
编辑 menu.list:


title 启动 DOS 工具箱
map --mem /finedos.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
作者: lianjiang    时间: 2008-5-30 21:13
只需把路径改到根目录就行了。

如:
hd(0,1)/aaa.img

加上自己所用img的chs参数。
参数确定的方法,可查找本论坛的帖子,有很多。
作者: barton    时间: 2008-5-30 21:43
只要注意一下,grub2里分区是从(hd0,1)开始,放在哪个盘都可以。
作者: katar1024    时间: 2008-7-10 08:48
好象有个loopback命令,不过我试了下好象有问题
作者: fatality    时间: 2009-11-17 14:45
最新的grub2还是不能启动.img镜像文件啊!




欢迎光临 无忧启动论坛 (http://wuyou.net/) Powered by Discuz! X3.3