heads
heads copied to clipboard
kexec-parse-boot don't parse grub.cfg functions nor variables
Example debian-11.6.0-ppc64el-netinst.iso (Talos II debian image) contains unexpected grub.cfg content, resulting in usb-init failing to parse ISO boot options and simply failing, saying that no boot options were found.
user@talos-tests:/media$ cat /media/boot/grub/grub.cfg
set default=2
set timeout=-1
insmod echo
insmod gzio
insmod minicmd
insmod normal
menuentry "Debian GNU/Linux installer boot menu" {
true
}
menuentry "" {
true
}
function boot_one {
echo "Loading ..."
linux /install/vmlinux $options --- quiet
initrd /install/initrd.gz
}
menuentry "Default install" {
boot_one
}
menuentry "Automated install" {
set options="auto=true priority=critical"
boot_one
}
menuentry "Expert install" {
set options="priority=low"
boot_one
}
menuentry "Rescue mode" {
set options="rescue/enable=true"
boot_one
}
kexec-parse-boot only parses grub menuentry and tries to find initrd kernel and xen entries. It has no knowledge of function nor anything else exposed in previous grub.cfg.
Workaround is to construct kexec load line manually (-l) and then execute (-e).... After attempting to boot from usb is to do from command line:
kexec -l /media/install/vmlinux --initrd=/media/install/initrd.gz
kexec -e