about summary refs log tree commit diff
path: root/nixos/modules/installer/cd-dvd/sd-image.nix
diff options
context:
space:
mode:
authorMichael Eden <themichaeleden@gmail.com>2019-03-20 22:13:03 -0400
committerMichael Eden <themichaeleden@gmail.com>2019-03-21 11:34:20 -0400
commitbd7bcb55767bf6060b595b40f26b76bbdb76fd80 (patch)
treeda85259d4a0be3422b05d474cccf7062d8945aed /nixos/modules/installer/cd-dvd/sd-image.nix
parent5b00f65402ff18295a3bbab5bd6f98699a7a5e9f (diff)
downloadnixlib-bd7bcb55767bf6060b595b40f26b76bbdb76fd80.tar
nixlib-bd7bcb55767bf6060b595b40f26b76bbdb76fd80.tar.gz
nixlib-bd7bcb55767bf6060b595b40f26b76bbdb76fd80.tar.bz2
nixlib-bd7bcb55767bf6060b595b40f26b76bbdb76fd80.tar.lz
nixlib-bd7bcb55767bf6060b595b40f26b76bbdb76fd80.tar.xz
nixlib-bd7bcb55767bf6060b595b40f26b76bbdb76fd80.tar.zst
nixlib-bd7bcb55767bf6060b595b40f26b76bbdb76fd80.zip
sdImage: use findmnt to get root device when resizing
Diffstat (limited to 'nixos/modules/installer/cd-dvd/sd-image.nix')
-rw-r--r--nixos/modules/installer/cd-dvd/sd-image.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/modules/installer/cd-dvd/sd-image.nix b/nixos/modules/installer/cd-dvd/sd-image.nix
index 69746a8e9799..6ac7c9489c81 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