diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-12-15 17:38:11 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-12-21 19:09:30 +0100 |
commit | e0f9e7bd03eebeb8fdfce7f766c4e254e3586dc8 (patch) | |
tree | 05a9df559074b9194fe15b5b6f08dfc0c2af636a /src/dissect | |
parent | dissect: return the GPT partition UUID, too (diff) | |
download | systemd-e0f9e7bd03eebeb8fdfce7f766c4e254e3586dc8.tar.xz systemd-e0f9e7bd03eebeb8fdfce7f766c4e254e3586dc8.zip |
dissect: make using a generic partition as root partition optional
In preparation for reusing the image dissector in the GPT auto-discovery
logic, only optionally fail the dissection when we can't identify a root
partition.
In the GPT auto-discovery we are completely fine with any kind of root,
given that we run when it is already mounted and all we do is find some
additional auxiliary partitions on the same disk.
Diffstat (limited to 'src/dissect')
-rw-r--r-- | src/dissect/dissect.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index 78ec88fa35..fd9db5ba87 100644 --- a/src/dissect/dissect.c +++ b/src/dissect/dissect.c @@ -35,7 +35,7 @@ static enum { } arg_action = ACTION_DISSECT; static const char *arg_image = NULL; static const char *arg_path = NULL; -static DissectImageFlags arg_flags = DISSECT_IMAGE_DISCARD_ON_LOOP; +static DissectImageFlags arg_flags = DISSECT_IMAGE_REQUIRE_ROOT|DISSECT_IMAGE_DISCARD_ON_LOOP; static void *arg_root_hash = NULL; static size_t arg_root_hash_size = 0; @@ -191,7 +191,7 @@ int main(int argc, char *argv[]) { goto finish; } - r = dissect_image(d->fd, arg_root_hash, arg_root_hash_size, 0, &m); + r = dissect_image(d->fd, arg_root_hash, arg_root_hash_size, arg_flags, &m); if (r == -ENOPKG) { log_error_errno(r, "Couldn't identify a suitable partition table or file system in %s.", arg_image); goto finish; |