diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-03-10 17:41:18 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-03-16 14:57:40 +0100 |
commit | 4b5de5dd6c930276628c84755d33187e2dfca5cc (patch) | |
tree | 95b821f1bd49dd0b08428b5eae496c75d9541b28 /src/portable/portable.c | |
parent | dissect-image: extend comment on returned errors a bit (diff) | |
download | systemd-4b5de5dd6c930276628c84755d33187e2dfca5cc.tar.xz systemd-4b5de5dd6c930276628c84755d33187e2dfca5cc.zip |
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/portable/portable.c')
-rw-r--r-- | src/portable/portable.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/portable/portable.c b/src/portable/portable.c index aacc573ef6..5651db6722 100644 --- a/src/portable/portable.c +++ b/src/portable/portable.c @@ -380,7 +380,16 @@ static int portable_extract_by_path( if (r < 0) return log_debug_errno(r, "Failed to create temporary directory: %m"); - r = dissect_image(d->fd, NULL, NULL, DISSECT_IMAGE_READ_ONLY|DISSECT_IMAGE_REQUIRE_ROOT|DISSECT_IMAGE_DISCARD_ON_LOOP|DISSECT_IMAGE_RELAX_VAR_CHECK|DISSECT_IMAGE_USR_NO_ROOT, &m); + r = dissect_image( + d->fd, + NULL, NULL, + DISSECT_IMAGE_READ_ONLY | + DISSECT_IMAGE_GENERIC_ROOT | + DISSECT_IMAGE_REQUIRE_ROOT | + DISSECT_IMAGE_DISCARD_ON_LOOP | + DISSECT_IMAGE_RELAX_VAR_CHECK | + DISSECT_IMAGE_USR_NO_ROOT, + &m); if (r == -ENOPKG) sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Couldn't identify a suitable partition table or file system in '%s'.", path); else if (r == -EADDRNOTAVAIL) |