From bc2505a5340cf2404d1d5c26acdef5a4d0aece24 Mon Sep 17 00:00:00 2001 From: BJ Dweck Date: Tue, 1 Sep 2020 19:36:31 +0200 Subject: [PATCH] Added autologin --- stage2/05-autologin/00-run.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 stage2/05-autologin/00-run.sh diff --git a/stage2/05-autologin/00-run.sh b/stage2/05-autologin/00-run.sh new file mode 100755 index 0000000..07b3b03 --- /dev/null +++ b/stage2/05-autologin/00-run.sh @@ -0,0 +1,15 @@ +#!/bin/bash -e + +on_chroot << ENDCHROOT + +systemctl set-default multi-user.target + +ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service + +cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin ${FIRST_USER_NAME} --noclear %I \\\$TERM +EOF + +ENDCHROOT