Open ausil opened 5 years ago
I think it's pretty straightforward to make libostree/ostree-bootloader-zipl.c
but I'm struggling on how to test the code. Got a tip from @cgwalters about tests/test-admin-deploy-syslinux.sh
and looking into it.
zipl understands BLS so there are two ways:
/boot/loader/zipl.conf
by copying content from BLS file (feels like syslinux + uboot do)
[defaultboot]
defaultauto
prompt=1
timeout=5
default=linux
target=/boot
[linux]
image=<copy from BLS>
ramdisk=<copy from BLS>
parameters="<copy from BLS>"
-b
parameter pointing to BLS file
[defaultboot]
defaultauto
prompt=1
timeout=5
target=/boot
https://github.com/ibm-s390-tools/s390-tools/issues/64 is a related issue for the bootloader itself
keep a "dummy" zipl.conf and invoke $ zipl with -b parameter pointing to BLS file
I'd prefer this - and even better, avoid having to invoke zipl at all from ostree; have it read the BLS snippets directly, like grub does. We are just reaching this point on x86_64: https://github.com/coreos/coreos-assembler/pull/616
zipl is like LILO (if you remember the early Linux days :-)), so without chainloading another bootloader you need to update the boot records with the zipl userspace tool.
CC @martinezjavier
zipl is like LILO (if you remember the early Linux days :-)), so without chainloading another bootloader you need to update the boot records with the zipl userspace tool.
That's correct.
This seems to be a little bit weird. With or without my zipl changes in ostree (even it does not work yet, /boot/loader/zipl.conf
, for example, has not been generated), ostree still manages to get correct /boot/loader/entries/ostree-1-fedora-coreos.conf
(with small quirks). So in anaconda I can run zipl with a dummy /etc/zipl.conf
pluses above load entries file and FCOS seems to boot.
So the final question is : do we even need zipl code in ostree :D
One thing I would like to ask is how grub is triggered to run each time we switch to new ostree deploy, i.e. changes happen in load entries file ? And does trigger executes grub2-mkconfig
? I guess Fedora must have a mechanism to trigger initramfs tools (dracut) to run, then trigger to update bootloader. Because this is exactly something we might need to do for zipl. Not sure doing this in ostree side or in Fedora side.
So the final question is : do we even need zipl code in ostree :D
...
One thing I would like to ask is how grub is triggered to run each time we switch to new ostree deploy,
It sounds like we would need a bootloader backend in ostree that simply runs zipl
? Most of the other bootloader backends in ostree read the BLS fragments and generate a bootloader-specific config file, but it sounds like zipl itself reads those now (which is great!) and literally all we need to do is rerun the command to have it update the (boot records? what's the right term)?
It sounds like we would need a bootloader backend in ostree that simply runs
zipl
?
If for triggering each time the tree is updated with new deploy, then yes. Anaconda only does it once at installation time.
Most of the other bootloader backends in ostree read the BLS fragments and generate a bootloader-specific config file, but it sounds like zipl itself reads those now (which is great!)
Yes, it's great that @martinezjavier added BLS support last year. I believe for this part we don't have to implement for zipl.
and literally all we need to do is rerun the command to have it update the (boot records? what's the right term)?
Yes, rerun the command to update boot records. And a trigger/hook for zipl to run on its own whenever, for example, /boot/loader/entries/*.conf
is touch/changed.
To summarize current status, and what is still needed to be done:
Issues were not mentioned here:
Existing issues:
There are apparently issues with ostree not setting up the bootloader correctly on s390x, I currently do not have the specific issues details but wanted to get a placeholder so that as we investigate we can update here and get things working.