<option>--fsck=no</option>.</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term><option>--growfs=no</option></term>
+
+ <listitem><para>Turn off automatic growing of accessed file systems to their partition size, if
+ marked for that in the GPT partition table. By default when an image is accessed for writing (by
+ <option>--mount</option> or <option>--copy-to</option>) the file systems contained in the OS image
+ are automatically grown to their partition sizes, if bit 59 in the GPT partition flags is set for
+ partition types that are defined by the <ulink
+ url="https://systemd.io/DISCOVERABLE_PARTITIONS">Discoverable Partitions Specification</ulink>. This
+ behavior may be switched off using <option>--growfs=no</option>. File systems are grown automatically
+ on access if all of the following conditions are met:</para>
+ <orderedlist>
+ <listitem><para>The file system is mounted writable</para></listitem>
+ <listitem><para>The file system currently is smaller than the partition it is contained in (and thus can be grown)</para></listitem>
+ <listitem><para>The image contains a GPT partition table</para></listitem>
+ <listitem><para>The file system is stored on a partition defined by the Discoverable Partitions Specification</para></listitem>
+ <listitem><para>Bit 59 of the GPT partition flags for this partition is set, as per specification</para></listitem>
+ <listitem><para>The <option>--growfs=no</option> option is not passed.</para></listitem>
+ </orderedlist>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><option>--mkdir</option></term>
DISSECT_IMAGE_DISCARD_ON_LOOP |
DISSECT_IMAGE_RELAX_VAR_CHECK |
DISSECT_IMAGE_FSCK |
- DISSECT_IMAGE_USR_NO_ROOT;
+ DISSECT_IMAGE_USR_NO_ROOT |
+ DISSECT_IMAGE_GROWFS;
static VeritySettings arg_verity_settings = VERITY_SETTINGS_DEFAULT;
static JsonFormatFlags arg_json_format_flags = JSON_FORMAT_OFF;
static PagerFlags arg_pager_flags = 0;
" --no-legend Do not show the headers and footers\n"
" -r --read-only Mount read-only\n"
" --fsck=BOOL Run fsck before mounting\n"
+ " --growfs=BOOL Grow file system to partition size, if marked\n"
" --mkdir Make mount directory before mounting, if missing\n"
" --discard=MODE Choose 'discard' mode (disabled, loop, all, crypto)\n"
" --root-hash=HASH Specify root hash for verity\n"
ARG_NO_LEGEND,
ARG_DISCARD,
ARG_FSCK,
+ ARG_GROWFS,
ARG_ROOT_HASH,
ARG_ROOT_HASH_SIG,
ARG_VERITY_DATA,
{ "read-only", no_argument, NULL, 'r' },
{ "discard", required_argument, NULL, ARG_DISCARD },
{ "fsck", required_argument, NULL, ARG_FSCK },
+ { "growfs", required_argument, NULL, ARG_GROWFS },
{ "root-hash", required_argument, NULL, ARG_ROOT_HASH },
{ "root-hash-sig", required_argument, NULL, ARG_ROOT_HASH_SIG },
{ "verity-data", required_argument, NULL, ARG_VERITY_DATA },
SET_FLAG(arg_flags, DISSECT_IMAGE_FSCK, r);
break;
+ case ARG_GROWFS:
+ r = parse_boolean(optarg);
+ if (r < 0)
+ return log_error_errno(r, "Failed to parse --growfs= parameter: %s", optarg);
+
+ SET_FLAG(arg_flags, DISSECT_IMAGE_GROWFS, r);
+ break;
+
case ARG_JSON:
r = parse_json_argument(optarg, &arg_json_format_flags);
if (r <= 0)