-
Notifications
You must be signed in to change notification settings - Fork 227
bootloaders/efi: add support for getting current bootname #1696
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
Conversation
Could there be cases where the value |
Do you also use |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1696 +/- ##
=======================================
Coverage 84.47% 84.47%
=======================================
Files 76 76
Lines 22199 22228 +29
=======================================
+ Hits 18752 18778 +26
- Misses 3447 3450 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I guess most UEFI ports go thru all active boot entries in
I use the same mechanism. I have rauc without dbus in ramdisk for recovery purposes. So I simply call Edit: #1669 seems a bit related. |
91b7453
to
e3f28c4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also use src/bootloaders/efi:
as the commit message prefix for consistency.
Looks good otherwise.
src/bootloaders/efi.c
Outdated
Show resolved
Hide resolved
You could also add a test for |
When booting Unified kernel image (UKI) with baked-in kernel command line, arguments passed from firmware boot entry are often ignored. This is also behavior of systemd stub, which ignores passed arguments if secure boot is active. Signed-off-by: Pavel Löbl <pavel@loebl.cz>
e3f28c4
to
c92340d
Compare
Efiboomgr is not mocked currently. We cannot check the actual bootname. Signed-off-by: Pavel Löbl <pavel@loebl.cz>
c92340d
to
e850fb1
Compare
Hi, I think the feature makes sense and is something we want to have. I justed wanted to tune in and share an alternative way of solving the question "which slot is currently running" on a EFI system with signed UKIs, because I have also implemented that very recently. Just in case someone stumbles over this pull request in search for an answer to that question. I have used Multi-Profile UKIs to include two different command lines in one UKI. Generating the profiles$ ukify build --profile="TITLE=Boot system0" --cmdline="root=/dev/sda3 rauc.slot=system0" \
--output=system0-profile.efi
$ ukify build --profile="TITLE=Boot system1" --cmdline="root=/dev/sda4 rauc.slot=system1" \
--output=system1-profile.efi Generating the signed UKI$ ukify build \
--initrd="…" --linux="…" --cmdline="" --output="uki.efi" \
--signtool=systemd-sbsign --no-sign-kernel \
--secureboot-private-key="key.pem" \
--secureboot-certificate="cert.pem" \
--join-profile=system0-profile.efi \
--join-profile=system1-profile.efi This means the (implicit) profile Adding boot entries$ efibootmgr --create --disk "/dev/sda1" --part 1 --label "system0" \
--loader "\\EFI\\LINUX\\UKI.EFI" --unicode "@1"
$ efibootmgr --create --disk "/dev/sda2" --part 2 --label "system1" \
--loader "\\EFI\\LINUX\\UKI.EFI" --unicode "@2" The Being able to pass different command lines based on the active boot slot (while still making sure that only signed command lines may be used) can simplify the logic in the initramfs. |
When booting Unified kernel image (UKI) with baked-in kernel command line, arguments passed from firmware boot entry are often ignored. This is also behavior of systemd stub, which ignores passed arguments if secure boot is active.
This patch extends EFI bootloader backend with function to get current bootname from UEFI variables, in case there is nothing on command line.
Tested on Jetson Orin with NVIDIA EDK2 port, and systemd stub and efibootmgr v18.