Skip to content

Commit b9b0f33

Browse files
authored
Merge pull request #28274 from DaanDeMeyer/dissect-root
dissect: Allow a few verbs to operate on directories as well as image files
2 parents 5bc9ea0 + 12d58b6 commit b9b0f33

File tree

3 files changed

+173
-109
lines changed

3 files changed

+173
-109
lines changed

man/systemd-dissect.xml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@
202202
<term><option>--list</option></term>
203203
<term><option>-l</option></term>
204204

205-
<listitem><para>Prints the paths of all the files and directories in the specified OS image to
206-
standard output.</para></listitem>
205+
<listitem><para>Prints the paths of all the files and directories in the specified OS image or
206+
directory to standard output.</para></listitem>
207207
</varlistentry>
208208

209209
<varlistentry>
@@ -212,7 +212,7 @@
212212

213213
<listitem><para>Generates a BSD
214214
<citerefentry project='die-net'><refentrytitle>mtree</refentrytitle><manvolnum>8</manvolnum></citerefentry>
215-
compatible file manifest of the specified disk image. This is useful for comparing disk image
215+
compatible file manifest of the specified disk image or directory. This is useful for comparing image
216216
contents in detail, including inode information and other metadata. While the generated manifest will
217217
contain detailed inode information, it currently excludes extended attributes, file system
218218
capabilities, MAC labels,
@@ -242,31 +242,32 @@
242242
<term><option>--copy-from</option></term>
243243
<term><option>-x</option></term>
244244

245-
<listitem><para>Copies a file or directory from the specified OS image into the specified location on
246-
the host file system. Expects three arguments: a path to an image file, a source path (relative to
247-
the image's root directory) and a destination path (relative to the current working directory, or an
248-
absolute path, both outside of the image). If the destination path is omitted or specified as dash
249-
(<literal>-</literal>), the specified file is written to standard output. If the source path in the
250-
image file system refers to a regular file it is copied to the destination path. In this case access
251-
mode, extended attributes and timestamps are copied as well, but file ownership is not. If the source
252-
path in the image refers to a directory, it is copied to the destination path, recursively with all
253-
containing files and directories. In this case the file ownership is copied too.</para></listitem>
245+
<listitem><para>Copies a file or directory from the specified OS image or directory into the
246+
specified location on the host file system. Expects three arguments: a path to an image file or
247+
directory, a source path (relative to the image's root directory) and a destination path (relative to
248+
the current working directory, or an absolute path, both outside of the image). If the destination
249+
path is omitted or specified as dash (<literal>-</literal>), the specified file is written to
250+
standard output. If the source path in the image file system refers to a regular file it is copied to
251+
the destination path. In this case access mode, extended attributes and timestamps are copied as
252+
well, but file ownership is not. If the source path in the image refers to a directory, it is copied
253+
to the destination path, recursively with all containing files and directories. In this case the file
254+
ownership is copied too.</para></listitem>
254255
</varlistentry>
255256

256257
<varlistentry>
257258
<term><option>--copy-to</option></term>
258259
<term><option>-a</option></term>
259260

260261
<listitem><para>Copies a file or directory from the specified location in the host file system into
261-
the specified OS image. Expects three arguments: a path to an image file, a source path (relative to
262-
the current working directory, or an absolute path, both outside of the image) and a destination path
263-
(relative to the image's root directory). If the source path is omitted or specified as dash
264-
(<literal>-</literal>), the data to write is read from standard input. If the source path in the host
265-
file system refers to a regular file, it is copied to the destination path. In this case access mode,
266-
extended attributes and timestamps are copied as well, but file ownership is not. If the source path
267-
in the host file system refers to a directory it is copied to the destination path, recursively with
268-
all containing files and directories. In this case the file ownership is copied
269-
too.</para>
262+
the specified OS image or directory. Expects three arguments: a path to an image file or directory, a
263+
source path (relative to the current working directory, or an absolute path, both outside of the
264+
image) and a destination path (relative to the image's root directory). If the source path is omitted
265+
or specified as dash (<literal>-</literal>), the data to write is read from standard input. If the
266+
source path in the host file system refers to a regular file, it is copied to the destination path.
267+
In this case access mode, extended attributes and timestamps are copied as well, but file ownership
268+
is not. If the source path in the host file system refers to a directory it is copied to the
269+
destination path, recursively with all containing files and directories. In this case the file
270+
ownership is copied too.</para>
270271

271272
<para>As with <option>--mount</option> file system checks are implicitly run before the copy
272273
operation begins.</para></listitem>
@@ -421,6 +422,14 @@
421422
<command>cfdisk /dev/loop/by-ref/quux</command>.</para></listitem>
422423
</varlistentry>
423424

425+
<varlistentry>
426+
<term><option>--mtree-hash=no</option></term>
427+
428+
<listitem><para>If combined with <option>--mtree</option>, turns off inclusion of file hashes in the
429+
mtree output. This makes the <option>--mtree</option> faster when operating on large images.
430+
</para></listitem>
431+
</varlistentry>
432+
424433
<xi:include href="standard-options.xml" xpointer="image-policy-open" />
425434
<xi:include href="standard-options.xml" xpointer="no-pager" />
426435
<xi:include href="standard-options.xml" xpointer="no-legend" />

0 commit comments

Comments
 (0)