From a66ef3aa3d6cbc900528f5163b3115576546ef56 Mon Sep 17 00:00:00 2001 From: Travis Athougies Date: Wed, 23 Jan 2019 15:47:55 -0800 Subject: Add options to build disk image function (#50239) * add options to build disk image function * Revert suffix changes --- nixos/lib/make-disk-image.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nixos/lib/make-disk-image.nix') diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix index 6fec322f90954..5e86ea479d518 100644 --- a/nixos/lib/make-disk-image.nix +++ b/nixos/lib/make-disk-image.nix @@ -27,6 +27,9 @@ , # The root file system type. fsType ? "ext4" +, # Filesystem label + label ? "nixos" + , # The initial NixOS configuration file to be copied to # /etc/nixos/configuration.nix. configFile ? null @@ -134,9 +137,9 @@ let format' = format; in let # Get start & length of the root partition in sectors to $START and $SECTORS. eval $(partx $diskImage -o START,SECTORS --nr ${rootPartition} --pairs) - mkfs.${fsType} -F -L nixos $diskImage -E offset=$(sectorsToBytes $START) $(sectorsToKilobytes $SECTORS)K + mkfs.${fsType} -F -L ${label} $diskImage -E offset=$(sectorsToBytes $START) $(sectorsToKilobytes $SECTORS)K '' else '' - mkfs.${fsType} -F -L nixos $diskImage + mkfs.${fsType} -F -L ${label} $diskImage ''} root="$PWD/root" -- cgit 1.4.1