From: Daan De Meyer Date: Mon, 2 Oct 2023 08:24:19 +0000 (+0200) Subject: Only add console=ttyS0 and tty sizes when QemuGui= is disabled X-Git-Tag: v18~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c393ce288c47405eba08db4f59ce7e7dd9fd5b3;p=thirdparty%2Fmkosi.git Only add console=ttyS0 and tty sizes when QemuGui= is disabled With console=ttyS0, we don't get any boot logs when running qemu in GUI mode. The tty sizes don't matter either when booting in GUI mode as Linux can figure it out itself in that scenario. --- diff --git a/mkosi/config.py b/mkosi/config.py index 8c58d8dd0..03d3698da 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -2260,16 +2260,7 @@ def load_credentials(args: argparse.Namespace) -> dict[str, str]: def load_kernel_command_line_extra(args: argparse.Namespace) -> list[str]: - columns, lines = shutil.get_terminal_size() - cmdline = [ - f"systemd.tty.term.console={os.getenv('TERM', 'vt220')}", - f"systemd.tty.columns.console={columns}", - f"systemd.tty.rows.console={lines}", - f"systemd.tty.term.ttyS0={os.getenv('TERM', 'vt220')}", - f"systemd.tty.columns.ttyS0={columns}", - f"systemd.tty.rows.ttyS0={lines}", - "console=ttyS0", # Make sure we set up networking in the VM/container. "systemd.wants=network.target", # Make sure we don't load vmw_vmci which messes with virtio vsock. @@ -2289,6 +2280,18 @@ def load_kernel_command_line_extra(args: argparse.Namespace) -> list[str]: # CD-ROMs are read-only so tell systemd to boot in volatile mode. cmdline += ["systemd.volatile=yes"] + if not args.qemu_gui: + columns, lines = shutil.get_terminal_size() + cmdline += [ + f"systemd.tty.term.console={os.getenv('TERM', 'vt220')}", + f"systemd.tty.columns.console={columns}", + f"systemd.tty.rows.console={lines}", + f"systemd.tty.term.ttyS0={os.getenv('TERM', 'vt220')}", + f"systemd.tty.columns.ttyS0={columns}", + f"systemd.tty.rows.ttyS0={lines}", + "console=ttyS0", + ] + for s in args.kernel_command_line_extra: key, sep, value = s.partition("=") if " " in value: