Add support to chain a hdd boot in the pxelinux parser

Pierre Neyron pierre.neyron at imag.fr
Thu Sep 24 23:10:55 AEST 2020


Hi Jeremy,

On 2020-09-24 12:07, Jeremy Kerr wrote:
> 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.
> 

Yes, you can find the specification here:
https://wiki.syslinux.org/wiki/index.php?title=Comboot/chain.c32

> 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...]
> 

Oh, ok I see, this is indeed nice.

However, for our use case, the remote server that provide the tftp
pxelinux config does not know what is actually installed in the target
partition (it can be changed by the end-user after the initial
deployment of the OS, and a reboot can be triggered). So the remote
server cannot give

LABEL local
  KERNEL local://sda1/boot/vmlinux-5.10.xxx
  INITRD local://sda1/boot/initramfs-5.10.xxx.img
  APPEND "whatever kernel command line"

as it does not know neither the actual kernel nor the initrd nor append
values.


So we would really need petitboot to just get the information that the
default grub entry in sdaN must be booted, whatever it be. Thus my
proposal is to indeed add support in petitboot to parse

LABEL local
  COM32 /chain.c32
  APPEND hd0 2

and then try and boot the scanned default entry on the matching
hard-drive partition (and just fail if petitboot did not scan anything
in that disk partition).

Furthermore, we like using/parsing the exact known pxelinux chain
syntax, because we use the exact same for x86 machines (booting the
bootloader installed in the head of the disk partition, not MBR). So
having the same syntax real pxelinux syntax for PPC64 and x86 seems nice
to us.

However, I'm wondering if your proposal would be rather to have syntax
such as:

LABEL local
  KERNEL local://sda2

?

>> 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.

Ok nice !

Another question: We figured out that modifying the petitboot of our IBM
S822LC power8 systems requires reflashing the whole skiroot using a tool
such as op-test ? Is it correct ? Any advice or pointer to information
for that task would be very welcome.


Thanks a lot for you quick answer !

Cheers,
Pierre

> 
> Cheers,
> 
> 
> Jeremy
> 

-- 
Pierre NEYRON
Laboratoire d'Informatique de Grenoble
CNRS / Univ-Grenoble-Alpes / Inria



More information about the Petitboot mailing list