11 30 2008

isolinux菜单转grub菜单二

Published by muzuiget at 5:45 下午 under Linux

上一篇介绍了用脚本转换,最快捷的方法了。之前那个《多合一小型Linux光盘》都是按这个方法做的,屡试不爽。

继续用Slax做例子,菜单文件“slax.cfg”内容如下,我截掉一些免得太长(用“……”代替)
PROMPT 0
TIMEOUT 90
DEFAULT /boot/vesamenu.c32
MENU BACKGROUND /boot/slax.png
MENU WIDTH 36
......
MENU VSHIFT 2
menu color screen 37;40 #00000000 #00000000 none
......
menu color unsel 37;44 #ff60CA00 #00000000 none
......
menu color msg07 37;40 #90ffffff #00000000 std
LABEL xconf
MENU LABEL Slax Graphics mode (KDE)
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;telinit~4 changes=/slax/
TEXT HELP
More about currently selected:
Run Slax the best way we can.
Try to autoconfigure graphics
card and use the maximum
allowed resolution
ENDTEXT
......

修改步骤

  1. 先看这一段
    PROMPT 0
    TIMEOUT 90
    DEFAULT /boot/vesamenu.c32
    MENU BACKGROUND /boot/slax.png

    这里是菜单的全局设置,就是倒数多少秒、背景是什么、字体,换成grub的话就是这样
    timeout 30
    splashimage /grub/slax.xpm

    这2个,倒数和背景,当然你的把png格式换成grub4dos所支持的xpm,方法点这里

  2. 第二段
    MENU WIDTH 36
    ......
    MENU VSHIFT 2

    这一段,grub用不着。

  3. 第三段
    menu color screen 37;40 #00000000 #00000000 none
    ......
    menu color unsel 37;44 #ff60CA00 #00000000 none
    ......
    menu color msg07 37;40 #90ffffff #00000000 std

    这里是配色,这里留意Slax用的绿色好了,也就是ff60CA00,ff表示alpha通道,后面6个字符就是表示绿色了,grub中用
    foreground 60CA00
    background FFFFFF

    来表示。

  4. 接下来的就是重点了,第四段
    LABEL xconf
    MENU LABEL Slax Graphics mode (KDE)
    KERNEL /boot/vmlinuz
    APPEND initrd=/boot/initrd.gz ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;telinit~4 changes=/slax/
    TEXT HELP
    More about currently selected:Run Slax the best way we can.
    Try to autoconfigure graphics
    card and use the maximum
    allowed resolution
    ENDTEXT

    1. “LABEL”一行以及“TEXT HELP”后面一大段对grub来说也是没用的,都删掉。
    2. 把“MENU LABEL”换成“title”,这里是条目名称,后面的文字可以改成你喜欢的,换成中文也可(不过要指定字体文件)。
    3. 把“KERNEL”换成小写。
    4. 把“APPEND”单词删掉并并到“KERNEL”一行
    5. 把“initrd=”那一段剪切出来,粘贴到新一行,把“=”换成空格(如果没有就不用)。

    最后改成
    title Slax Graphics mode (KDE)
    kernel /boot/vmlinuz ramdisk_size=6666 root=/dev/ram0 rw autoexec=xconf;telinit~4 changes=/slax/
    initrd /boot/initrd.gz

    接下来的几段都是这样改,其中内存测试那段是没有“initrd”的,这样就修改好了。

参考资料:《HOWTO: Convert a syslinux.cfg file to menu.lst》Grub4dos命令索引

最后奉上所用到的文件(包括背景和字体),猛击这里下载

One Response to “isolinux菜单转grub菜单二”

  1. borion 01 12 2008 at 7:27 下午

    按照你的方法
    终于成功了!
    泪奔呀!

Trackback URI | Comments RSS

Leave a Reply