From c1041b81dcdf521c60d4b58adfc03a1d4e72ac14 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 29 Jan 2024 15:24:58 +0100 Subject: [disk-partitions] Don't wait for udev if we scanned for HDDs in stage 3 --- .../data/opt/openslx/scripts/systemd-setup_partitions | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'core') diff --git a/core/modules/disk-partitions/data/opt/openslx/scripts/systemd-setup_partitions b/core/modules/disk-partitions/data/opt/openslx/scripts/systemd-setup_partitions index c85f5079..26552b95 100755 --- a/core/modules/disk-partitions/data/opt/openslx/scripts/systemd-setup_partitions +++ b/core/modules/disk-partitions/data/opt/openslx/scripts/systemd-setup_partitions @@ -156,7 +156,7 @@ mount_temp_fallback () { wait_for_udev () { local upid ctr hdd hdd= - if [ "x$1" = "x--hdd" ]; then + if [ "$1" = "--hdd" ]; then hdd=true shift fi @@ -183,10 +183,13 @@ has_hdd () { [ -n "$( ls -U -1 /dev/disk/by-path/ )" ] } -wait_for_udev 2 - -if ! has_hdd; then - wait_for_udev --hdd 4 +if ! [ -s "/run/openslx/dmsetup.state" ]; then + # If above file exists we should've waited for HDDs to appear in stage 3 already, + # so don't just wait for udev for two+ seconds for no reason. + wait_for_udev 2 + if ! has_hdd; then + wait_for_udev --hdd 4 + fi fi declare -A known= -- cgit v1.2.3-55-g7522