<refnamediv>
<refname>systemd-repart</refname>
<refname>systemd-repart.service</refname>
- <refpurpose>Automatically grow and add partitions</refpurpose>
+ <refpurpose>Automatically grow and add partitions, and generate disk images (DDIs).</refpurpose>
</refnamediv>
<refsynopsisdiv>
<xi:include href="version-info.xml" xpointer="v256"/></listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--list-devices</option></term>
+
+ <listitem><para>Show a list of candidate block devices this command may operate on. Specifically,
+ this enumerates block devices currently present that support partition tables, and shows their device
+ node paths along with any of their symlinks.</para>
+
+ <xi:include href="version-info.xml" xpointer="v257"/></listitem>
+ </varlistentry>
+
<xi:include href="standard-options.xml" xpointer="help" />
<xi:include href="standard-options.xml" xpointer="version" />
<xi:include href="standard-options.xml" xpointer="no-pager" />
#include "alloc-util.h"
#include "blkid-util.h"
+#include "blockdev-list.h"
#include "blockdev-util.h"
#include "btrfs-util.h"
#include "build.h"
" --image-policy=POLICY\n"
" Specify disk image dissection policy\n"
" --definitions=DIR Find partition definitions in specified directory\n"
+ " --list-devices List candidate block devices to operate on\n"
"\n%3$sVerity:%4$s\n"
" --private-key=PATH|URI\n"
" Private key to use when generating verity roothash\n"
ARG_MAKE_DDI,
ARG_GENERATE_FSTAB,
ARG_GENERATE_CRYPTTAB,
+ ARG_LIST_DEVICES,
};
static const struct option options[] = {
{ "make-ddi", required_argument, NULL, ARG_MAKE_DDI },
{ "generate-fstab", required_argument, NULL, ARG_GENERATE_FSTAB },
{ "generate-crypttab", required_argument, NULL, ARG_GENERATE_CRYPTTAB },
+ { "list-devices", no_argument, NULL, ARG_LIST_DEVICES },
{}
};
return r;
break;
+ case ARG_LIST_DEVICES:
+ r = blockdev_list(BLOCKDEV_LIST_REQUIRE_PARTITION_SCANNING|BLOCKDEV_LIST_SHOW_SYMLINKS|BLOCKDEV_LIST_IGNORE_ZRAM);
+ if (r < 0)
+ return r;
+
+ return 0;
+
case '?':
return -EINVAL;