From bd7bcb55767bf6060b595b40f26b76bbdb76fd80 Mon Sep 17 00:00:00 2001 From: Michael Eden Date: Wed, 20 Mar 2019 22:13:03 -0400 Subject: [PATCH] sdImage: use findmnt to get root device when resizing --- nixos/modules/installer/cd-dvd/sd-image.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/installer/cd-dvd/sd-image.nix b/nixos/modules/installer/cd-dvd/sd-image.nix index 69746a8e9799e..6ac7c9489c81d 100644 --- a/nixos/modules/installer/cd-dvd/sd-image.nix +++ b/nixos/modules/installer/cd-dvd/sd-image.nix @@ -144,8 +144,10 @@ in boot.postBootCommands = '' # On the first boot do some maintenance tasks if [ -f /nix-path-registration ]; then + set -euo pipefail + set -x # Figure out device names for the boot device and root filesystem. - rootPart=$(readlink -f /dev/disk/by-label/NIXOS_SD) + rootPart=$(${pkgs.utillinux}/bin/findmnt -n -o SOURCE /) bootDevice=$(lsblk -npo PKNAME $rootPart) # Resize the root partition and the filesystem to fit the disk