summaryrefslogtreecommitdiff
path: root/src/dissect
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-10-04 17:40:46 +0200
committerLennart Poettering <lennart@poettering.net>2017-10-26 17:54:56 +0200
commit759aaedc5ce8fb42c99fbccb374f35f063194a4c (patch)
tree5a46c66cb82c8a76a098f430919bda40cbd18f7d /src/dissect
parenteb38edce88ac2f511ed9593a1c25c58a77158219 (diff)
downloadsystemd-759aaedc5ce8fb42c99fbccb374f35f063194a4c.tar.gz
dissect: when we invoke dissection on a loop device with partscan help the user
This adds some simply detection logic for cases where dissection is invoked on an externally created loop device, and partitions have been detected on it, but partition scanning so far was off. If this is detected we now print a brief message indicating what the issue is, instead of failing with a useless EINVAL message the kernel passed to us.
Diffstat (limited to 'src/dissect')
-rw-r--r--src/dissect/dissect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c
index 06564e94b1..e5264d09df 100644
--- a/src/dissect/dissect.c
+++ b/src/dissect/dissect.c
@@ -216,6 +216,10 @@ int main(int argc, char *argv[]) {
log_error_errno(r, "No suitable root partition found in image %s.", arg_image);
goto finish;
}
+ if (r == -EPROTONOSUPPORT) {
+ log_error_errno(r, "Device %s is loopback block device with partition scanning turned off, please turn it on.", arg_image);
+ goto finish;
+ }
if (r < 0) {
log_error_errno(r, "Failed to dissect image: %m");
goto finish;