types mdadm: add metadata option

This commit is contained in:
lassulus 2022-10-01 19:03:42 +02:00
parent 527a945c64
commit fba7b03a21

View file

@ -892,6 +892,10 @@ rec {
type = types.int; type = types.int;
default = 1; default = 1;
}; };
metadata = mkOption {
type = types.enum [ "1" "1.0" "1.1" "1.2" "default" "ddf" "imsm" ];
default = "default";
};
content = diskoLib.deviceType; content = diskoLib.deviceType;
_meta = mkOption { _meta = mkOption {
internal = true; internal = true;
@ -908,6 +912,8 @@ rec {
echo 'y' | mdadm --create /dev/md/${config.name} \ echo 'y' | mdadm --create /dev/md/${config.name} \
--level=${toString config.level} \ --level=${toString config.level} \
--raid-devices=''${RAIDDEVICES_N_${config.name}} \ --raid-devices=''${RAIDDEVICES_N_${config.name}} \
--metadata=${config.metadata} \
--homehost=any \
''${RAIDDEVICES_${config.name}} ''${RAIDDEVICES_${config.name}}
udevadm trigger --subsystem-match=block; udevadm settle udevadm trigger --subsystem-match=block; udevadm settle
${optionalString (!isNull config.content) (config.content._create "/dev/md/${config.name}")} ${optionalString (!isNull config.content) (config.content._create "/dev/md/${config.name}")}