]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man: document /sbin/mount.ddi 26695/head
authorLennart Poettering <lennart@poettering.net>
Mon, 6 Mar 2023 17:48:18 +0000 (18:48 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 6 Mar 2023 22:00:52 +0000 (23:00 +0100)
man/rules/meson.build
man/systemd-dissect.xml

index 2bf5936d641be628d41a3c11b30880d4afad4f8d..ff4794b5288db304249c03469f4ebdbed5d0889f 100644 (file)
@@ -902,7 +902,7 @@ manpages = [
  ['systemd-debug-generator', '8', [], ''],
  ['systemd-delta', '1', [], ''],
  ['systemd-detect-virt', '1', [], ''],
- ['systemd-dissect', '1', [], 'HAVE_BLKID'],
+ ['systemd-dissect', '1', ['mount.ddi'], 'HAVE_BLKID'],
  ['systemd-environment-d-generator',
   '8',
   ['30-systemd-environment-d-generator'],
index 6549aa92c856c25853a5118d2c3dff9e41f60f67..01eda2702dd6a82ec77a71f4036701bc6c043272 100644 (file)
@@ -18,6 +18,7 @@
 
   <refnamediv>
     <refname>systemd-dissect</refname>
+    <refname>mount.ddi</refname>
     <refpurpose>Dissect Discoverable Disk Images (DDIs)</refpurpose>
   </refnamediv>
 
     what it operates with when mounting the image. To display the complete list of partitions use a tool such
     as <citerefentry
     project='man-pages'><refentrytitle>fdisk</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+
+    <para>The <command>systemd-dissect</command> command may be invoked as <command>mount.ddi</command> in
+    which case it implements the <citerefentry
+    project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> "external
+    helper" interface. This ensures disk images compatible with <command>systemd-dissect</command> can be
+    mounted directly by <command>mount</command> and <citerefentry
+    project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>. For
+    details see below.</para>
   </refsect1>
 
   <refsect1>
         <para>All mounted file systems are checked with the appropriate <citerefentry
         project='man-pages'><refentrytitle>fsck</refentrytitle><manvolnum>8</manvolnum></citerefentry>
         implementation in automatic fixing mode, unless explicitly turned off (<option>--fsck=no</option>) or
-        read-only operation is requested (<option>--read-only</option>).</para></listitem>
+        read-only operation is requested (<option>--read-only</option>).</para>
+
+        <para>Note that this functionality is also available in <citerefentry
+        project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> via a
+        command such as <command>mount -t ddi myimage.raw targetdir/</command>, as well as in <citerefentry
+        project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>. For
+        details, see below.</para></listitem>
       </varlistentry>
 
       <varlistentry>
     command is used the exit status of the invoked command is propagated.</para>
   </refsect1>
 
+  <refsect1>
+    <title>Invocation as <command>/sbin/mount.ddi</command></title>
+
+    <para>The <command>systemd-dissect</command> executable may be symlinked to
+    <filename>/sbin/mount.ddi</filename>. If invoked through that it implements <citerefentry
+    project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
+    "external helper" interface for the (pseudo) file system type <literal>ddi</literal>. This means
+    conformant disk images may be mounted directly via</para>
+
+    <programlisting># mount -t ddi myimage.raw targetdir/</programlisting>
+
+    <para>in a fashion mostly equivalent to:</para>
+
+    <programlisting># systemd-dissect --mount myimage.raw targetdir/</programlisting>
+
+    <para>Note that since a single DDI may contain multiple file systems it should later be unmounted with
+    <command>umount -R targetdir/</command>, for recursive operation.</para>
+
+    <para>This functionality is particularly useful to mount DDIs automatically at boot via simple
+    <filename>/etc/fstab</filename> entries. For example:</para>
+
+    <programlisting>/path/to/myimage.raw /images/myimage/ ddi defaults 0 0</programlisting>
+
+    <para>When invoked this way the mount options <literal>ro</literal>, <literal>rw</literal>,
+    <literal>discard</literal>, <literal>nodiscard</literal> map to the corresponding options listed above
+    (i.e. <option>--read-only</option>, <option>--discard=all</option>,
+    <option>--discard=disabled</option>). Mount options are <emphasis>not</emphasis> generically passed on to
+    the file systems inside the images.</para>
+  </refsect1>
 
   <refsect1>
     <title>Examples</title>
     <example>
       <title>Generate a tarball from an OS disk image</title>
 
-      <programlisting>$ systemd-dissect --with foo.raw tar cz . >foo.tar.gz</programlisting>
+      <programlisting># systemd-dissect --with foo.raw tar cz . >foo.tar.gz</programlisting>
     </example>
   </refsect1>
 
       <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
       <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
       <ulink url="https://uapi-group.org/specifications/specs/discoverable_partitions_specification">Discoverable Partitions Specification</ulink>,
+      <citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
       <citerefentry project='man-pages'><refentrytitle>umount</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
       <citerefentry project='man-pages'><refentrytitle>fdisk</refentrytitle><manvolnum>8</manvolnum></citerefentry>
     </para>