From d33487cbeac581d2ce91d8372f5feb1e2b5b7e3a Mon Sep 17 00:00:00 2001 From: Simon Long Date: Mon, 14 Jan 2019 15:18:04 +0000 Subject: [PATCH] Update console autologin method for Buster --- raspi-config | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/raspi-config b/raspi-config index e08d8e1..4891a05 100755 --- a/raspi-config +++ b/raspi-config @@ -951,16 +951,22 @@ do_boot_behaviour() { B1*) systemctl set-default multi-user.target ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service + rm /etc/systemd/system/getty@tty1.service.d/autologin.conf ;; B2*) systemctl set-default multi-user.target - sed /etc/systemd/system/autologin@.service -i -e "s#^ExecStart=-/sbin/agetty --autologin [^[:space:]]*#ExecStart=-/sbin/agetty --autologin $SUDO_USER#" - ln -fs /etc/systemd/system/autologin@.service /etc/systemd/system/getty.target.wants/getty@tty1.service + 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 $SUDO_USER --noclear %I $TERM +EOF ;; B3*) if [ -e /etc/init.d/lightdm ]; then systemctl set-default graphical.target ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service + rm /etc/systemd/system/getty@tty1.service.d/autologin.conf sed /etc/lightdm/lightdm.conf -i -e "s/^autologin-user=.*/#autologin-user=/" disable_raspi_config_at_boot else @@ -971,8 +977,12 @@ do_boot_behaviour() { B4*) if [ -e /etc/init.d/lightdm ]; then systemctl set-default graphical.target - ln -fs /etc/systemd/system/autologin@.service /etc/systemd/system/getty.target.wants/getty@tty1.service - sed /etc/systemd/system/autologin@.service -i -e "s#^ExecStart=-/sbin/agetty --autologin [^[:space:]]*#ExecStart=-/sbin/agetty --autologin $SUDO_USER#" + 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 $SUDO_USER --noclear %I $TERM +EOF sed /etc/lightdm/lightdm.conf -i -e "s/^\(#\|\)autologin-user=.*/autologin-user=$SUDO_USER/" disable_raspi_config_at_boot else