| 
 | 
6#
 
 
 楼主 |
发表于 2015-12-11 09:57:46
|
只看该作者
 
 
 
 本帖最后由 zengq 于 2016-1-4 11:44 编辑  
 
 
 
谢谢!目前我只想维护一个菜单,多了麻烦且容易忘记。以前就是你说的方法,但总要编辑两个菜单文件。 
比如下面四个菜单:现在只能用UEFI   UEFI&legacy    legacy  表示三种情况:仅支持UEFI,都支持,仅支持 legacy 
 
menuentry "xorboot   UEFI" --class windows --class os { 
search --no-floppy --file --set=root /winly/winly.cfg 
chainloader /EFI/xorboot/xorboot.efi 
} 
 
if  search --file /boot/gparted-live-0.24.0-2-amd64.iso; then 
menuentry "gparted-live-0.24.0-2-amd64.iso  UEFI&legacy " { 
set isofile="/boot/gparted-live-0.24.0-2-amd64.iso" 
search --set  -f $isofile 
loopback loop $isofile 
#set gfxpayload=1280x800x32,1024x768x32,1440x900x32,1920x1080x32 
 set gfxpayload='auto' 
linux (loop)/live/vmlinuz boot=live union=overlay username=user quiet  live-config noswap nolocales edd=on nomodeset ocs_live_run="ocs-live-general" ocs_live_extra_param="" ocs_live_keymap="" ocs_live_batch="no" ocs_lang=""  ip=frommedia nosplash toram=filesystem.squashfs findiso=$isofile 
initrd (loop)/live/initrd.img 
} 
fi 
 
if  search --file /boot/LuoBo_GhostXP_SP3_v2012.07.iso; then 
menuentry "用grub4dos启动install  LuoBo_GhostXP_SP3    legacy "{ 
search --file --set=root  "/boot/grub4dos0.4.6a/grub.exe" 
set g4d_dir="/boot/grub4dos0.4.6a" 
set cfgfile="find --set-root /boot/LuoBo_GhostXP_SP3_v2012.07.iso;map --mem /boot/LuoBo_GhostXP_SP3_v2012.07.iso (0xff);map --hook;chainloader (0xff);boot" 
linux $g4d_dir/grub.exe  --config-file=$cfgfile 
} 
fi 
 
if  search --file /boot/Win8PE.iso; then 
menuentry "用memdisk启动boot目录下的Win8PE   legacy "{ 
search --file --set=root "/boot/win8PE.iso" 
linux16 /boot/memdisk iso raw 
initrd16 /boot/Win8PE.iso 
} 
fi 
 |   
 
 
 
 |