]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Configure both hvc0 and ttyS0
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 18 Apr 2023 11:53:35 +0000 (13:53 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 19 Apr 2023 10:45:20 +0000 (12:45 +0200)
When hvc0 doesn't work for some reason, we can switch back to ttyS0
and still have a working console.

mkosi/__init__.py

index 6a07c90b0e4f9c83ac43ae4e66e882e59ddd9ec7..465fe7c876c9951b27db95589ed8b07d5791bec1 100644 (file)
@@ -372,6 +372,8 @@ def configure_autologin(state: MkosiState) -> None:
     with complete_step("Setting up autologin…"):
         add_dropin_config_from_resource(state.root, "console-getty.service", "autologin",
                                         "mkosi.resources", "console_getty_autologin.conf")
+        add_dropin_config_from_resource(state.root, "serial-getty@ttyS0.service", "autologin",
+                                        "mkosi.resources", "serial_getty_autologin.conf")
         add_dropin_config_from_resource(state.root, "serial-getty@hvc0.service", "autologin",
                                         "mkosi.resources", "serial_getty_autologin.conf")
         add_dropin_config_from_resource(state.root, "getty@tty1.service", "autologin",
@@ -1101,6 +1103,9 @@ def load_kernel_command_line_extra(args: argparse.Namespace) -> list[str]:
         f"systemd.tty.term.hvc0={os.getenv('TERM', 'vt220')}",
         f"systemd.tty.columns.hvc0={columns}",
         f"systemd.tty.rows.hvc0={lines}",
+        f"systemd.tty.term.ttyS0={os.getenv('TERM', 'vt220')}",
+        f"systemd.tty.columns.ttyS0={columns}",
+        f"systemd.tty.rows.ttyS0={lines}",
         "console=hvc0",
     ]