_cleanup_(dissected_image_unrefp) DissectedImage *m = NULL;
_cleanup_(loop_device_unrefp) LoopDevice *d = NULL;
_cleanup_(decrypted_image_unrefp) DecryptedImage *di = NULL;
+ _cleanup_(verity_settings_done) VeritySettings verity_settings = VERITY_SETTINGS_DEFAULT;
DissectImageFlags flags = DISSECT_IMAGE_READ_ONLY|DISSECT_IMAGE_REQUIRE_ROOT|DISSECT_IMAGE_MOUNT_ROOT_ONLY;
+ r = verity_settings_load(&verity_settings, img->path, NULL, NULL);
+ if (r < 0)
+ return log_error_errno(r, "Failed to read verity artifacts for %s: %m", img->path);
+
+ if (verity_settings.data_path)
+ flags |= DISSECT_IMAGE_NO_PARTITION_TABLE;
+
r = loop_device_make_by_path(img->path, O_RDONLY, 0, &d);
if (r < 0)
return log_error_errno(r, "Failed to set up loopback device: %m");
r = dissect_image_and_warn(
d->fd,
img->path,
- NULL,
+ &verity_settings,
NULL,
flags,
&m);
r = dissected_image_decrypt_interactively(
m, NULL,
- NULL,
+ &verity_settings,
flags,
&di);
if (r < 0)