1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-06 12:58:22 +03:00

dissect-image: avoid scanning partitions

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.

(cherry picked from commit 0108c42f59dd5848f6b561f260dc6ff3e19d651b)
(cherry picked from commit 98f8a718c161d45b0001ee68f2ec7d111da79397)
(cherry picked from commit 9de06cd65af80173140989b0b8338fe7411bf488)
This commit is contained in:
Topi Miettinen 2020-03-09 14:01:06 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 1a4d6e5c6b
commit 9cc3267bd1

View File

@ -392,10 +392,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;