dissect: split read-only flag into two
authorLennart Poettering <lennart@poettering.net>
Fri, 19 Mar 2021 21:19:08 +0000 (22:19 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 19 Apr 2021 21:16:02 +0000 (23:16 +0200)
commitef9c184d3d2971f41ffc4bc9b8b4df17a704a29e
tree1f81d7bd0684ccd2cb0e27746538e72b438a39aa
parent0ade2213e6a515f30dd587d9378958675e0ea245
dissect: split read-only flag into two

Let's have one flag to request that when dissecting an image the
loopback device is made read-only, and another one to request that when
it is mounted to make it read-only. Previously both concepts were always
done read-only together.

(Of course, making the loopback device read-only but mounting it
read-write doesn't make too much sense, but the kernel should catch that
for us, no need to make restrictions from our side there)

Use-case for this: in systemd-repart we'd like to operate on images for
adding partitions. Thus we'd like to have the loopback device writable,
but if we read repart.d/ snippets from it, we want to do that read-only.
src/core/namespace.c
src/dissect/dissect.c
src/shared/dissect-image.c
src/shared/dissect-image.h