diff --git a/debian/changelog b/debian/changelog index fbc63d8..05aa8f5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,10 @@ -raspi-config (20220307) UNRELEASED; urgency=medium +raspi-config (20220318) UNRELEASED; urgency=medium * Remove nonint whiptail msgbox in do_overlayfs + * Update get_boot_cli + * Remove legacy autologin cruft + * Run systemctl daemon-reload after boot behaviour changes + * Make autologin changes quieter -- Serge Schneider Mon, 07 Mar 2022 09:26:38 +0000 diff --git a/debian/raspi-config.install b/debian/raspi-config.install index a286bac..81e14cf 100644 --- a/debian/raspi-config.install +++ b/debian/raspi-config.install @@ -1,4 +1,3 @@ raspi-config /usr/bin -autologin@.service /etc/systemd/system usr/ etc/ diff --git a/raspi-config b/raspi-config index 81e01f0..086e9f0 100755 --- a/raspi-config +++ b/raspi-config @@ -1076,26 +1076,20 @@ disable_raspi_config_at_boot() { } get_boot_cli() { - if systemctl get-default | grep -q multi-user ; then - echo 0 - else + if [ "$(systemctl get-default)" = graphical.target ] && systemctl is-enabled lightdm > /dev/null 2>&1; then echo 1 + else + echo 0 fi } get_autologin() { if [ $(get_boot_cli) -eq 0 ]; then # booting to CLI - # stretch or buster - is there an autologin conf file? if [ -e /etc/systemd/system/getty@tty1.service.d/autologin.conf ] ; then echo 0 else - # stretch or earlier - check the getty service symlink for autologin - if [ $(deb_ver) -le 9 ] && grep -q autologin /etc/systemd/system/getty.target.wants/getty@tty1.service ; then - echo 0 - else - echo 1 - fi + echo 1 fi else # booting to desktop - check the autologin for lightdm @@ -1390,13 +1384,11 @@ do_boot_behaviour() { if [ $? -eq 0 ]; then case "$BOOTOPT" in B1*) - systemctl set-default multi-user.target - ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service + systemctl --quiet set-default multi-user.target rm -f /etc/systemd/system/getty@tty1.service.d/autologin.conf ;; B2*) - systemctl set-default multi-user.target - ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service + systemctl --quiet set-default multi-user.target cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF [Service] ExecStart= @@ -1405,8 +1397,7 @@ 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 + systemctl --quiet set-default graphical.target rm -f /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 @@ -1417,8 +1408,7 @@ EOF ;; B4*) 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 + systemctl --quiet set-default graphical.target cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF [Service] ExecStart= @@ -1436,6 +1426,7 @@ EOF return 1 ;; esac + systemctl daemon-reload ASK_TO_REBOOT=1 fi }