]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Make sure user provided cmdline is always last
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 11 Nov 2024 15:21:04 +0000 (16:21 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 14 Nov 2024 13:00:01 +0000 (14:00 +0100)
Replaces #3158

mkosi/qemu.py

index 667682d86d987c6a85bb02c9f830e83892002f9c..ba96567a7e426fdd7c468cff02d5c0b3c7ad9a4e 100644 (file)
@@ -1185,18 +1185,11 @@ def run_qemu(args: Args, config: Config) -> None:
 
         apply_runtime_size(config, fname)
 
-        if kernel and (
-            KernelType.identify(config, kernel) != KernelType.uki
-            or not config.architecture.supports_smbios(firmware)
-        ):
-            kcl = config.kernel_command_line + finalize_kernel_command_line_extra(config)
-        else:
-            kcl = finalize_kernel_command_line_extra(config)
-
+        kcl = []
         if kernel:
             cmdline += ["-kernel", kernel]
 
-            if any(s.startswith("root=") for s in kcl):
+            if any(s.startswith("root=") for s in finalize_kernel_command_line_extra(config)):
                 pass
             elif config.output_format == OutputFormat.disk:
                 # We can't rely on gpt-auto-generator when direct kernel booting so synthesize a root=
@@ -1346,11 +1339,13 @@ def run_qemu(args: Args, config: Config) -> None:
             elif kernel:
                 kcl += [f"systemd.set_credential_binary={k}:{payload}"]
 
+        kcl += finalize_kernel_command_line_extra(config)
+
         if kernel and (
             KernelType.identify(config, kernel) != KernelType.uki
             or not config.architecture.supports_smbios(firmware)
         ):
-            cmdline += ["-append", " ".join(kcl)]
+            cmdline += ["-append", " ".join(config.kernel_command_line + kcl)]
         elif config.architecture.supports_smbios(firmware):
             cmdline += [
                 "-smbios",