linuxboot / linuxboot/heads

kexec-parse-boot don't parse grub.cfg functions nor variables

Open
#1,360 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Makefile
Stars
1.6k
Forks
211
Avg merge
4d 21h
Merged PRs (30d)
6

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating kexec-parse-boot and the usb-init path, then compare their current grub menuentry handling with the provided grub.cfg example. Reproduce the failure using the Debian ISO or the shown configuration and verify that boot options are found when functions and variables are used.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.