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

NixOS installer tests: Add a test using Gummiboot #14957

Merged
merged 1 commit into from
May 5, 2016

Conversation

dezgeg
Copy link
Contributor

@dezgeg dezgeg commented Apr 24, 2016

Issue #14956. Note that unfortunately doesn't catch the bug in #14902 as that happens only with nix.package overridden.

@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @edolstra, @shlevy and @wkennington to be potential reviewers

@dezgeg dezgeg mentioned this pull request Apr 24, 2016
@shlevy
Copy link
Member

shlevy commented Apr 24, 2016

Have you run this test? I'm pretty sure our test framework doesn't boot with uefi mode enabled

@bobvanderlinden
Copy link
Member

@dezgeg Wow that was fast. Looks good, I'm giving it a try.
@shlevy Are you sure? This should force Qemu to boot with only UEFI support. The same is done for the ISO booting tests.

@dezgeg
Copy link
Contributor Author

dezgeg commented Apr 24, 2016

It does work for me, this is the part of the log after the first reboot: https://gist.github.com/dezgeg/5f82f3cbffdb1a94e9c121ff6b76f98d... though now I see the initial boot might not be booting in UEFI mode.

@bobvanderlinden
Copy link
Member

It's booting correctly here too. It indeed seems the installer itself somehow isn't booting with UEFI. I added:

virtualisation.useEFIBoot = mkIf (bootLoader == "gummiboot") true;

to the machine configuration, but it still doesn't seem to boot using EFI.

I was thinking ideally you'd want to use the ISO for booting the installer. That is a more real-life scenario and I know that supports EFI. However, since we already have the boot tests for the ISO, that functionality is already covered by those tests. So, ideally, but not that important.

That said, it's about the second boot. That certainly boots with EFI with this PR (I see EFI related output from the kernel), so this is better than what we had before. This combined with the ISO boot tests should cover most of what is needed for EFI installations.

I guess it doesn't hit the #14902 issue because it doesn't change the gummiboot configuration when it executes nixos-rebuild switch. Not sure if it's worth doing something about that.

Other than that, 👍

@dezgeg
Copy link
Contributor Author

dezgeg commented Apr 24, 2016

I guess it doesn't hit the #14902 issue because it doesn't change the gummiboot configuration when it executes nixos-rebuild switch.

No, it does not hit that because that requires nix.package to be set by the user. If I add this:

diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix
index c9aa9f9..515405a 100644
--- a/nixos/tests/installer.nix
+++ b/nixos/tests/installer.nix
@@ -35,6 +35,7 @@ let
         ''}

         hardware.enableAllFirmware = lib.mkForce false;
+        nix.package = pkgs.nixStable;

         ${replaceChars ["\n"] ["\n  "] extraConfig}
       }
@@ -211,6 +212,7 @@ let
                 pkgs.gummiboot
                 pkgs.perlPackages.XMLLibXML
                 pkgs.perlPackages.ListCompare
+                pkgs.nixStable
               ]
               ++ optional (bootLoader == "grub" && grubVersion == 1) pkgs.grub
               ++ optionals (bootLoader == "grub" && grubVersion == 2) [ pkgs.grub2 pkgs.grub2_efi ];

...then I do get the error in #14902:

machine# copying NixOS/Nixpkgs sources...
machine# 
machine# *** Copying ‘/nix/store/yzcyinv0zh62w9cw50gxzjfsdjv2qjvj-nixos-16.09pre-git’ from ‘/tmp/root/nix/store/yzcyinv0zh62w9cw50gxzjfsdjv2qjvj-nixos-16.09pre-git’
machine# 
machine# created 1 symlinks in user environment
machine# finalising the installation...
machine# Created /boot/EFI.
machine# Created /boot/EFI/gummiboot.
machine# Created /boot/EFI/Boot.
machine# Created /boot/loader.
machine# Created /boot/loader/entries.
machine# Copied /nix/store/23ymqlw874az7fm5qb1y0hf84hcjh4n3-gummiboot-48/lib/gummiboot/gummibootx64.efi to /boot/EFI/gummiboot/gummibootx64.efi.
machine# Copied /nix/store/23ymqlw874az7fm5qb1y0hf84hcjh4n3-gummiboot-48/lib/gummiboot/gummibootx64.efi to /boot/EFI/Boot/BOOTX64.EFI.
machine# Traceback (most recent call last):
machine#   File "/nix/store/mwlr2f6s9zwfi3gfq40aljnp3yv67bds-gummiboot-builder.py", line 112, in <module>
machine#     gens = get_generations("system")
machine#   File "/nix/store/mwlr2f6s9zwfi3gfq40aljnp3yv67bds-gummiboot-builder.py", line 67, in get_generations
machine#     "--option", "build-users-group", ""
machine#   File "/nix/store/8gv8s398yqbwfk01x29x1b5hhfq29s8k-python-2.7.11/lib/python2.7/subprocess.py", line 566, in check_output
machine#     process = Popen(stdout=PIPE, *popenargs, **kwargs)
machine#   File "/nix/store/8gv8s398yqbwfk01x29x1b5hhfq29s8k-python-2.7.11/lib/python2.7/subprocess.py", line 710, in __init__
machine#     errread, errwrite)
machine#   File "/nix/store/8gv8s398yqbwfk01x29x1b5hhfq29s8k-python-2.7.11/lib/python2.7/subprocess.py", line 1335, in _execute_child
machine#     raise child_exception
machine# OSError: [Errno 2] No such file or directory
machine: exit status 1
machine: output: 
error: command `nixos-install < /dev/null >&2' did not succeed (exit code 1)
command `nixos-install < /dev/null >&2' did not succeed (exit code 1)
cleaning up

@domenkozar
Copy link
Member

You all rock - keep this one pushing as booting the the most critical part of OS.

@bobvanderlinden
Copy link
Member

Ah sorry, indeed. Should something similar be incorporated into this PR as
well?

On Mon, Apr 25, 2016, 08:28 Domen Kožar [email protected] wrote:

You all rock - keep this one pushing as booting the the most critical part
of OS.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#14957 (comment)

@shlevy
Copy link
Member

shlevy commented Apr 25, 2016

Ah, missed the OMVF line, cool

@zimbatm zimbatm merged commit f076f36 into NixOS:master May 5, 2016
@zimbatm
Copy link
Member

zimbatm commented May 5, 2016

Merging as it's already an improvement. Further refinements can be done in further PRs.

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

Successfully merging this pull request may close these issues.

6 participants