-
Notifications
You must be signed in to change notification settings - Fork 2.5k
efibootmgr: change kernel hook logic #58394
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
base: master
Are you sure you want to change the base?
Conversation
creating new firmware entries with every kernel configuration is dangerous. This will instead create an 'A' and 'B' kernel and initramfs. This does not modify any firmware entries but instead puts a kernel and initramfs in fixed locations to allow the user to manually create an EFI entry for their current kernel and previous one.
|
@ahesford I implemented the logic as you described alongside with a backup kernel, I'd appreciate if you could give me some feedback on this PR. Thank you |
|
the names should also probably be changed, I did "A" and "B" but maybe "current" and "previous" are better. I only tested this with the "linux" package kernel, which is currently 6.12, testing the other provided kernels would be a good idea. |
|
is there a way to retrieve the verisons of those A/B files? i would store it somewhere if it can't be obtained after this change... otherwise i like the idea, but atmega showed me that it is hard to kill such with many writing cycles |
you could store it, it can also be retrieved straight from the efi files with |
|
I'm not sure this belongs in the
|
Sure I'd be fine if this were moved elsewhere.
I agree, I can change them. A and B are just what came to mind first, I can change it to whatever people prefer.
Sure.
Sure. For both of these configurations would that just be a variable in efiootmgr-kernel-hook(or wherever this gets moved to)?
This one is hard to do and I'm not sure of a way to do so that isn't complicated. There are plenty of cases where a user does want |
I think you've misinterpreted the behavior. Your hook will fire with every kernel update, which means that a The existing hook avoids this problem by preserving existing boot order and creating a new entry for every minor kernel series. The user decides independently which entry should boot, and this will not change unless a kernel series is removed entirely and the corresponding entry is removed. Your proposal requires more sophistication to allow users to prevent updates of one kernel series from stomping on another. |
creating new firmware entries with every kernel configuration is dangerous. This will instead create an 'A' and 'B' kernel and initramfs. This does not modify any firmware entries but instead puts a kernel and initramfs in fixed locations to allow the user to manually create an EFI entry for their current kernel and previous one.
The post-remove hook didn't seem to have a use anymore so I removed it.
The script does NOT deal properly with the efi partition being anywhere but /efi/boot, I'm not sure of a good way of finding it and guidance would be appreciated.
Users will need to create their own entry with efibootmgr, I can add this to the void documentation.
Discussed in #58384
Testing the changes
Local build testing