sdImage: use findmnt to get root device when resizing
This commit is contained in:
parent
5b00f65402
commit
bd7bcb5576
@ -144,8 +144,10 @@ in
|
|||||||
boot.postBootCommands = ''
|
boot.postBootCommands = ''
|
||||||
# On the first boot do some maintenance tasks
|
# On the first boot do some maintenance tasks
|
||||||
if [ -f /nix-path-registration ]; then
|
if [ -f /nix-path-registration ]; then
|
||||||
|
set -euo pipefail
|
||||||
|
set -x
|
||||||
# Figure out device names for the boot device and root filesystem.
|
# 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)
|
bootDevice=$(lsblk -npo PKNAME $rootPart)
|
||||||
|
|
||||||
# Resize the root partition and the filesystem to fit the disk
|
# Resize the root partition and the filesystem to fit the disk
|
||||||
|
Loading…
Reference in New Issue
Block a user