aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/nixos/modules/installer/cd-dvd/sd-image.nix
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/nixos/modules/installer/cd-dvd/sd-image.nix')
-rw-r--r--infra/libkookie/nixpkgs/nixos/modules/installer/cd-dvd/sd-image.nix9
1 files changed, 5 insertions, 4 deletions
diff --git a/infra/libkookie/nixpkgs/nixos/modules/installer/cd-dvd/sd-image.nix b/infra/libkookie/nixpkgs/nixos/modules/installer/cd-dvd/sd-image.nix
index 231c7bf0a6c2..c8c5a46dfb87 100644
--- a/infra/libkookie/nixpkgs/nixos/modules/installer/cd-dvd/sd-image.nix
+++ b/infra/libkookie/nixpkgs/nixos/modules/installer/cd-dvd/sd-image.nix
@@ -147,10 +147,10 @@ in
sdImage.storePaths = [ config.system.build.toplevel ];
system.build.sdImage = pkgs.callPackage ({ stdenv, dosfstools, e2fsprogs,
- mtools, libfaketime, utillinux, zstd }: stdenv.mkDerivation {
+ mtools, libfaketime, util-linux, zstd }: stdenv.mkDerivation {
name = config.sdImage.imageName;
- nativeBuildInputs = [ dosfstools e2fsprogs mtools libfaketime utillinux zstd ];
+ nativeBuildInputs = [ dosfstools e2fsprogs mtools libfaketime util-linux zstd ];
inherit (config.sdImage) compressImage;
@@ -221,11 +221,12 @@ in
set -euo pipefail
set -x
# Figure out device names for the boot device and root filesystem.
- rootPart=$(${pkgs.utillinux}/bin/findmnt -n -o SOURCE /)
+ rootPart=$(${pkgs.util-linux}/bin/findmnt -n -o SOURCE /)
bootDevice=$(lsblk -npo PKNAME $rootPart)
+ partNum=$(lsblk -npo MAJ:MIN $rootPart | awk -F: '{print $2}')
# Resize the root partition and the filesystem to fit the disk
- echo ",+," | sfdisk -N2 --no-reread $bootDevice
+ echo ",+," | sfdisk -N$partNum --no-reread $bootDevice
${pkgs.parted}/bin/partprobe
${pkgs.e2fsprogs}/bin/resize2fs $rootPart