dissect-image: clean up meaning of DISSECT_IMAGE_MKDIR
authorLennart Poettering <lennart@poettering.net>
Tue, 9 Mar 2021 21:03:00 +0000 (22:03 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 12 Mar 2021 16:35:57 +0000 (17:35 +0100)
commit53d9d87d2d6885da36808d03e4a19e5bf7812b9f
tree5ed399f785eb2362db36481bc04efc3025cb861f
parentebf267d6b963188b5c972ee9c2814003c9f79e08
dissect-image: clean up meaning of DISSECT_IMAGE_MKDIR

Previously handling of DISSECT_IMAGE_MKDIR was pretty weird and broken:
it would control both if we create the top-level mount point when
mounting an image, and the inner mount points for images that consist of
multiple file systems. However, the latter is redundant, since
1f0f82f1311e4c52152b8e2b6f266258709c137d does this too, a few lines
further up – unconditionally!

Hence, let's make the meaning of DISSECT_IMAGE_MKDIR more strict: it
shall be only about the top-level mount point, not about the inner ones
(where we'll continue to create what is missing alwayway). Having a
separate flag for the top-level mount point is relevant, since the mount
point dir created by it will remain on the host fs – unlike the
directories we create inside the image, which will stay within the
image.

This slightly change of meaning is actually inline with what the flag is
actually used for and documented in systemd-dissect.

(cherry picked from commit 9842905ede9c7fdc541724ee5c6db7d46a47405d)
src/shared/dissect-image.c
src/shared/dissect-image.h