X Tutup
Skip to content

Commit 252d626

Browse files
committed
repart: add --image= switch
This is similar to the --image= switch in the other tools, like systemd-sysusers or systemd-tmpfiles, i.e. it apply the configuration from the image to the image. This is particularly useful for downloading minimized GPT image, and then extending it to the desired size via: # systemd-repart --image=foo.image --size=5G
1 parent 8e5f3ce commit 252d626

File tree

3 files changed

+189
-63
lines changed

3 files changed

+189
-63
lines changed

man/repart.d.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,11 @@
486486
<para>The copy operation is executed before the file system is registered in the partition table,
487487
thus ensuring that a file system populated this way only ever exists fully initialized.</para>
488488

489-
<para>This option cannot be combined with <varname>CopyBlocks=</varname>.</para></listitem>
489+
<para>This option cannot be combined with <varname>CopyBlocks=</varname>.</para>
490+
491+
<para>When <command>systemd-repart</command> is invoked with the <option>--image=</option> or
492+
<option>--root=</option> command line switches the source paths specified are taken relative to the
493+
specified root directory or disk image root.</para></listitem>
490494
</varlistentry>
491495

492496
<varlistentry>

man/systemd-repart.xml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,17 @@
4040
<citerefentry><refentrytitle>repart.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
4141
</para>
4242

43-
<para>If invoked with no arguments, it operates on the block device backing the root file system partition
44-
of the OS, thus growing and adding partitions of the booted OS image itself. When called in the initial
45-
RAM disk it operates on the block device backing <filename>/sysroot/</filename> instead, i.e. on the
46-
block device the system will soon transition into. The <filename>systemd-repart.service</filename>
47-
service is generally run at boot in the initial RAM disk, in order to augment the partition table of the
48-
OS before its partitions are mounted. <command>systemd-repart</command> (mostly) operates in a purely
49-
incremental mode: it only grows existing and adds new partitions; it does not shrink, delete or move
50-
existing partitions. The service is intended to be run on every boot, but when it detects that the
51-
partition table already matches the installed <filename>repart.d/*.conf</filename> configuration
52-
files, it executes no operation.</para>
43+
<para>If invoked with no arguments, it operates on the block device backing the root file system
44+
partition of the running OS, thus growing and adding partitions of the booted OS image itself. If
45+
<varname>--image=</varname> is used it will operate on the specified image file. When called in the
46+
<literal>initrd</literal> it operates on the block device backing <filename>/sysroot/</filename> instead,
47+
i.e. on the block device the system will soon transition into. The
48+
<filename>systemd-repart.service</filename> service is generally run at boot in the initial RAM disk, in
49+
order to augment the partition table of the OS before its partitions are
50+
mounted. <command>systemd-repart</command> (mostly) operates in a purely incremental mode: it only grows
51+
existing and adds new partitions; it does not shrink, delete or move existing partitions. The service is
52+
intended to be run on every boot, but when it detects that the partition table already matches the
53+
installed <filename>repart.d/*.conf</filename> configuration files, it executes no operation.</para>
5354

5455
<para><command>systemd-repart</command> is intended to be used when deploying OS images, to automatically
5556
adjust them to the system they are running on, during first boot. This way the deployed image can be
@@ -251,13 +252,21 @@
251252
<term><option>--root=</option></term>
252253

253254
<listitem><para>Takes a path to a directory to use as root file system when searching for
254-
<filename>repart.d/*.conf</filename> files and for the machine ID file to use as seed. By default
255-
when invoked on the regular system this defaults to the host's root file system
255+
<filename>repart.d/*.conf</filename> files, for the machine ID file to use as seed and for the
256+
<varname>CopyFiles=</varname> and <varname>CopyBlocks=</varname> source files and directories. By
257+
default when invoked on the regular system this defaults to the host's root file system
256258
<filename>/</filename>. If invoked from the initial RAM disk this defaults to
257259
<filename>/sysroot/</filename>, so that the tool operates on the configuration and machine ID stored
258260
in the root file system later transitioned into itself.</para></listitem>
259261
</varlistentry>
260262

263+
<varlistentry>
264+
<term><option>--image=</option></term>
265+
266+
<listitem><para>Takes a path to a disk image file or device to mount and use in a similar fashion to
267+
<option>--root=</option>, see above.</para></listitem>
268+
</varlistentry>
269+
261270
<varlistentry>
262271
<term><option>--seed=</option></term>
263272

0 commit comments

Comments
 (0)
X Tutup