['systemd-keyutil', '1', [], ''],
['systemd-localed.service', '8', ['systemd-localed'], 'ENABLE_LOCALED'],
['systemd-logind.service', '8', ['systemd-logind'], 'ENABLE_LOGIND'],
+ ['systemd-loop@.service', '8', [], ''],
['systemd-machine-id-commit.service', '8', [], ''],
['systemd-machine-id-setup', '1', [], ''],
['systemd-machined.service', '8', ['systemd-machined'], 'ENABLE_MACHINED'],
--- /dev/null
+<?xml version="1.0"?>
+<!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
+<refentry id="systemd-loop_.service">
+
+ <refentryinfo>
+ <title>systemd-loop@.service</title>
+ <productname>systemd</productname>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>systemd-loop@.service</refentrytitle>
+ <manvolnum>8</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>systemd-loop@.service</refname>
+ <refpurpose>Attach a loopback block device</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <para><filename>systemd-loop@<replaceable>path</replaceable>.service</filename></para>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para><filename>systemd-loop@.service</filename> is a template service that may be used to automatically
+ attach a loopback block device at boot (or later). Its instance string may reference an (escaped) file
+ system path pointing to a disk image to attach as loopback block device. Use
+ <citerefentry><refentrytitle>systemd-escape</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
+ <option>--path</option> to properly escape a file system path.</para>
+
+ <para>This unit invokes <command>systemd-dissect --attach --quiet --loop-ref-auto</command> on the
+ specified files, see
+ <citerefentry><refentrytitle>systemd-dissect</refentrytitle><manvolnum>1</manvolnum></citerefentry> for
+ details.</para>
+ </refsect1>
+
+ <refsect1>
+ <title>See Also</title>
+ <para><simplelist type="inline">
+ <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>systemd-dissect</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
+ <member><citerefentry><refentrytitle>systemd-import-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
+ </simplelist></para>
+ </refsect1>
+
+</refentry>
'conditions' : ['ENABLE_LOGIND'],
'symlinks' : ['multi-user.target.wants/', 'dbus-org.freedesktop.login1.service'],
},
+ { 'file' : 'systemd-loop@.service' },
{
'file' : 'systemd-machine-id-commit.service',
'symlinks' : ['sysinit.target.wants/'],
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Attach File %f to Loopback Block Device
+Documentation=man:systemd-loop@.service(8)
+DefaultDependencies=no
+RequiresMountsFor=%f
+IgnoreOnIsolate=yes
+Wants=modprobe@loop.service
+After=modprobe@loop.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+TimeoutSec=infinity
+ExecStart=systemd-dissect --attach --loop-ref-auto --quiet %f
+ExecStop=systemd-dissect --detach %f