nixpkgs/nixos/tests/installer.nix

553 lines
19 KiB
Nix
Raw Normal View History

{ system ? builtins.currentSystem }:
with import ../lib/testing.nix { inherit system; };
with import ../lib/qemu-flags.nix;
with pkgs.lib;
let
# Build the ISO. This is the regular minimal installation CD but
# with test instrumentation.
iso =
(import ../lib/eval-config.nix {
inherit system;
modules =
[ ../modules/installer/cd-dvd/installation-cd-minimal.nix
../modules/testing/test-instrumentation.nix
{ key = "serial";
boot.loader.grub.timeout = mkOverride 0 0;
# The test cannot access the network, so any sources we
# need must be included in the ISO.
isoImage.storeContents =
[ pkgs.glibcLocales
pkgs.sudo
pkgs.docbook5
pkgs.docbook5_xsl
pkgs.unionfs-fuse
# Bootloader support
pkgs.grub
pkgs.grub2
pkgs.grub2_efi
pkgs.gummiboot
pkgs.perlPackages.XMLLibXML
pkgs.perlPackages.ListCompare
];
2014-12-09 13:27:00 +01:00
# Don't use https://cache.nixos.org since the fake
# cache.nixos.org doesn't do https.
nix.binaryCaches = [ http://cache.nixos.org/ ];
}
];
}).config.system.build.isoImage;
# The configuration to install.
makeConfig = { testChannel, grubVersion, grubDevice, grubIdentifier
, extraConfig, readOnly ? true, forceGrubReinstallCount ? 0
}:
pkgs.writeText "configuration.nix" ''
2014-12-05 18:19:27 +01:00
{ config, lib, pkgs, modulesPath, ... }:
{ imports =
[ ./hardware-configuration.nix
<nixpkgs/nixos/modules/testing/test-instrumentation.nix>
<nixpkgs/nixos/modules/profiles/minimal.nix>
];
boot.loader.grub.version = ${toString grubVersion};
${optionalString (grubVersion == 1) ''
boot.loader.grub.splashImage = null;
''}
boot.loader.grub.device = "${grubDevice}";
boot.loader.grub.extraConfig = "serial; terminal_output.serial";
boot.loader.grub.fsIdentifier = "${grubIdentifier}";
boot.loader.grub.configurationLimit = 100 + ${toString forceGrubReinstallCount};
${optionalString (!readOnly) "nix.readOnlyStore = false;"}
environment.systemPackages = [ ${optionalString testChannel "pkgs.rlwrap"} ];
2014-12-09 13:27:00 +01:00
nix.binaryCaches = [ http://cache.nixos.org/ ];
${replaceChars ["\n"] ["\n "] extraConfig}
}
'';
# Configuration of a web server that simulates the Nixpkgs channel
# distribution server.
webserver =
2014-12-05 18:19:27 +01:00
{ config, lib, pkgs, ... }:
{ services.httpd.enable = true;
services.httpd.adminAddr = "foo@example.org";
services.httpd.servedDirs = singleton
2013-06-14 14:04:17 +02:00
{ urlPath = "/";
dir = "/tmp/channel";
};
virtualisation.writableStore = true;
virtualisation.pathsInNixDB = channelContents ++ [ pkgs.hello.src ];
virtualisation.memorySize = 768;
networking.firewall.allowedTCPPorts = [ 80 ];
};
channelContents = [ pkgs.rlwrap ];
efiBios = pkgs.runCommand "ovmf-bios" {} ''
mkdir $out
ln -s ${pkgs.OVMF}/FV/OVMF.fd $out/bios.bin
'';
# The test script boots the CD, installs NixOS on an empty hard
# disk, and then reboot from the hard disk. It's parameterized with
# a test script fragment `createPartitions', which must create
# partitions and filesystems.
testScriptFun = { createPartitions, testChannel, grubVersion, grubDevice
, grubIdentifier, preBootCommands, extraConfig
}:
let
# FIXME: OVMF doesn't boot from virtio http://www.mail-archive.com/edk2-devel@lists.sourceforge.net/msg01501.html
iface = if grubVersion == 1 then "scsi" else "virtio";
qemuFlags =
(if iso.system == "x86_64-linux" then "-m 768 " else "-m 512 ") +
2014-10-07 21:02:18 +02:00
(optionalString (iso.system == "x86_64-linux") "-cpu kvm64 ");
hdFlags =''hda => "harddisk", hdaInterface => "${iface}", '';
in
''
createDisk("harddisk", 4 * 1024);
my $machine = createMachine({ ${hdFlags}
cdrom => glob("${iso}/iso/*.iso"),
qemuFlags => "${qemuFlags} " . '${optionalString testChannel (toString (qemuNICFlags 1 1 2))}' });
$machine->start;
${optionalString testChannel ''
# Create a channel on the web server containing a few packages
# to simulate the Nixpkgs channel.
$webserver->start;
$webserver->waitForUnit("httpd");
$webserver->succeed(
"nix-push --bzip2 --dest /tmp/channel --manifest --url-prefix http://nixos.org/channels/nixos-unstable " .
"${toString channelContents} >&2");
$webserver->succeed("mkdir /tmp/channel/sha256");
$webserver->succeed("cp ${pkgs.hello.src} /tmp/channel/sha256/${pkgs.hello.src.outputHash}");
''}
# Make sure that we get a login prompt etc.
$machine->succeed("echo hello");
#$machine->waitForUnit('getty@tty2');
$machine->waitForUnit("rogue");
$machine->waitForUnit("nixos-manual");
${optionalString testChannel ''
$machine->waitForUnit("dhcpcd");
# Allow the machine to talk to the fake nixos.org.
$machine->succeed(
"rm /etc/hosts",
"echo 192.168.1.1 nixos.org cache.nixos.org tarballs.nixos.org > /etc/hosts",
"ifconfig eth1 up 192.168.1.2",
);
# Test nix-env.
$machine->fail("hello");
$machine->succeed("nix-env -i hello");
$machine->succeed("hello") =~ /Hello, world/
or die "bad `hello' output";
''}
# Wait for hard disks to appear in /dev
$machine->succeed("udevadm settle");
# Partition the disk.
${createPartitions}
# Create the NixOS configuration.
$machine->succeed(
"nixos-generate-config --root /mnt",
);
$machine->succeed("cat /mnt/etc/nixos/hardware-configuration.nix >&2");
$machine->copyFileFromHost(
"${ makeConfig { inherit testChannel grubVersion grubDevice grubIdentifier extraConfig; } }",
"/mnt/etc/nixos/configuration.nix");
# Perform the installation.
$machine->succeed("nixos-install < /dev/null >&2");
# Do it again to make sure it's idempotent.
$machine->succeed("nixos-install < /dev/null >&2");
$machine->succeed("umount /mnt/boot || true");
$machine->succeed("umount /mnt");
$machine->succeed("sync");
$machine->shutdown;
# Now see if we can boot the installation.
2014-05-21 15:20:37 +02:00
$machine = createMachine({ ${hdFlags} qemuFlags => "${qemuFlags}" });
# For example to enter LUKS passphrase
${preBootCommands}
# Did /boot get mounted?
2012-10-24 12:58:58 +02:00
$machine->waitForUnit("local-fs.target");
$machine->succeed("test -e /boot/grub");
2015-01-15 18:36:38 +01:00
# Check whether /root has correct permissions.
$machine->succeed("stat -c '%a' /root") =~ /700/ or die;
# Did the swap device get activated?
# uncomment once https://bugs.freedesktop.org/show_bug.cgi?id=86930 is resolved
#$machine->waitForUnit("swap.target");
$machine->waitUntilSucceeds("cat /proc/swaps | grep -q /dev");
# Check whether the channel works.
$machine->succeed("nix-env -i coreutils >&2");
$machine->succeed("type -tP ls | tee /dev/stderr") =~ /.nix-profile/
or die "nix-env failed";
# We need to a writable nix-store on next boot
$machine->copyFileFromHost(
"${ makeConfig { inherit testChannel grubVersion grubDevice grubIdentifier extraConfig; readOnly = false; forceGrubReinstallCount = 1; } }",
"/etc/nixos/configuration.nix");
# Check whether nixos-rebuild works.
$machine->succeed("nixos-rebuild switch >&2");
2013-10-13 22:36:04 +02:00
# Test nixos-option.
$machine->succeed("nixos-option boot.initrd.kernelModules | grep virtio_console");
$machine->succeed("nixos-option boot.initrd.kernelModules | grep 'List of modules'");
$machine->succeed("nixos-option boot.initrd.kernelModules | grep qemu-guest.nix");
2013-10-13 22:36:04 +02:00
$machine->shutdown;
# Check whether a writable store build works
$machine = createMachine({ ${hdFlags} qemuFlags => "${qemuFlags}" });
${preBootCommands}
$machine->waitForUnit("multi-user.target");
$machine->copyFileFromHost(
"${ makeConfig { inherit testChannel grubVersion grubDevice grubIdentifier extraConfig; readOnly = false; forceGrubReinstallCount = 2; } }",
"/etc/nixos/configuration.nix");
$machine->succeed("nixos-rebuild boot >&2");
$machine->shutdown;
# And just to be sure, check that the machine still boots after
# "nixos-rebuild switch".
2014-05-21 15:20:37 +02:00
$machine = createMachine({ ${hdFlags} qemuFlags => "${qemuFlags}" });
${preBootCommands}
$machine->waitForUnit("network.target");
$machine->shutdown;
'';
2014-06-28 16:04:49 +02:00
makeInstallerTest = name:
{ createPartitions, preBootCommands ? "", extraConfig ? ""
, testChannel ? false, grubVersion ? 2, grubDevice ? "/dev/vda"
, grubIdentifier ? "uuid"
}:
2014-04-14 16:24:08 +02:00
makeTest {
inherit iso;
2014-06-28 16:04:49 +02:00
name = "installer-" + name;
nodes = if testChannel then { inherit webserver; } else { };
testScript = testScriptFun {
inherit createPartitions preBootCommands testChannel grubVersion
grubDevice grubIdentifier extraConfig;
};
2014-04-14 16:24:08 +02:00
};
in {
# !!! `parted mkpart' seems to silently create overlapping partitions.
# The (almost) simplest partitioning scheme: a swap partition and
# one big filesystem partition.
2014-06-28 16:04:49 +02:00
simple = makeInstallerTest "simple"
{ createPartitions =
''
$machine->succeed(
"parted /dev/vda mklabel msdos",
"parted /dev/vda -- mkpart primary linux-swap 1M 1024M",
"parted /dev/vda -- mkpart primary ext2 1024M -1s",
"udevadm settle",
"mkswap /dev/vda1 -L swap",
"swapon -L swap",
"mkfs.ext3 -L nixos /dev/vda2",
"mount LABEL=nixos /mnt",
);
'';
testChannel = true;
};
# Same as the previous, but now with a separate /boot partition.
2014-06-28 16:04:49 +02:00
separateBoot = makeInstallerTest "separateBoot"
{ createPartitions =
''
$machine->succeed(
"parted /dev/vda mklabel msdos",
"parted /dev/vda -- mkpart primary ext2 1M 50MB", # /boot
"parted /dev/vda -- mkpart primary linux-swap 50MB 1024M",
"parted /dev/vda -- mkpart primary ext2 1024M -1s", # /
"udevadm settle",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
"mkfs.ext3 -L nixos /dev/vda3",
"mount LABEL=nixos /mnt",
"mkfs.ext3 -L boot /dev/vda1",
"mkdir -p /mnt/boot",
"mount LABEL=boot /mnt/boot",
);
'';
};
# Create two physical LVM partitions combined into one volume group
# that contains the logical swap and root partitions.
2014-06-28 16:04:49 +02:00
lvm = makeInstallerTest "lvm"
{ createPartitions =
''
$machine->succeed(
"parted /dev/vda mklabel msdos",
2014-02-09 17:59:02 +01:00
"parted /dev/vda -- mkpart primary 1M 2048M", # PV1
"parted /dev/vda -- set 1 lvm on",
2014-02-09 17:59:02 +01:00
"parted /dev/vda -- mkpart primary 2048M -1s", # PV2
"parted /dev/vda -- set 2 lvm on",
"udevadm settle",
"pvcreate /dev/vda1 /dev/vda2",
"vgcreate MyVolGroup /dev/vda1 /dev/vda2",
"lvcreate --size 1G --name swap MyVolGroup",
"lvcreate --size 2G --name nixos MyVolGroup",
"mkswap -f /dev/MyVolGroup/swap -L swap",
"swapon -L swap",
"mkfs.xfs -L nixos /dev/MyVolGroup/nixos",
"mount LABEL=nixos /mnt",
);
'';
};
nixos/tests/installer: Add test for LUKS rootfs. This serves as a regression test for #7859. It's pretty straightforward, except from the fact that nixos-generate- config doesn't detect LUKS devices and the "sleep 60". As for the former, I have tried to add support for LUKS devices for nixos-generate-config, but it's not so easy as it sounds, because we need to create a device tree across all possible mappers and/or LVM up to the "real" device and then decide whether it is relevant to what is currently mounted. So I guess this is something for the nixpart branch (see #2079). And the latter isn't very trivial as well, because the LUKS passphrase prompt is issued on /dev/console, which is the last "console=..." kernel parameter (thus the `mkAfter`). So we can't simply grep the log, because the prompt ends up being on one terminal only (tty0) and using select() on $machine->{socket} doesn't work very well, because the FD is always "ready for read". If we would read the FD, we would conflict with $machine->connect and end up having an inconsistent state. Another idea would be to use multithreading to do $machine->connect while feeding the passphrase prompt in a loop and stop the thread once $machine->connect is done. Turns out that this is not so easy as well, because the threads need to share the $machine object and of course need to do properly locking. In the end I decided to use the "blindly hope that 60 seconds is enough" approach for now and come up with a better solution later. Other VM tests surely use sleep as well, but it's $machine->sleep, which is bound to the clock of the VM, so if the build machine is on high load, a $machine->sleep gets properly delayed but the timer outside the VM won't get that delay, so the test is not deterministic. Tested against the following revisions: 5e3fe39: Before the libgcrypt cleanup (a71f78a) that broke cryptsetup. 69a6848: While cryptsetup was broken (obviously the test failed). 15faa43: After cryptsetup has been switched to OpenSSL (fd588f9). Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-05-21 12:42:00 +02:00
# Boot off an encrypted root partition
luksroot = makeInstallerTest "luksroot"
{ createPartitions = ''
$machine->succeed(
"parted /dev/vda mklabel msdos",
"parted /dev/vda -- mkpart primary ext2 1M 50MB", # /boot
"parted /dev/vda -- mkpart primary linux-swap 50M 1024M",
"parted /dev/vda -- mkpart primary 1024M -1s", # LUKS
"udevadm settle",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
"modprobe dm_mod dm_crypt",
"echo -n supersecret | cryptsetup luksFormat -q /dev/vda3 -",
"echo -n supersecret | cryptsetup luksOpen --key-file - /dev/vda3 cryptroot",
"mkfs.ext3 -L nixos /dev/mapper/cryptroot",
"mount LABEL=nixos /mnt",
"mkfs.ext3 -L boot /dev/vda1",
"mkdir -p /mnt/boot",
"mount LABEL=boot /mnt/boot",
);
'';
# XXX: Currently, generate-config doesn't detect LUKS yet.
extraConfig = ''
boot.kernelParams = lib.mkAfter [ "console=tty0" ];
boot.initrd.luks.devices = lib.singleton {
name = "cryptroot";
device = "/dev/vda3";
preLVM = true;
};
'';
preBootCommands = ''
$machine->start;
$machine->waitForText(qr/Enter passphrase/);
nixos/tests/installer: Add test for LUKS rootfs. This serves as a regression test for #7859. It's pretty straightforward, except from the fact that nixos-generate- config doesn't detect LUKS devices and the "sleep 60". As for the former, I have tried to add support for LUKS devices for nixos-generate-config, but it's not so easy as it sounds, because we need to create a device tree across all possible mappers and/or LVM up to the "real" device and then decide whether it is relevant to what is currently mounted. So I guess this is something for the nixpart branch (see #2079). And the latter isn't very trivial as well, because the LUKS passphrase prompt is issued on /dev/console, which is the last "console=..." kernel parameter (thus the `mkAfter`). So we can't simply grep the log, because the prompt ends up being on one terminal only (tty0) and using select() on $machine->{socket} doesn't work very well, because the FD is always "ready for read". If we would read the FD, we would conflict with $machine->connect and end up having an inconsistent state. Another idea would be to use multithreading to do $machine->connect while feeding the passphrase prompt in a loop and stop the thread once $machine->connect is done. Turns out that this is not so easy as well, because the threads need to share the $machine object and of course need to do properly locking. In the end I decided to use the "blindly hope that 60 seconds is enough" approach for now and come up with a better solution later. Other VM tests surely use sleep as well, but it's $machine->sleep, which is bound to the clock of the VM, so if the build machine is on high load, a $machine->sleep gets properly delayed but the timer outside the VM won't get that delay, so the test is not deterministic. Tested against the following revisions: 5e3fe39: Before the libgcrypt cleanup (a71f78a) that broke cryptsetup. 69a6848: While cryptsetup was broken (obviously the test failed). 15faa43: After cryptsetup has been switched to OpenSSL (fd588f9). Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-05-21 12:42:00 +02:00
$machine->sendChars("supersecret\n");
'';
};
2014-06-28 16:04:49 +02:00
swraid = makeInstallerTest "swraid"
{ createPartitions =
''
$machine->succeed(
"parted /dev/vda --"
. " mklabel msdos"
. " mkpart primary ext2 1M 100MB" # /boot
. " mkpart extended 100M -1s"
. " mkpart logical 102M 1602M" # md0 (root), first device
. " mkpart logical 1603M 3103M" # md0 (root), second device
. " mkpart logical 3104M 3360M" # md1 (swap), first device
. " mkpart logical 3361M 3617M", # md1 (swap), second device
"udevadm settle",
"ls -l /dev/vda* >&2",
"cat /proc/partitions >&2",
"mdadm --create --force /dev/md0 --metadata 1.2 --level=raid1 --raid-devices=2 /dev/vda5 /dev/vda6",
"mdadm --create --force /dev/md1 --metadata 1.2 --level=raid1 --raid-devices=2 /dev/vda7 /dev/vda8",
"udevadm settle",
"mkswap -f /dev/md1 -L swap",
"swapon -L swap",
"mkfs.ext3 -L nixos /dev/md0",
"mount LABEL=nixos /mnt",
"mkfs.ext3 -L boot /dev/vda1",
"mkdir /mnt/boot",
"mount LABEL=boot /mnt/boot",
"udevadm settle",
"mdadm -W /dev/md0", # wait for sync to finish; booting off an unsynced device tends to fail
"mdadm -W /dev/md1",
);
'';
};
# Test a basic install using GRUB 1.
2014-06-28 16:04:49 +02:00
grub1 = makeInstallerTest "grub1"
{ createPartitions =
''
$machine->succeed(
"parted /dev/sda mklabel msdos",
"parted /dev/sda -- mkpart primary linux-swap 1M 1024M",
"parted /dev/sda -- mkpart primary ext2 1024M -1s",
"udevadm settle",
"mkswap /dev/sda1 -L swap",
"swapon -L swap",
"mkfs.ext3 -L nixos /dev/sda2",
"mount LABEL=nixos /mnt",
);
'';
grubVersion = 1;
grubDevice = "/dev/sda";
};
# Rebuild the CD configuration with a little modification.
2014-04-14 16:24:08 +02:00
rebuildCD = makeTest
{ inherit iso;
2014-07-01 16:28:23 +02:00
name = "rebuild-cd";
nodes = { };
testScript =
''
my $machine = createMachine({ cdrom => glob("${iso}/iso/*.iso"), qemuFlags => '-m 768' });
$machine->start;
# Enable sshd service.
$machine->succeed(
"sed -i 's,^}\$,systemd.services.sshd.wantedBy = pkgs.lib.mkOverride 0 [\"multi-user.target\"]; },' /etc/nixos/configuration.nix"
);
$machine->succeed("cat /etc/nixos/configuration.nix >&2");
# Apply the new CD configuration.
$machine->succeed("nixos-rebuild test");
# Connect to it-self.
$machine->waitForUnit("sshd");
$machine->waitForOpenPort(22);
$machine->shutdown;
'';
2014-04-14 16:24:08 +02:00
};
# Test using labels to identify volumes in grub
2014-08-29 11:48:00 +02:00
simpleLabels = makeInstallerTest "simpleLabels" {
createPartitions = ''
$machine->succeed(
"sgdisk -Z /dev/vda",
"sgdisk -n 1:0:+1M -n 2:0:+1G -N 3 -t 1:ef02 -t 2:8200 -t 3:8300 -c 3:root /dev/vda",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
2014-05-02 07:25:38 +02:00
"mkfs.ext4 -L root /dev/vda3",
"mount LABEL=root /mnt",
);
'';
grubIdentifier = "label";
};
# Test using the provided disk name within grub
# TODO: Fix udev so the symlinks are unneeded in /dev/disks
2014-08-29 11:48:00 +02:00
simpleProvided = makeInstallerTest "simpleProvided" {
createPartitions = ''
my $UUID = "\$(blkid -s UUID -o value /dev/vda2)";
$machine->succeed(
"sgdisk -Z /dev/vda",
"sgdisk -n 1:0:+1M -n 2:0:+100M -n 3:0:+1G -N 4 -t 1:ef02 -t 2:8300 -t 3:8200 -t 4:8300 -c 2:boot -c 4:root /dev/vda",
"mkswap /dev/vda3 -L swap",
"swapon -L swap",
"mkfs.ext4 -L boot /dev/vda2",
"mkfs.ext4 -L root /dev/vda4",
);
$machine->execute("ln -s ../../vda2 /dev/disk/by-uuid/$UUID");
$machine->execute("ln -s ../../vda4 /dev/disk/by-label/root");
$machine->succeed(
"mount /dev/disk/by-label/root /mnt",
"mkdir /mnt/boot",
"mount /dev/disk/by-uuid/$UUID /mnt/boot"
);
'';
grubIdentifier = "provided";
};
# Simple btrfs grub testing
2014-08-29 11:48:00 +02:00
btrfsSimple = makeInstallerTest "btrfsSimple" {
createPartitions = ''
$machine->succeed(
"sgdisk -Z /dev/vda",
"sgdisk -n 1:0:+1M -n 2:0:+1G -N 3 -t 1:ef02 -t 2:8200 -t 3:8300 -c 3:root /dev/vda",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
"mkfs.btrfs -L root /dev/vda3",
"mount LABEL=root /mnt",
);
'';
};
# Test to see if we can detect /boot and /nix on subvolumes
2014-08-29 11:48:00 +02:00
btrfsSubvols = makeInstallerTest "btrfsSubvols" {
createPartitions = ''
$machine->succeed(
"sgdisk -Z /dev/vda",
"sgdisk -n 1:0:+1M -n 2:0:+1G -N 3 -t 1:ef02 -t 2:8200 -t 3:8300 -c 3:root /dev/vda",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
"mkfs.btrfs -L root /dev/vda3",
"btrfs device scan",
"mount LABEL=root /mnt",
"btrfs subvol create /mnt/boot",
"btrfs subvol create /mnt/nixos",
"btrfs subvol create /mnt/nixos/default",
"umount /mnt",
"mount -o defaults,subvol=nixos/default LABEL=root /mnt",
"mkdir /mnt/boot",
"mount -o defaults,subvol=boot LABEL=root /mnt/boot",
);
'';
};
# Test to see if we can detect default and aux subvolumes correctly
btrfsSubvolDefault = makeInstallerTest "btrfsSubvolDefault" {
createPartitions = ''
$machine->succeed(
"sgdisk -Z /dev/vda",
"sgdisk -n 1:0:+1M -n 2:0:+1G -N 3 -t 1:ef02 -t 2:8200 -t 3:8300 -c 3:root /dev/vda",
"mkswap /dev/vda2 -L swap",
"swapon -L swap",
"mkfs.btrfs -L root /dev/vda3",
"btrfs device scan",
"mount LABEL=root /mnt",
"btrfs subvol create /mnt/badpath",
"btrfs subvol create /mnt/badpath/boot",
"btrfs subvol create /mnt/nixos",
"btrfs subvol set-default \$(btrfs subvol list /mnt | grep 'nixos' | awk '{print \$2}') /mnt",
"umount /mnt",
"mount -o defaults LABEL=root /mnt",
"mkdir -p /mnt/badpath/boot", # Help ensure the detection mechanism is actually looking up subvolumes
"mkdir /mnt/boot",
"mount -o defaults,subvol=badpath/boot LABEL=root /mnt/boot",
);
'';
};
}