aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2019-09-20 23:28:01 +0200
committerGitHub <noreply@github.com>2019-09-20 23:28:01 +0200
commitf47ef8fcf7d46f38166fd564a8759691a15eeab7 (patch)
tree53c6397998b84492595d58f6d095e5dbdb6a2e08 /nixos
parentd484f2b7fc0834a068e8ace851faa449a03963f5 (diff)
parentbd7bcb55767bf6060b595b40f26b76bbdb76fd80 (diff)
sdImage: use findmnt to get root device when resizing (#58059)
sdImage: use findmnt to get root device when resizing
Diffstat (limited to 'nixos')
-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 0a015044155..a2a8e8ef752 100644
--- a/nixos/modules/installer/cd-dvd/sd-image.nix
+++ b/nixos/modules/installer/cd-dvd/sd-image.nix
@@ -174,8 +174,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