fix: avoid external probing effects from other devices

This commit is contained in:
David Arnold 2023-09-15 21:29:34 +02:00 committed by mergify[bot]
parent 8aa6ec5ff2
commit 0faae8adf6
4 changed files with 5 additions and 5 deletions

View File

@ -107,7 +107,7 @@ in
--typecode=${toString partition._index}:${partition.type} \
${config.device}
# ensure /dev/disk/by-path/..-partN exists before continuing
partprobe
partprobe ${config.device}
udevadm trigger --subsystem-match=block
udevadm settle
${lib.optionalString (partition.content != null) partition.content._create}

View File

@ -42,7 +42,7 @@
--force \
--homehost=any \
"''${disk_devices[@]}"
partprobe
partprobe /dev/md/${config.name}
udevadm trigger --subsystem-match=block
udevadm settle
# for some reason mdadm devices spawn with an existing partition table, so we need to wipe it

View File

@ -91,7 +91,7 @@
parted -s ${config.device} -- mkpart ${partition.part-type} ${diskoLib.maybeStr partition.fs-type} ${partition.start} ${partition.end}
''}
# ensure /dev/disk/by-path/..-partN exists before continuing
partprobe
partprobe ${config.device}
udevadm trigger --subsystem-match=block
udevadm settle
${lib.optionalString partition.bootable ''
@ -101,7 +101,7 @@
parted -s ${config.device} -- set ${toString partition._index} ${flag} on
'') partition.flags}
# ensure further operations can detect new partitions
partprobe
partprobe ${config.device}
udevadm trigger --subsystem-match=block
udevadm settle
${lib.optionalString (partition.content != null) partition.content._create}

View File

@ -50,7 +50,7 @@
zfs create ${config._parent.name}/${config.name} \
${lib.concatStringsSep " " (lib.mapAttrsToList (n: v: "-o ${n}=${v}") config.options)} \
-V ${config.size}
partprobe
partprobe /dev/zvol/${config._parent.name}/${config.name}
udevadm trigger --subsystem-match=block
udevadm settle
${lib.optionalString (config.content != null) config.content._create}