From: Daan De Meyer Date: Tue, 3 Oct 2023 08:08:41 +0000 (+0200) Subject: Always set the ttyS0 credentials X-Git-Tag: v18~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd9795657742501a736f1079965f84f6ec247cd5;p=thirdparty%2Fmkosi.git Always set the ttyS0 credentials Even when booting with GUI, we might still have a serial terminal, so let's always set the serial terminal specific size credentials as these don't affect the GUI terminals at all. --- diff --git a/mkosi/config.py b/mkosi/config.py index 336d94d39..ffe4426ad 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -2268,11 +2268,15 @@ 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 = [ # 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. "module_blacklist=vmw_vmci", + f"systemd.tty.term.ttyS0={os.getenv('TERM', 'vt220')}", + f"systemd.tty.columns.ttyS0={columns}", + f"systemd.tty.rows.ttyS0={lines}", ] if not any(s.startswith("ip=") for s in args.kernel_command_line_extra): @@ -2294,9 +2298,6 @@ def load_kernel_command_line_extra(args: argparse.Namespace) -> list[str]: 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", ]