types *: run udevadm settle after partprobe

This commit is contained in:
lassulus 2023-09-13 22:34:25 +02:00 committed by mergify[bot]
parent 38daf3c84a
commit 689873ae4f
5 changed files with 6 additions and 6 deletions

View file

@ -43,9 +43,9 @@ let
ln -sfn ${systemToInstall.config.system.build.etc}/etc/udev/rules.d /etc/udev/rules.d
mkdir -p /dev/.mdadm
${pkgs.systemdMinimal}/lib/systemd/systemd-udevd --daemon
partprobe
udevadm trigger --action=add
udevadm settle
partprobe
# populate nix db, so nixos-install doesn't complain
export NIX_STATE_DIR=$TMPDIR/state

View file

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

View file

@ -42,9 +42,9 @@
--force \
--homehost=any \
"''${disk_devices[@]}"
partprobe
udevadm trigger --subsystem-match=block
udevadm settle
partprobe
# for some reason mdadm devices spawn with an existing partition table, so we need to wipe it
sgdisk --zap-all /dev/md/${config.name}
${lib.optionalString (config.content != null) config.content._create}

View file

@ -91,9 +91,9 @@
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
udevadm trigger --subsystem-match=block
udevadm settle
partprobe
${lib.optionalString partition.bootable ''
parted -s ${config.device} -- set ${toString partition._index} boot on
''}
@ -101,9 +101,9 @@
parted -s ${config.device} -- set ${toString partition._index} ${flag} on
'') partition.flags}
# ensure further operations can detect new partitions
partprobe
udevadm trigger --subsystem-match=block
udevadm settle
partprobe
${lib.optionalString (partition.content != null) partition.content._create}
'') config.partitions)}
'';

View file

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