Skip to content

nixos/systemd-boot: create boot entries for specialisations #108338

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

Merged
merged 1 commit into from
Oct 31, 2021

Conversation

lukegb
Copy link
Contributor

@lukegb lukegb commented Jan 3, 2021

Motivation for this change

Some specialisations (such as those which affect various boot-time
attributes) cannot be switched to at runtime. This allows picking the
specialisation at boot time.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@lukegb
Copy link
Contributor Author

lukegb commented Jan 3, 2021

@ofborg test systemd-boot

@lukegb lukegb requested a review from danielfullmer January 3, 2021 18:32
@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jan 3, 2021
@SuperSandro2000 SuperSandro2000 requested a review from Mic92 January 3, 2021 19:01
@lukegb lukegb force-pushed the systemd-boot-specialisations branch from e555c8c to d483cee Compare January 3, 2021 20:11
@lukegb lukegb mentioned this pull request Jan 3, 2021
10 tasks
@lukegb
Copy link
Contributor Author

lukegb commented Jan 3, 2021

@ofborg eval

1 similar comment
@lukegb
Copy link
Contributor Author

lukegb commented Jan 3, 2021

@ofborg eval

@lukegb lukegb force-pushed the systemd-boot-specialisations branch from d483cee to b9205e4 Compare January 9, 2021 04:48
@lukegb lukegb requested a review from FRidh January 9, 2021 04:49
@misuzu
Copy link
Contributor

misuzu commented Jun 18, 2021

What about grub? Does it support booting into specializations?

@Gerschtli
Copy link
Contributor

What is the current status of that? I would like to see that feature being merged :)

Also would like to help if needed.

@Gerschtli
Copy link
Contributor

@misuzu as far as I understand the documentation and the source code, yes it is supported for grub. This PR just enables the same behaviour for systemd-boot as available for grub already.

@Gerschtli
Copy link
Contributor

Ping @Mic92 (sorry if you are not the right one, but please review or ping a maintainer who is able to do it) to raise awareness of this feature mismatch between grub and systemd-boot.

@lukegb Could you please rebase your changes on latest master?

@SuperSandro2000 SuperSandro2000 added the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 10, 2021
@FlorianFranzen
Copy link
Contributor

I rebased the commit here on the latest master. @lukegb @Mic92 @FRidh What is missing to get this merged. It would be nice to treat specialisations properly when using systemd-boot.

@ryanswrt
Copy link

Willing to sponsor work on this to get it over the line, relatively critical for my use-case.

@lukegb lukegb force-pushed the systemd-boot-specialisations branch from b9205e4 to 4599f0a Compare October 31, 2021 11:11
@lukegb
Copy link
Contributor Author

lukegb commented Oct 31, 2021

@ofborg test systemd-boot

@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 31, 2021
Some specialisations (such as those which affect various boot-time
attributes) cannot be switched to at runtime. This allows picking the
specialisation at boot time.
@Mic92
Copy link
Member

Mic92 commented Oct 31, 2021

Looks good to me except the comment above. I have not tested it yet.

@lukegb lukegb force-pushed the systemd-boot-specialisations branch from 4599f0a to 13fad0f Compare October 31, 2021 11:40
@lukegb
Copy link
Contributor Author

lukegb commented Oct 31, 2021

I think this probably needs a larger refactoring to swap what I named "SystemIdentifier" to a proper dataclass or something. But I think that's probably deserving of a separate change.

@Mic92 Mic92 merged commit 7469b8b into NixOS:master Oct 31, 2021
@Mic92
Copy link
Member

Mic92 commented Oct 31, 2021

I tested systemd-boot with and without specialisations. Both works for me.

@lukegb lukegb deleted the systemd-boot-specialisations branch December 5, 2022 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants