For some use cases we want to operate on the loop device that
systemd-dissect has attached the loop device to, so let's make that
easily accessible.
use <option>--read-only</option> to switch to read-only operation. The invoked process will have the
<varname>$SYSTEMD_DISSECT_ROOT</varname> environment variable set, containing the absolute path name
of the temporary mount point, i.e. the same directory that is set as the current working
- directory.</para></listitem>
+ directory. It will also have the <varname>$SYSTEMD_DISSECT_DEVICE</varname> environment variable set,
+ containing the absolute path name of the loop device the image was attached to.</para></listitem>
</varlistentry>
<varlistentry>
_exit(EXIT_FAILURE);
}
+ if (setenv("SYSTEMD_DISSECT_DEVICE", d->node, /* overwrite= */ true) < 0) {
+ log_error_errno(errno, "Failed to set $SYSTEMD_DISSECT_DEVICE: %m");
+ _exit(EXIT_FAILURE);
+ }
+
if (strv_isempty(arg_argv)) {
const char *sh;