summaryrefslogtreecommitdiff
path: root/src/shared/discover-image.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-03-10 17:41:18 +0100
committerLennart Poettering <lennart@poettering.net>2021-03-16 14:57:40 +0100
commit4b5de5dd6c930276628c84755d33187e2dfca5cc (patch)
tree95b821f1bd49dd0b08428b5eae496c75d9541b28 /src/shared/discover-image.c
parent2679f407353aa408c5e48f86866a45390c247e45 (diff)
downloadsystemd-4b5de5dd6c930276628c84755d33187e2dfca5cc.tar.gz
dissect-image: split DISSECT_IMAGE_REQUIRE_ROOT in two
Previously, the flag did two things at once: enable support for using generic partitions as root fs if there were only one/allow use of partition-table-less images as root fs. And secondly, insist that there was a rootfs, and fail if not. Let's split these two in two separate options so that they can be used independently of each other. There are cases where one wants to use one without the other (i.e. when inspecting things with systemd-dissect tool it should be OK to do so even if image has no root fs), and it's cleaner anyway.
Diffstat (limited to 'src/shared/discover-image.c')
-rw-r--r--src/shared/discover-image.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/shared/discover-image.c b/src/shared/discover-image.c
index a2f2261980..43138e0a6f 100644
--- a/src/shared/discover-image.c
+++ b/src/shared/discover-image.c
@@ -1201,8 +1201,9 @@ int image_read_metadata(Image *i) {
r = dissect_image(
d->fd,
NULL, NULL,
- DISSECT_IMAGE_REQUIRE_ROOT|
- DISSECT_IMAGE_RELAX_VAR_CHECK|
+ DISSECT_IMAGE_GENERIC_ROOT |
+ DISSECT_IMAGE_REQUIRE_ROOT |
+ DISSECT_IMAGE_RELAX_VAR_CHECK |
DISSECT_IMAGE_USR_NO_ROOT, &m);
if (r < 0)
return r;