|
本帖最后由 liuzhaoyzz 于 2021-2-21 07:45 编辑
哦,loopback.cfg选项那里,按了e键,菜单是configfile (memdisk)/boot/grubfm/rules/iso/loop.sh
进去看了下:- source ${prefix}/func.sh;
- loopback -d loop;
- loopback loop "${grubfm_file}";
- probe --set=rootuuid -u "(${grubfm_device})";
- export iso_path="${grubfm_path}";
- export rootuuid;
- if [ -f "${theme_std}" ];
- then
- export theme=${theme_std};
- fi;
- set root=loop;
- configfile /boot/grub/loopback.cfg;
复制代码
source ${prefix}/func.sh里面好像是交换了磁盘:
function to_g4d_path {
set g4d_path="${1}";
lua ${prefix}/g4d_path.lua;
}
function to_g4d_menu {
set g4d_menu="${1}";
loopback -d rd;
loopback -m rd ${prefix}/initrd.img.xz;
lua ${prefix}/g4d_menu.lua;
}
function auto_swap {
if regexp '^hd[0-9a-zA-Z,]+$' ${grubfm_disk};
then
regexp -s devnum '^hd([0-9]+).*$' ${grubfm_disk};
if test "devnum" != "0";
then
map -s (hd0) (${grubfm_disk});
fi;
fi;
}
function swap_hd01 {
if [ "$grub_platform" != "efi" ];
then
if [ "${bootdev}" = "hd0" ];
then
map -s (hd0) (hd1);
fi;
fi;
}
regexp --set=1:grubfm_path '(/.*)$' "${grubfm_file}";
regexp --set=1:grubfm_dir '^(.*/).*$' "${grubfm_path}";
regexp --set=1:grubfm_device '^\(([0-9a-zA-Z,]+)\)/.*' "${grubfm_file}";
regexp --set=1:grubfm_disk '([chf]d[0-9]+)[0-9,]*' "${grubfm_device}";
regexp --set=1:grubfm_name '^.*/(.*)$' "${grubfm_file}";
unset grubfm_filename;
unset grubfm_fileext;
regexp --set=1:grubfm_filename '^(.*)\.(.*)$' "${grubfm_name}";
regexp --set=1:grubfm_fileext '^.*\.(.*)$' "${grubfm_name}";
于是我把菜单改成了类似的,loopback loop $iso_path的前面加上了loopback -d loop;
menuentry "/linux/veket/veket-20.10.iso-loopback" "/linux/veket/veket-20.10.iso" {
iso_path="/linux/veket/veket-20.10.iso"
export iso_path
search --set=root --file $iso_path;probe -u ($root) -s rootuuid;echo $rootuuid;export rootuuid;
loopback -d loop;
loopback loop $iso_path
root=(loop)
configfile /boot/grub/loopback.cfg
}
结果还是不行啊。虚拟机卡死,“固件遇到意外的异常情况。虚拟机无法引导”。实体机直接死机了。卡死在这一句:configfile /boot/grub/loopback.cfg
|
|