limine: autoGenerateKeys won't work with hosts using impermanence
Nixpkgs version
- Unstable (26.05)
Describe the bug
With limine boot loader, if using autoGenerateKeys in an impermanence-based setup, the activation script that should fire doesn't.
Looking at the limine-install.py, on line 560 there is this code:
if config('secureBoot', 'enable'):
sbctl = os.path.join(str(config('secureBoot', 'sbctl')), 'bin', 'sbctl')
if not os.path.exists("/var/lib/sbctl") and config('secureBoot', 'autoGenerateKeys'):
print('auto generating keys')
The script will only fire if the /var/lib/sbctl directory doesn't exist. However, on impermanent systems, this folder needs to be marked as persisted, and as such, the directory is present (and empty) prior to the script running, and symlinked to the persisted directory.
I think a decent fix would be to instead look for the existence of the keys subdirectory instead. Something like below perhaps?
if config('secureBoot', 'enable'):
sbctl = os.path.join(str(config('secureBoot', 'sbctl')), 'bin', 'sbctl')
if not os.path.exists("/var/lib/sbctl/keys") and config('secureBoot', 'autoGenerateKeys'):
print('auto generating keys')
Steps to reproduce
Deploy a host with impermanence enabled and /var/lib/sbctl persisted. Limine will not autoGenerateKeys.
Expected behaviour
The script should fire and generate/enroll keys.
Screenshots
No response
Relevant log output
Additional context
No response
System metadata
- system:
"x86_64-linux" - host os:
Linux 7.0.1-cachyos, NixOS, 26.05 (Yarara), 26.05.20260422.0726a0e - multi-user?:
yes - sandbox:
yes - version:
nix-env (Nix) 2.34.6 - nixpkgs:
/nix/store/75bkaivfbwq3x8cs7155hag7hs1chjcx-source
Notify maintainers
@JohnRTitor @lzcunt @Prince213 @programmerlexi @ryand56
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
- [x] I assert that this is a bug and not a support request.
- [x] I assert that this is not a duplicate of an existing issue.
- [x] I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a :+1: reaction to issues you find important.
This is resolved in #514762.
Lovely. Thank you!
Closing due to linked PR fix.
The PR still needs to be reviewed and merged, so this is not a fixed issue