]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dissect-image: avoid scanning partitions
authorTopi Miettinen <toiwoton@gmail.com>
Mon, 9 Mar 2020 12:01:06 +0000 (14:01 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 10 Mar 2020 09:03:57 +0000 (10:03 +0100)
In case the dissected image has a filesystem, don't scan for partitions. This
avoids problems with services using a `RootImage=` in early boot when udevd is
not yet started.

src/shared/dissect-image.c

index 1ac6549ba543dbfbb4cfeaaa4bd02187c6940356..1ef69fdf4c8d3bc47a1563bb609a227c9fd4af3d 100644 (file)
@@ -425,10 +425,11 @@ int dissect_image(
 
                         m->encrypted = streq_ptr(fstype, "crypto_LUKS");
 
-                        r = loop_wait_for_partitions_to_appear(fd, d, 0, flags, &e);
-                        if (r < 0)
-                                return r;
-
+                        if (!streq(usage, "filesystem")) {
+                                r = loop_wait_for_partitions_to_appear(fd, d, 0, flags, &e);
+                                if (r < 0)
+                                        return r;
+                        }
                         *ret = TAKE_PTR(m);
 
                         return 0;