<citerefentry><refentrytitle>systemd-remount-fs.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
</para></listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><varname>systemd.swap=</varname></term>
+
+ <listitem><para>Takes a boolean argument or enables the option if specified without an argument.
+ If disabled, automatic discovery of swap partition(s) based on GPT partition type is disabled.
+ Defaults to enabled.</para></listitem>
+ </varlistentry>
</variablelist>
</refsect1>
static const char *arg_dest = NULL;
static bool arg_enabled = true;
static bool arg_root_enabled = true;
+static bool arg_swap_enabled = true;
static char *arg_root_fstype = NULL;
static char *arg_root_options = NULL;
static int arg_root_rw = -1;
assert(p);
assert(p->node);
+ if (!arg_swap_enabled)
+ return 0;
+
/* Disable the swap auto logic if at least one swap is defined in /etc/fstab, see #6192. */
r = fstab_has_fstype("swap");
if (r < 0)
else if (proc_cmdline_key_streq(key, "systemd.image_policy"))
return parse_image_policy_argument(optarg, &arg_image_policy);
+ else if (proc_cmdline_key_streq(key, "systemd.swap")) {
+
+ r = value ? parse_boolean(value) : 1;
+ if (r < 0)
+ log_warning_errno(r, "Failed to parse swap switch \"%s\", ignoring: %m", value);
+ else
+ arg_swap_enabled = r;
+
+ if (!arg_swap_enabled)
+ log_debug("Disabling swap partitions auto-detection, systemd.swap=no is defined.");
+
+ }
+
return 0;
}