Skip to content
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

EFI improvements for qemu-vm.nix #90280

Merged
merged 8 commits into from Jul 6, 2020

Conversation

danielfullmer
Copy link
Contributor

Motivation for this change

The most user-visible change is that this adds support for nixos-rebuild build-vm-with-bootloader on aarch64-linux.

Take a look at these commits in order so they make more sense. They were unfortunately not independently separable into multiple PRs, as the later commits depend on the earlier ones.

These changes also help set the foundation for testing secure boot with systemd-boot properly: #53901 (comment)

I've done the following to test, both on x86_64-linux and aarch64-linux:

$ nix-build ./nixos/tests/systemd-boot.nix

as well as:

$ nix-build ./nixos -A vmWithBootLoader -I nixos-config=./test.nix
$ ./result/bin/run-nixos-vm -nographic -serial stdio -monitor none

where test.nix is:

{
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  virtualisation.useEFIBoot = true;
}

CC @samueldr @lheckemann @flokli

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.

Copy link
Member

@lheckemann lheckemann left a comment

Choose a reason for hiding this comment

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

Mostly LGTM, just a few small things :)

nixos/tests/systemd-boot.nix Show resolved Hide resolved
nixos/modules/virtualisation/qemu-vm.nix Show resolved Hide resolved
nixos/modules/virtualisation/qemu-vm.nix Outdated Show resolved Hide resolved
nixos/tests/all-tests.nix Outdated Show resolved Hide resolved
nixos/modules/virtualisation/qemu-vm.nix Outdated Show resolved Hide resolved
@flokli
Copy link
Contributor

flokli commented Jul 6, 2020

This doesn't cleanly apply anymore. @danielfullmer, can you take a look?

@danielfullmer
Copy link
Contributor Author

@flokli Rebased against master and verified the systemd-boot tests still work.

@flokli
Copy link
Contributor

flokli commented Jul 6, 2020

This has undergone quite some review and LGTM. Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants