Add options to build disk image function (#50239)

* add options to build disk image function

* Revert suffix changes
wip/yesman
Travis Athougies 5 years ago committed by Danylo Hlynskyi
parent a96ff61818
commit a66ef3aa3d
  1. 7
      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"

Loading…
Cancel
Save