Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add service to ensure systemd-boot installed #385

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dbnicholson
Copy link
Member

On systemd-boot systems, the bootloader is updated with bootctl update on every boot. Unfortunately, it doesn't currently work because bootctl considers systemd-boot to be installed if /EFI/systemd is non-empty in the ESP. The image builder only populates /EFI/BOOT, so systemd-boot is not considered installed.

If bootctl does not consider systemd-boot to be installed, eos-ensure-sd-boot will check the LoaderInfo EFI variable to see if the current bootloader is systemd-boot. If so, it populates /EFI/systemd so that the next time bootctl update runs, it will update the bootloader.

https://phabricator.endlessm.com/T34703

@dbnicholson
Copy link
Member Author

I tested this on both grub and systemd-boot VMs. For the grub system it correctly did nothing. For the systemd-boot VM, it correctly populated /EFI/systemd. That allowed bootctl update to run and update the EFI binaries. Unfortunately, it also tried to update /boot/loader, and that doesn't exist since we have some hacks to use a fake symlink /boot/loader.sln.

Marking this as a draft for now. One solution I can think of is to change systemd downstream so that bootctl only tries to install or update the EFI binaries and doesn't touch the rest of /boot. We've been getting along fine without any of the things it wants to put in `/boot/loader.

@dbnicholson dbnicholson marked this pull request as draft April 12, 2023 19:18
On systemd-boot systems, the bootloader is updated with `bootctl update`
on every boot. Unfortunately, it doesn't currently work because
`bootctl` considers systemd-boot to be installed if `/EFI/systemd` is
non-empty in the ESP. The image builder only populates `/EFI/BOOT`, so
systemd-boot is not considered installed.

If `bootctl` does not consider systemd-boot to be installed,
`eos-ensure-sd-boot` will check the `LoaderInfo` EFI variable to see if
the current bootloader is systemd-boot. If so, it runs `bootctl install`
so that the next time `bootctl update` runs, it will update the
bootloader.

https://phabricator.endlessm.com/T34703
@dbnicholson
Copy link
Member Author

I changed this to run bootctl install instead. That depends on endlessm/systemd#167 so that the installation doesn't cause potential confusion with the fake symlink hack. I tested this on a PAYG VM and it seems to work well.

@dbnicholson dbnicholson marked this pull request as ready for review April 13, 2023 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant