无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 3694|回复: 5
打印 上一主题 下一主题

[已解决] grub2调用grub4dos,同时调用指定菜单,失效?

[复制链接]
跳转到指定楼层
1#
发表于 2020-9-29 10:53:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 wengzhenquan 于 2020-9-29 13:12 编辑

第一种方式: 失败!(只会调用根路径下的menu.lst)


  1. menuentry "[f] grub4dos 菜单"                                         --hotkey=f{
  2.         search --file --set=root /grub.exe
  3.         linux16 ($root)/grub.exe --config-file=/boot/grub4dos/2_menu.lst
  4. }
复制代码




第二种方式:失败!(只会调用根路径下的menu.lst)


编辑grldr文件,放到2_menu.lst相同目录下
  1. pxe detect
  2. configfile
  3. default 0
  4. timeout 0

  5. title find /2_menu.lst
  6.         errorcheck off
  7.         configfile /boot/grub4dos/2_menu.lst
  8.         configfile /boot/grub4dos/menu.lst
  9.         configfile /2_menu.lst
  10.         if "%@root%"=="(ud)" && calc *0x82A0=*0x82b9&0xff
  11.         if "%@root:~1,1%"=="f" && find --set-root --devices=f /boot/grub4dos/2_menu.lst && configfile /boot/grub4dos/2_menu.lst
  12.         find --set-root --ignore-floppies --ignore-cd /boot/grub4dos/2_menu.lst && configfile /boot/grub4dos/2_menu.lst
  13.         find --set-root --ignore-floppies --ignore-cd /boot/grub4dos/menu.lst && configfile /boot/grub4dos/menu.lst
  14.         find --set-root --ignore-floppies --ignore-cd /2_menu.lst && configfile /2_menu.lst
  15.         configfile http://b.chenall.net/menu.lst
  16.         errorcheck on
  17.         commandline

  18. title commandline
  19.         commandline

  20. title reboot
  21.         reboot

  22. title halt
  23.         halt

复制代码



然后在grub2
  1. menuentry "[f] GRUB4DOS 菜单"                                              --hotkey=f {
  2.         search --file --no-floppy --set=root /boot/grub4dos/grldr
  3.         insmod ntldr
  4.         ntldr ($root)/boot/grub4dos/grldr
  5. }
复制代码

依旧失效


只会加载跟目录的menu.lst文件,不会加载 /boot/grub4dos/2_menu.lst



已解决 6楼↓


2#
发表于 2020-9-29 12:37:21 | 只看该作者
把菜单写到内部,一个菜单 弄一个 gruldr (文件又不大)

要进阶 处理的话 爬贴子:
http://bbs.wuyou.net/forum.php?mod=viewthread&tid=414504

http://bbs.wuyou.net/forum.php?m ... d=421410&extra=
回复

使用道具 举报

3#
 楼主| 发表于 2020-9-29 12:42:22 | 只看该作者
xbmc 发表于 2020-9-29 12:25
http://bbs.wuyou.net/forum.php?mod=viewthread&tid=209309

他那种是引导镜像的写法,我改造之后还是失败
  1. menuentry "[f] GRUB4DOS 菜单"                                              --hotkey=f {
  2.         search --file --no-floppy --set=root /grub.exe
  3.         set cfgfile="find --set-root /boot/grub4dos/2_menu.lst chainloader /boot/grub4dos/2_menu.lst;boot"
  4.         linux /grub.exe --config-file=$cfgfile
  5. }
复制代码
回复

使用道具 举报

4#
 楼主| 发表于 2020-9-29 13:11:21 | 只看该作者
xbmc 发表于 2020-9-29 12:47
chainloader -> configfile

可用,谢谢
menuentry "[f] GRUB4DOS 菜单"                                              --hotkey=f {
        search --file --no-floppy --set=root /grub.exe
        set cfgfile="find --set-root /boot/grub4dos/2_menu.lst  configfile /boot/grub4dos/2_menu.lst;boot"
        linux /grub.exe --config-file=$cfgfile
}
回复

使用道具 举报

5#
发表于 2020-9-29 13:33:58 | 只看该作者
是这样吗?
menuentry "[f] GRUB4DOS 菜单"                                              --hotkey=f {
        search --file --no-floppy --set=root /grub.exe
        set cfgfile="find --set-root /boot/grub4dos/2_menu.lst  chainloader /boot/grub4dos/2_menu.lst;boot"
        linux /grub.exe --config-file=$cfgfile

点评

configfile !!!  详情 回复 发表于 2020-9-29 16:53
回复

使用道具 举报

6#
 楼主| 发表于 2020-9-29 16:53:42 | 只看该作者
张建军1861 发表于 2020-9-29 13:33
是这样吗?
menuentry "[f] GRUB4DOS 菜单"                                              --hotkey=f {
...
  1. menuentry "[f] GRUB4DOS 菜单"                                              --hotkey=f {
  2.         search --file --no-floppy --set=root /grub.exe
  3.         set cfgfile="find --set-root /boot/grub4dos/2_menu.lst  configfile /boot/grub4dos/2_menu.lst;boot"
  4.         linux /grub.exe --config-file=$cfgfile
  5. }
复制代码


configfile !!!
回复

使用道具 举报

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

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-5-18 09:56

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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