我正在制作自己的debian livecd,粗略情况是这样
我的u盘目录结构(exfat文件系统)
erofs(用debootstrap生成的根文件)
initramfs(内存盘)
vmlinuz(内核)
EFI/BOOT/BOOTX64.EFI(GRUB)
initramfs生成配置
dracut --no-hostonly --gzip --add "dmsquash-live"
下面是重点
grub.efi生成配置
grub-mkstandalone --fonts "" --themes "" --locales "" -o BOOTX64.EFI -O x86_64-efi --install-modules "part_gpt exfat linux search search_fs_uuid boot normal gzio" --modules "part_gpt exfat linux search search_fs_uuid boot normal gzio" --compress xz " boot/grub/grub.cfg=./live.cfg
以及对应的live.cfg
search --fs-uuid --set=root 0000-0002
linux /vmlinuz root=live:UUID=0000-0002 quiet rd.live.squashimg=erofs rd.live.dir=/
initrd /initramfs
boot
这些文件扔到我的U盘引导会进救援模式,但是在grub救援模式再次手打live.cfg对应命令可以启动,U盘所有文件效验都正确,文件无损坏,真的是很诡异