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.
This commit is contained in:
Lennart Poettering
2016-12-21 19:09:30 +01:00
parent be30ad41ff
commit e0f9e7bd03
6 changed files with 27 additions and 13 deletions
+2 -2
View File
@@ -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;