From 212df1d586712bb7dc634c1bbd5f6c9800c95b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Marczewski?= Date: Wed, 6 May 2020 17:15:22 +0200 Subject: [PATCH] Enable root autologin on serial console See QubesOS/qubes-issues#5799. Use an option to agetty: https://wiki.archlinux.org/index.php/Getty#Automatic_login_to_virtual_console The --login-pause causes agetty to wait for Enter key. This is important, because otherwise the root session prevents systemd from shutting down, and probably causes other side effect. --- Makefile | 2 +- debian/qubes-core-agent.install | 1 + rpm_spec/core-agent.spec.in | 1 + vm-systemd/serial-getty@.service.d/30_qubes.conf | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 vm-systemd/serial-getty@.service.d/30_qubes.conf diff --git a/Makefile b/Makefile index 50ecad9..d15573b 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ USER_DROPIN_DIR ?= "usr/lib/systemd/user" SYSTEM_DROPINS := boot.automount chronyd.service crond.service SYSTEM_DROPINS += cups.service cups-browsed.service cups.path cups.socket ModemManager.service -SYSTEM_DROPINS += getty@tty.service +SYSTEM_DROPINS += getty@tty.service serial-getty@.service SYSTEM_DROPINS += tmp.mount SYSTEM_DROPINS += org.cups.cupsd.service org.cups.cupsd.path org.cups.cupsd.socket SYSTEM_DROPINS += systemd-random-seed.service diff --git a/debian/qubes-core-agent.install b/debian/qubes-core-agent.install index 9859458..580a532 100644 --- a/debian/qubes-core-agent.install +++ b/debian/qubes-core-agent.install @@ -88,6 +88,7 @@ lib/systemd/system/qubes-updates-proxy-forwarder@.service lib/systemd/system/qubes-updates-proxy-forwarder.socket lib/systemd/system/qubes-sync-time.service lib/systemd/system/qubes-sync-time.timer +lib/systemd/system/serial-getty@.service.d/30_qubes.conf lib/systemd/system/systemd-random-seed.service.d/30_qubes.conf lib/systemd/system/tinyproxy.service.d/30_not_needed_in_qubes_by_default.conf lib/systemd/system/tmp.mount.d/30_qubes.conf diff --git a/rpm_spec/core-agent.spec.in b/rpm_spec/core-agent.spec.in index cd0d2b4..5b642c4 100644 --- a/rpm_spec/core-agent.spec.in +++ b/rpm_spec/core-agent.spec.in @@ -869,6 +869,7 @@ The Qubes core startup configuration for SystemD init. /lib/systemd/system/ModemManager.service.d/30_qubes.conf /lib/systemd/system/NetworkManager.service.d/30_qubes.conf /lib/systemd/system/NetworkManager-wait-online.service.d/30_qubes.conf +/lib/systemd/system/serial-getty@.service.d/30_qubes.conf /lib/systemd/system/systemd-random-seed.service.d/30_qubes.conf /lib/systemd/system/systemd-timesyncd.service.d/30_qubes.conf /lib/systemd/system/tinyproxy.service.d/30_not_needed_in_qubes_by_default.conf diff --git a/vm-systemd/serial-getty@.service.d/30_qubes.conf b/vm-systemd/serial-getty@.service.d/30_qubes.conf new file mode 100644 index 0000000..dacfeb5 --- /dev/null +++ b/vm-systemd/serial-getty@.service.d/30_qubes.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin root --login-pause --keep-baud 115200,38400,9600 %I $TERM