From 4a74a0208c3ab31e4e7d07367361aef2cf648b1a Mon Sep 17 00:00:00 2001 From: empunkt <102794+nevesenin@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:35:07 +0100 Subject: [PATCH] Determine partition number for root partition by PARTN column --- sd-image/sd-image.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd-image/sd-image.nix b/sd-image/sd-image.nix index 60eedfc..b9fed6a 100644 --- a/sd-image/sd-image.nix +++ b/sd-image/sd-image.nix @@ -248,7 +248,7 @@ in # Figure out device names for the boot device and root filesystem. rootPart=$(${pkgs.util-linux}/bin/findmnt -n -o SOURCE /) bootDevice=$(lsblk -npo PKNAME $rootPart) - partNum=$(lsblk -npo MAJ:MIN $rootPart | ${pkgs.gawk}/bin/awk -F: '{print $2}') + partNum=$(lsblk -npo PARTN $rootPart) # Resize the root partition and the filesystem to fit the disk echo ",+," | sfdisk -N$partNum --no-reread $bootDevice