From 6ef5e0e5b36878a51db07b896c1adad562aeb3e5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 18 Apr 2012 16:08:25 +0000 Subject: [PATCH] * Fix the GRUB 1 installer test. Note that GRUB 1 doesn't automatically detect /dev/vd* devices, so users have to fix /boot/grub/device.map manually. svn path=/nixos/trunk/; revision=33832 --- tests/installer.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/installer.nix b/tests/installer.nix index 8d7e1a93794..e70a412e35a 100644 --- a/tests/installer.nix +++ b/tests/installer.nix @@ -152,11 +152,15 @@ let "${ config { inherit fileSystems testChannel grubVersion; } }", "/mnt/etc/nixos/configuration.nix"); + # Hack to get GRUB 1 to install on virtio. GRUB 1 has a patch + # from Gentoo to support virtio, but it's incomplete: it doesn't + # detect /dev/vd* automatically. And we don't care enough about + # GRUB 1 to fix it. + $machine->mustSucceed("mkdir -p /mnt/boot/grub; echo '(hd0) /dev/vda' > /mnt/boot/grub/device.map"); + # Perform the installation. $machine->mustSucceed("nixos-install >&2"); - $machine->mustSucceed("cat /mnt/boot/grub/grub.cfg >&2"); - $machine->shutdown; # Now see if we can boot the installation. @@ -165,20 +169,18 @@ let # Did /boot get mounted, if appropriate? # !!! There is currently no good way to wait for the # `filesystems' task to finish. - $machine->waitForFile("/boot/grub/grub.cfg"); + $machine->waitForFile("/boot/grub"); # Did the swap device get activated? # !!! Idem. $machine->waitUntilSucceeds("cat /proc/swaps | grep -q /dev"); - $machine->mustSucceed("nix-env -i coreutils >&2"); + $machine->mustSucceed("nix-env -f /etc/nixos/nixpkgs -i coreutils >&2"); $machine->mustSucceed("type -tP ls | tee /dev/stderr") =~ /.nix-profile/ or die "nix-env failed"; $machine->mustSucceed("nixos-rebuild switch >&2"); - $machine->mustSucceed("cat /boot/grub/grub.cfg >&2"); - $machine->shutdown; # And just to be sure, check that the machine still boots after