-
Notifications
You must be signed in to change notification settings - Fork 21
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
efi: change --update-firmware
to match current Anaconda logic
#665
Conversation
0cee452
to
90b31ab
Compare
--update-firmware
to match current Anaconda logic--update-firmware
to match current Anaconda logic
5941438
to
34b1ae4
Compare
CI failed as the ubuntu does not have
|
--update-firmware
to match current Anaconda logic--update-firmware
to match current Anaconda logic
That's a deprecated path, the preferred file is |
The initial idea was to match Anaconda behavior exactly but that's indeed not ideal. Maybe we should use the |
Apart from that the code looks good. Thanks a lot! |
src/efi.rs
Outdated
|
||
#[test] | ||
fn test_get_product_name() -> Result<()> { | ||
let product_name = get_product_name()?; |
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.
We shouldn't read from the host system in a unit test. The best thing to do here is what you did in test_parse_boot_entries()
- the unit test is testing parsing, leaving the "load the data" part outside of the test.
That all said, I do think we should be reading from the os-release
file anyways, and actually for that...hmm, there are a few crates out there, not sure of maintenance status of any of them. Maybe not worth pulling in something external. We may even have something in our ecosystem. Ah yep, see https://github.com/coreos/rpm-ostree/blob/fec15f5e24ce2c44f97f602152ac913134bd3173/rust/src/countme.rs#L67
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.
Overall this is looking pretty good, but we definitely could use some manual testing. I will try to do that tomorrow.
How much testing did you do with this on virtual or ideally some physical hardware?
Thanks @cgwalters @travier very much for the suggestion, it sounds more reasonable to use |
I did testing using The steps what I did:
|
Copy Timothée's comment: We want to be able to use `bootupd backend install --update-firmware` in Anaconda to setup the boot order on EFI systems. The issue is that when called with `--update-firmware`, bootupd currently removes the `BootCurrent` boot entry, and then adds a new BootEntry for the system being installed. The current Anaconda behavior is to remove all boot entries that match the product name, then create a new boot entry using the product name and set it as the first one in the boot order. To sync with Anaconda behavior, when called with `--update-firmware`, bootupd will remove all boot entries that match the product name. See coreos#658
Hold on, after running bootc |
Start vm with secure boot disabled
Find |
Yes, we'll slightly differ from what Anaconda does but that's fine.
It will indeed need a lot of manual testing on real hardware. We should likely only push this code to Fedora Rawhide/41 so that we get some time to test it there. I can also make test containers/ISOs. |
Ignore the hang error, maybe it is because of fedora vm using Change vm to centos image, can boot successfully, but can not login with root & password after reboot, but anyway, the efibootmgr can create new efi boot entry. Start centos image, run
Run
Another issue is we missed |
OK yeah though we can see the difference here in using the os-release data vs system-release. I guess a consequence of this is that we'll "leak" the old bootentry in the use case of a bootc install on top of a system installed from Anaconda. Which...will actually be a somewhat common case. I'm not an expert in this but I think at least some uefi firmware will GC entries at some point that don't have backing files? |
OK so logistically we have a bit of a trap because:
So I think we could add something like What I'm a bit uncertain is how easy it is to get environment variables in to the anaconda process itself. Well, honestly I think my vote is: Let's reopen rhinstaller/anaconda#5508 and merge both it and this to rawhide, after at least some basic testing of both pre-merge. |
OK I've at least tested this doesn't break the virt installation case. Let's go ahead and get this in so it shows up in https://copr.fedorainfracloud.org/coprs/g/CoreOS/continuous/package/bootupd/ for easier integration testing. |
Copy Timothée's comment:
We want to be able to use
bootupd backend install --update-firmware
in Anaconda to setup the boot order on EFI systems.
The issue is that when called with
--update-firmware
, bootupdcurrently removes the
BootCurrent
boot entry, and then adds anew BootEntry for the system being installed.
The current Anaconda behavior is to remove all boot entries that
match the product name, then create a new boot entry using the
product name and set it as the first one in the boot order.
To sync with Anaconda behavior, when called with
--update-firmware
,bootupd will remove all boot entries that match the product name.
See #658