petitboot icon indicating copy to clipboard operation
petitboot copied to clipboard

BootLoader Spec Support

Open hanetzer opened this issue 4 years ago • 3 comments

https://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/

Just an idea. Basically this, and you can have multiple files.

# /boot/loader/entries/6a9857a393724b7a981ebb5b8495b9ea-3.8.0-2.fc19.x86_64.conf
title      Fedora 19 (Rawhide)
version    3.8.0-2.fc19.x86_64
machine-id 6a9857a393724b7a981ebb5b8495b9ea
options    root=UUID=6d3376e4-fc93-4509-95ec-a21d68011da2
linux      /6a9857a393724b7a981ebb5b8495b9ea/3.8.0-2.fc19.x86_64/linux
initrd     /6a9857a393724b7a981ebb5b8495b9ea/3.8.0-2.fc19.x86_64/initrd

hanetzer avatar Feb 25 '21 01:02 hanetzer

Looks like it's very very close to our 'native' configuration in Petitboot:

name Fedora 19 (Rawhide)
image /6a9857a393724b7a981ebb5b8495b9ea/3.8.0-2.fc19.x86_64/linux
args root=UUID=6d3376e4-fc93-4509-95ec-a21d68011da2
initrd /6a9857a393724b7a981ebb5b8495b9ea/3.8.0-2.fc19.x86_64/initrd

We don't have machine-id or version - but apparently we're not required to do anything special about them as well, so we might as well ignore them for a first version of this feature.

So looks like we could simply duplicate the native parser and call it 'freedesktop' or something similar, changing name for title and args for options and making sure we can ignore machine-id and version for now.

Do you want to take a stab at providing patches for this?

klauskiwi avatar Feb 25 '21 11:02 klauskiwi

Well, its not just one file, more of a drop in dir. You can have, for example:

/boot/efi/loader/entries/aeeef620aa484bb490a0638814a92548-0-rescue.conf
/boot/efi/loader/entries/aeeef620aa484bb490a0638814a92548-5.10.14-200.fc33.x86_64.conf
/boot/efi/loader/entries/aeeef620aa484bb490a0638814a92548-5.10.15-200.fc33.x86_64.conf
/boot/efi/loader/entries/aeeef620aa484bb490a0638814a92548-5.10.16-200.fc33.x86_64.conf

All on one machine. I could give it a go, sure. I'm not familiar with bison/etc but it can't be that hard.

hanetzer avatar Feb 25 '21 14:02 hanetzer

There is already some initial support for BootloaderSpec files in https://github.com/open-power/petitboot/blob/master/discover/grub2/blscfg.c, although the intent is mainly being referenced by GRUB. That could be a good start to make the support more generic.

sammj avatar Feb 26 '21 05:02 sammj