Add options to build disk image function (#50239)
* add options to build disk image function * Revert suffix changes
This commit is contained in:
parent
a96ff61818
commit
a66ef3aa3d
@ -27,6 +27,9 @@
|
|||||||
, # The root file system type.
|
, # The root file system type.
|
||||||
fsType ? "ext4"
|
fsType ? "ext4"
|
||||||
|
|
||||||
|
, # Filesystem label
|
||||||
|
label ? "nixos"
|
||||||
|
|
||||||
, # The initial NixOS configuration file to be copied to
|
, # The initial NixOS configuration file to be copied to
|
||||||
# /etc/nixos/configuration.nix.
|
# /etc/nixos/configuration.nix.
|
||||||
configFile ? null
|
configFile ? null
|
||||||
@ -134,9 +137,9 @@ let format' = format; in let
|
|||||||
# Get start & length of the root partition in sectors to $START and $SECTORS.
|
# Get start & length of the root partition in sectors to $START and $SECTORS.
|
||||||
eval $(partx $diskImage -o START,SECTORS --nr ${rootPartition} --pairs)
|
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 ''
|
'' else ''
|
||||||
mkfs.${fsType} -F -L nixos $diskImage
|
mkfs.${fsType} -F -L ${label} $diskImage
|
||||||
''}
|
''}
|
||||||
|
|
||||||
root="$PWD/root"
|
root="$PWD/root"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user