Add support to chain a hdd boot in the pxelinux parser

Jeremy Kerr jk at ozlabs.org
Thu Sep 24 20:07:11 AEST 2020


Hi Pierre,

> 1/ petitboot fetches a pxelinux.cfg/XXXXXXXX from the network,
> containing for instance:
> 
> LABEL local
> 	COM32 /chain.c32
> 	APPEND hd0 N

So pxelinux has specific support for chaining back to a local image;
petitboot doesn't really need that, as we didn't start a pxelinux
payload in the first place - we can just boot to whatever (final)
payload is specified.

The resources that you specify in the pxelinux config (KERNEL/INITRD)
are just URLs, plus a bit of pxelinux-specific support for the
::<filename> format.

So, with the current code, you could just use a file:// URL in your
config, to chain back to a local payload:

  LABEL local
    KERNEL file:///var/petitboot/mnt/sda1/boot/payload

- which allows you to specify arbitrary files there.

That's a little ugly though, as it depends on the petitboot mount
paths; it might be neater to add something like a local:// URL scheme,
allowing something like:

  LABEL local
    KERNEL local://sda1/boot/payload

[preferably allowing UUID- and label-based references to block devices
too...]

> Questions:
> - Is that something that somebody already worked on in the past ? (we
> did not find traces of that in the code or documentation)

Not that I'm aware of, no.

> - Does the required code seems tricky to experienced developers of
> petitboot ? (we did not start diving in yet).

Implementing a local:// URL scheme should be fairly straightforward. We
already have code to do the right thing for probe order too, so it will
wait for the specified local device to become available before trying
to boot from it.

Cheers,


Jeremy



More information about the Petitboot mailing list