From b08400a4d2b81e0e680ce08f502c2d2b1c43367f Mon Sep 17 00:00:00 2001 From: Venkateswara Rao Mandela Date: Thu, 7 Mar 2019 15:06:40 +0530 Subject: [PATCH] nixos/tests: installer: restructure simpleUefiGrub test data --- nixos/tests/installer.nix | 45 ++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index 2db9d283f2b..36206b199e7 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -321,6 +321,28 @@ let ''; }; + simple-uefi-grub-config = + { createPartitions = + '' + $machine->succeed( + "flock /dev/vda parted --script /dev/vda -- mklabel gpt" + . " mkpart ESP fat32 1M 50MiB" # /boot + . " set 1 boot on" + . " mkpart primary linux-swap 50MiB 1024MiB" + . " mkpart primary ext2 1024MiB -1MiB", # / + "udevadm settle", + "mkswap /dev/vda2 -L swap", + "swapon -L swap", + "mkfs.ext3 -L nixos /dev/vda3", + "mount LABEL=nixos /mnt", + "mkfs.vfat -n BOOT /dev/vda1", + "mkdir -p /mnt/boot", + "mount LABEL=BOOT /mnt/boot", + ); + ''; + bootLoader = "grub"; + grubUseEfi = true; + }; in { # !!! `parted mkpart' seems to silently create overlapping partitions. @@ -353,28 +375,7 @@ in { bootLoader = "systemd-boot"; }; - simpleUefiGrub = makeInstallerTest "simpleUefiGrub" - { createPartitions = - '' - $machine->succeed( - "flock /dev/vda parted --script /dev/vda -- mklabel gpt" - . " mkpart ESP fat32 1M 50MiB" # /boot - . " set 1 boot on" - . " mkpart primary linux-swap 50MiB 1024MiB" - . " mkpart primary ext2 1024MiB -1MiB", # / - "udevadm settle", - "mkswap /dev/vda2 -L swap", - "swapon -L swap", - "mkfs.ext3 -L nixos /dev/vda3", - "mount LABEL=nixos /mnt", - "mkfs.vfat -n BOOT /dev/vda1", - "mkdir -p /mnt/boot", - "mount LABEL=BOOT /mnt/boot", - ); - ''; - bootLoader = "grub"; - grubUseEfi = true; - }; + simpleUefiGrub = makeInstallerTest "simpleUefiGrub" simple-uefi-grub-config; # Same as the previous, but now with a separate /boot partition. separateBoot = makeInstallerTest "separateBoot"