]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
vmspawn: move --kernel=/--initrd= under the "Execution" section
authorLennart Poettering <lennart@amutable.com>
Wed, 20 May 2026 13:52:57 +0000 (15:52 +0200)
committerLennart Poettering <lennart@amutable.com>
Wed, 20 May 2026 21:39:47 +0000 (23:39 +0200)
This has little to do with host configuration (where it was so far), and
a lot with what being executed, let's move it over.

Note that --help and man page so far differed here quite a bit: the
former had the "Execution" section, the latter didn't. This creates it
in the man page, to bring the two back in sync.

man/systemd-vmspawn.xml
src/vmspawn/vmspawn.c

index c70b76c4980b8d39c9dbed29d9500c15c3ae12da..74feca4050870a83ef106e60f3fc4870dae49823 100644 (file)
           <xi:include href="version-info.xml" xpointer="v261"/></listitem>
         </varlistentry>
 
-        <varlistentry>
-          <term><option>--linux=<replaceable>PATH</replaceable></option></term>
-
-          <listitem>
-            <para>Set the linux kernel image to use for direct kernel boot.
-            If a directory type image is used and <option>--linux=</option> was omitted, vmspawn will search for boot loader entries
-            according to the
-            <ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">UAPI.1 Boot Loader Specification</ulink> assuming
-            XBOOTLDR to be located at /boot and ESP to be /efi respectively.
-            If no kernel was installed into the image then the image will fail to boot.</para>
-
-            <xi:include href="version-info.xml" xpointer="v256"/>
-          </listitem>
-        </varlistentry>
-
-        <varlistentry>
-          <term><option>--initrd=<replaceable>PATH</replaceable></option></term>
-
-          <listitem>
-            <para>Set the initrd to use for direct kernel boot.
-            If the <option>--linux=</option> supplied is a
-            <ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">UAPI.1 Boot Loader Specification</ulink>
-            Type #2 entry, then this argument is not required.
-            If no initrd was installed into the image then the image will fail to boot.</para>
-
-            <para><option>--initrd=</option> can be specified multiple times and vmspawn will merge them together.</para>
-
-            <xi:include href="version-info.xml" xpointer="v256"/>
-          </listitem>
-        </varlistentry>
-
         <varlistentry>
           <term><option>--firmware=<replaceable>PATH</replaceable></option></term>
 
 
           <xi:include href="version-info.xml" xpointer="v261"/></listitem>
         </varlistentry>
-
-        <varlistentry>
-          <term><option>--smbios11=<replaceable>STRING</replaceable></option></term>
-          <term><option>-s <replaceable>STRING</replaceable></option></term>
-
-          <listitem><para>Passes the specified string into the VM as an SMBIOS Type #11 vendor string. This
-          is useful to parameterize the invoked VM in various ways. See
-          <citerefentry><refentrytitle>smbios-type-11</refentrytitle><manvolnum>7</manvolnum></citerefentry>
-          for details.</para>
-
-          <xi:include href="version-info.xml" xpointer="v258"/></listitem>
-        </varlistentry>
-
-        <varlistentry>
-          <term><option>--notify-ready=</option></term>
-
-          <listitem><para>Configures support for notifications from the VM's init process to
-          <command>systemd-vmspawn</command>.  If true, <command>systemd-vmspawn</command> will consider the
-          machine as ready only when it has received a <literal>READY=1</literal> message from the init
-          process in the VM. If false, <command>systemd-vmspawn</command> will consider the machine as ready
-          immediately after creation.  In either case, <command>systemd-vmspawn</command> sends its own
-          readiness notification to its manager after the spawned VM is ready. For more details about
-          notifications see
-          <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
-
-          <para>Defaults to true. (Note that this is unlike the option of the same name to
-          <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>
-          that defaults to false.)</para>
-
-          <xi:include href="version-info.xml" xpointer="v258"/></listitem>
-        </varlistentry>
       </variablelist>
     </refsect2>
 
       </variablelist>
     </refsect2>
 
+    <refsect2>
+      <title>Execution Options</title>
+
+      <variablelist>
+        <varlistentry>
+          <term><option>--linux=<replaceable>PATH</replaceable></option></term>
+
+          <listitem>
+            <para>Set the linux kernel image to use for direct kernel boot.
+            If a directory type image is used and <option>--linux=</option> was omitted, vmspawn will search for boot loader entries
+            according to the
+            <ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">UAPI.1 Boot Loader Specification</ulink> assuming
+            XBOOTLDR to be located at /boot and ESP to be /efi respectively.
+            If no kernel was installed into the image then the image will fail to boot.</para>
+
+            <xi:include href="version-info.xml" xpointer="v256"/>
+          </listitem>
+        </varlistentry>
+
+        <varlistentry>
+          <term><option>--initrd=<replaceable>PATH</replaceable></option></term>
+
+          <listitem>
+            <para>Set the initrd to use for direct kernel boot.
+            If the <option>--linux=</option> supplied is a
+            <ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">UAPI.1 Boot Loader Specification</ulink>
+            Type #2 entry, then this argument is not required.
+            If no initrd was installed into the image then the image will fail to boot.</para>
+
+            <para><option>--initrd=</option> can be specified multiple times and vmspawn will merge them together.</para>
+
+            <xi:include href="version-info.xml" xpointer="v256"/>
+          </listitem>
+        </varlistentry>
+
+        <varlistentry>
+          <term><option>--smbios11=<replaceable>STRING</replaceable></option></term>
+          <term><option>-s <replaceable>STRING</replaceable></option></term>
+
+          <listitem><para>Passes the specified string into the VM as an SMBIOS Type #11 vendor string. This
+          is useful to parameterize the invoked VM in various ways. See
+          <citerefentry><refentrytitle>smbios-type-11</refentrytitle><manvolnum>7</manvolnum></citerefentry>
+          for details.</para>
+
+          <xi:include href="version-info.xml" xpointer="v258"/></listitem>
+        </varlistentry>
+
+        <varlistentry>
+          <term><option>--notify-ready=</option></term>
+
+          <listitem><para>Configures support for notifications from the VM's init process to
+          <command>systemd-vmspawn</command>.  If true, <command>systemd-vmspawn</command> will consider the
+          machine as ready only when it has received a <literal>READY=1</literal> message from the init
+          process in the VM. If false, <command>systemd-vmspawn</command> will consider the machine as ready
+          immediately after creation.  In either case, <command>systemd-vmspawn</command> sends its own
+          readiness notification to its manager after the spawned VM is ready. For more details about
+          notifications see
+          <citerefentry><refentrytitle>sd_notify</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
+
+          <para>Defaults to true. (Note that this is unlike the option of the same name to
+          <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+          that defaults to false.)</para>
+
+          <xi:include href="version-info.xml" xpointer="v258"/></listitem>
+        </varlistentry>
+      </variablelist>
+    </refsect2>
+
     <refsect2>
       <title>System Identity Options</title>
 
index cc26309317b95b7392232fa8d1d81220a1f678f5..0797676bf94bddb581862f7cfa2c3c4bee2134c5 100644 (file)
@@ -523,24 +523,6 @@ static int parse_argv(int argc, char *argv[]) {
                         arg_efi_nvram_state_mode = STATE_PATH;
                         break;
 
-                OPTION_LONG("linux", "PATH", "Specify the linux kernel for direct kernel boot"):
-                        r = parse_path_argument(opts.arg, /* suppress_root= */ false, &arg_linux);
-                        if (r < 0)
-                                return r;
-                        break;
-
-                OPTION_LONG("initrd", "PATH", "Specify the initrd for direct kernel boot"): {
-                        _cleanup_free_ char *initrd_path = NULL;
-                        r = parse_path_argument(opts.arg, /* suppress_root= */ false, &initrd_path);
-                        if (r < 0)
-                                return r;
-
-                        r = strv_consume(&arg_initrds, TAKE_PTR(initrd_path));
-                        if (r < 0)
-                                return log_oom();
-                        break;
-                }
-
                 OPTION_LONG("secure-boot", "BOOL|auto", "Enable searching for firmware supporting SecureBoot"): {
                         int b;
 
@@ -671,6 +653,24 @@ static int parse_argv(int argc, char *argv[]) {
 
                 OPTION_GROUP("Execution"): {}
 
+                OPTION_LONG("linux", "PATH", "Specify the linux kernel for direct kernel boot"):
+                        r = parse_path_argument(opts.arg, /* suppress_root= */ false, &arg_linux);
+                        if (r < 0)
+                                return r;
+                        break;
+
+                OPTION_LONG("initrd", "PATH", "Specify the initrd for direct kernel boot"): {
+                        _cleanup_free_ char *initrd_path = NULL;
+                        r = parse_path_argument(opts.arg, /* suppress_root= */ false, &initrd_path);
+                        if (r < 0)
+                                return r;
+
+                        r = strv_consume(&arg_initrds, TAKE_PTR(initrd_path));
+                        if (r < 0)
+                                return log_oom();
+                        break;
+                }
+
                 OPTION('s', "smbios11", "STRING", "Pass an arbitrary SMBIOS Type #11 string to the VM"):
                         if (isempty(opts.arg)) {
                                 arg_smbios11 = strv_free(arg_smbios11);