]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
partition: use `udevadm wait` 22960/head
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 4 Apr 2022 13:56:00 +0000 (15:56 +0200)
committerFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 4 Apr 2022 13:59:40 +0000 (15:59 +0200)
meson.build
src/partition/test-repart.sh

index 311895db5e6594c6e73bc24668d87fae1130f514..0455d89b78c8c8c682f41d5037027908661d8cdc 100644 (file)
@@ -3076,27 +3076,6 @@ if conf.get('ENABLE_BINFMT') == 1
         endif
 endif
 
-if conf.get('ENABLE_REPART') == 1
-        exe = executable(
-                'systemd-repart',
-                systemd_repart_sources,
-                include_directories : includes,
-                link_with : [libshared],
-                dependencies : [threads,
-                                libblkid,
-                                libfdisk],
-                install_rpath : rootlibexecdir,
-                install : true,
-                install_dir : rootbindir)
-        public_programs += exe
-
-        if want_tests != 'false'
-                test('test-repart',
-                     test_repart_sh,
-                     args : exe.full_path())
-        endif
-endif
-
 if conf.get('ENABLE_SYSUPDATE') == 1
         exe = executable(
                 'systemd-sysupdate',
@@ -3517,7 +3496,7 @@ public_programs += executable(
         install : true,
         install_dir : rootlibexecdir)
 
-public_programs += executable(
+udevadm = executable(
         'udevadm',
         udevadm_sources,
         include_directories : includes,
@@ -3531,6 +3510,28 @@ public_programs += executable(
         install_rpath : udev_rpath,
         install : true,
         install_dir : rootbindir)
+public_programs += udevadm
+
+if conf.get('ENABLE_REPART') == 1
+        exe = executable(
+                'systemd-repart',
+                systemd_repart_sources,
+                include_directories : includes,
+                link_with : [libshared],
+                dependencies : [threads,
+                                libblkid,
+                                libfdisk],
+                install_rpath : rootlibexecdir,
+                install : true,
+                install_dir : rootbindir)
+        public_programs += exe
+
+        if want_tests != 'false'
+                test('test-repart',
+                     test_repart_sh,
+                     args : [exe.full_path(), udevadm.full_path()])
+        endif
+endif
 
 executable(
         'systemd-shutdown',
index 178379312748ad06ba87ab407b09ac8f8623da7f..88b696ba0150775dcf1585a5b48e12126b1910a6 100755 (executable)
@@ -6,7 +6,9 @@ set -o pipefail
 [[ -e /dev/loop-control ]] || exit 77
 
 repart="${1:?}"
+udevadm="${2:?}"
 test -x "$repart"
+test -x "$udevadm"
 
 PATH=$PATH:/sbin:/usr/sbin
 
@@ -199,10 +201,7 @@ $D/zzz7 : start=     6291416, size=       98304, type=0FC63DAF-8483-4772-8E79-3D
 EOF
 
     LOOP="$(losetup -P --show --find "$D/zzz")"
-    while : ; do
-        test -e "$LOOP" && break
-        sleep .2
-    done
+    "${udevadm:?}" wait --timeout 60 --initialized=yes --settle "${LOOP:?}"
 
     VOLUME="test-repart-$RANDOM"