nixos/systemd-boot: init boot counting#273062
nixos/systemd-boot: init boot counting#273062RaitoBezarius merged 1 commit intoNixOS:masterfrom JulienMalka:systemd-boot-counting
Conversation
|
Thanks a lot for this! I'm very interested in this PR. How does this work with specializations? My guess is that currently if an entry fail, it will boot to the next specialization by lexicographic order, since it will be between two "main" entries. I don't think this is what we want? |
|
This definitely needs a release notes entry too :D |
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
Outdated
Show resolved
Hide resolved
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
Outdated
Show resolved
Hide resolved
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
Outdated
Show resolved
Hide resolved
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
Outdated
Show resolved
Hide resolved
|
I'm assuming this PR will also include pulling in the upstream |
It's in there already, no ? |
You are right in your guess. I don't think this is anything we can go around, boot counting is going to try the entries in the same order it will list them in the boot menu. The only way we can have the specialisations listed in a satisfactory order in the boot menu is accepting they will be tested between the main entries. The problem here is that our specialisation implementation is more a hack than a real |
|
@JulienMalka documenting the behavior seems good to me. If it's understood, people can also "use" specializations as a configuration to try with boot counting. |
Exactly, it's even not unlikely that a main generation doesn't reach @RaitoBezarius even told me even about some usecases where you could do that by design (have for example one different kernel version by specialisation) |
|
|
This is ready for review. |
|
@ofborg test systemd-boot |
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
Outdated
Show resolved
Hide resolved
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
Outdated
Show resolved
Hide resolved
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
Outdated
Show resolved
Hide resolved
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
Outdated
Show resolved
Hide resolved
nixos/modules/system/boot/loader/systemd-boot/systemd-boot-builder.py
Outdated
Show resolved
Hide resolved
|
Should this work with lanzaboote? Than I would give this a test run on my machine. |
No, this is an implementation for the |
|
Thanks for the suggestions @Mic92, applied all of them. |
RaitoBezarius
left a comment
There was a problem hiding this comment.
I'm not the expert on the builder, but overall, everything looks good to me, it has solid testing and has been sitting for a while. I am inclined to send it, but I will leave you the honor to choose when to do it, Julien.
|
(Discussed in private for the merge.) |
|
Hello!
|
|
Not normal, thanks for catching that. |
|
I have this entries (hope it can be useful): |
|
I know what the problem is, there is an assertion that there is a "sort-key" line in entries, which doesn't exist for entries generated with older versions of the builder. |
|
I am glad that at least I can help the project in this way ) |
|
I was about to do a write-up for a GSoC project to do this, so it's fantastic news that this is already here. Thank you so much to all involved! |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
Is someone working on fixing this marvel? |
Description of changes
This is a spin-off of #84204, that is a PR introducing automatic boot assessment for NixOS, see here. Thanks a lot to @danielfullmer for the initial work on that topic, a lot of this PR has been heavily inspired by #84204.
Most of the design is similar and have been reimplemented to fit with the current state of the
systemd-bootbackend.The handling of the default generation is done using the
sort-keydefined in the boot loader specification. In the first iteration of this change (#84204), it was suggested to usedefaultin the filename of the default generation entry, but since thensystemd-bootis using theversionfield before thefilenameto sort the entries so this hack is no longer possible.Todo before merging:
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.