Skip to content

Commit

Permalink
Make sure user provided cmdline is always last
Browse files Browse the repository at this point in the history
Replaces #3158
  • Loading branch information
DaanDeMeyer committed Nov 12, 2024
1 parent 03420ea commit 29fcbc2
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions mkosi/qemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -1346,11 +1339,13 @@ def add_virtiofs_mount(
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",
Expand Down

0 comments on commit 29fcbc2

Please sign in to comment.