Grub 无法识别等混合映像上的 fat32 文件系统

Grub can't recognize fat32 filesystem on a isohybrid image

我正在使用以下命令构建多引导 isohybrid 映像:

xorriso -as mkisofs -iso-level 3 -full-iso9660-filenames -volid "MULTIBOOT" -eltorito-boot boot/isolinux/isolinux.bin -eltorito-catalog boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -isohybrid-mbr ${isodir}boot/isolinux/isohdpfx.bin -eltorito-alt-boot -e boot/isolinux/efiboot.img -no-emul-boot -isohybrid-gpt-basdat -output ~/output.iso  ${isodir}

在 BIOS 模式下启动时,这会按预期加载 isolinux 引导加载程序,但由于我想使用 grub,我使用此配置文件链式加载它:

Default Grub2
LABEL Grub2
SAY Switching to Grub2... 
Linux /boot/grub/lnxboot.img
INITRD /boot/grub/core.img

Grub 加载,但不显示主菜单,而是掉到救援控制台,声称无法识别文件系统。有趣的是,当我从 CD 加载 iso 时会发生这种情况,但如果我将它刻录到 USB 驱动器则不会。在这种情况下,Grub 会找到文件系统并按预期工作。

这是我当前 grub.cfg 的开始(没有菜单项):

insmod iso9660
insmod gfxmenu
insmod png
insmod part_msdos
insmod part_gpt
insmod fat
insmod ntfs
insmod ext2
insmod efi_gop
insmod efi_uga
if [ "${grub_platform}" != "efi" ]; then
    insmod vbe
    insmod vga
fi
insmod gfxterm
terminal_output gfxterm

set gfxmode=800x600
search --file --no-floppy --set=root /multiboot/menu/main_menu.cfg
#set root='hd0,msdos1'
set timeout=30
set theme="/boot/grub/themes/multiboot/theme.txt"

loadfont /boot/grub/fonts/unifont-bold-16.pf2
loadfont /boot/grub/fonts/unifont-regular-16.pf2
loadfont /boot/grub/fonts/unifont-regular-14.pf2
loadfont /boot/grub/fonts/unifont-regular-32.pf2

set default=1

我的猜测是我的 core.img 缺少一些模块以在从 CD 启动时正常工作,但我已经在我的 core.img 中明确包含了 le iso9660 模块但没有成功

在睡了一觉并修了一会儿之后,我找到了解决方案。我必须使用以下命令创建 core.img:

grub-mkimage  -O i386-pc -c common.cfg  -p /boot/grub biosdisk part_msdos part_gpt fat ntfs exfat iso9660 search -o core.img

common.cfg 文件包含以下内容:

search --file --no-floppy --set=root /multiboot/menu/main_menu.cfg
set cmdpath=($root)
set prefix=($root)/boot/grub