Skip to content

nixos/systemd-boot: update bootloader if needed#90386

Merged
flokli merged 3 commits intoNixOS:masterfrom
danielfullmer:systemd-bootctl-update
Jun 16, 2020
Merged

nixos/systemd-boot: update bootloader if needed#90386
flokli merged 3 commits intoNixOS:masterfrom
danielfullmer:systemd-bootctl-update

Conversation

@danielfullmer
Copy link
Copy Markdown
Contributor

Motivation for this change

Fixes #86422

Messing with people's existing bootloaders is always a little scary, so I'd appreciate a careful review.

Tested with

$ nix-build ./nixos/tests/systemd-boot.nix -A update
$ nix-build ./nixos/tests/installer.nix -A simpleUefiSystemdBoot

Also tested on my own physical machine.

CC @flokli @Mic92

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.

@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 Jun 14, 2020
@danielfullmer danielfullmer force-pushed the systemd-bootctl-update branch from 78ddb79 to 10a662f Compare June 14, 2020 18:36
@danielfullmer
Copy link
Copy Markdown
Contributor Author

Rebased and pushed. I initially forgot to actually include the default boot entry selection fix from @flokli in #86422

@flokli flokli requested review from Mic92, lheckemann and samueldr June 14, 2020 20:55
Copy link
Copy Markdown
Member

@flokli flokli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small nits, but apart from that, tested and LGTM.

danielfullmer and others added 3 commits June 15, 2020 20:22
systemd/systemd@6cd12eb
changed behaviour - now the "default" entry needs to identity an entry
with its full name, including the ".conf".

Reported-In: NixOS#86422
@danielfullmer danielfullmer force-pushed the systemd-bootctl-update branch from 10a662f to 42b9225 Compare June 16, 2020 00:22
@flokli
Copy link
Copy Markdown
Member

flokli commented Jun 16, 2020

Thanks!

else:
# Update bootloader to latest if needed
systemd_version = subprocess.check_output(["@systemd@/bin/bootctl", "--version"], universal_newlines=True).split()[1]
sdboot_status = subprocess.check_output(["@systemd@/bin/bootctl", "--path=@efiSysMountPoint@", "status"], universal_newlines=True)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line fails on my system, because of Boot into FW: not supported, which causes the entire command to fail, when then causes check_output to throw an exception. Is that the expected behavior in this case?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore this comment, I submitted an issue about this instead.

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.

systemd-boot: default boot entry ignored with systemd v245

3 participants