From c85213f2de73bd106607382fe5bac7996e658398 Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Thu, 18 Jul 2024 13:10:11 +0300 Subject: [PATCH] Fix gui module to boot to graphical.target and work with rpi-imager https://github.com/RPi-Distro/pi-gen/issues/780 --- src/modules/gui/end_chroot_script | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/modules/gui/end_chroot_script b/src/modules/gui/end_chroot_script index 7c734db..463252f 100755 --- a/src/modules/gui/end_chroot_script +++ b/src/modules/gui/end_chroot_script @@ -11,9 +11,19 @@ install_cleanup_trap sed -i 's/#user-session=.*/user-session=guisession/g' /etc/lightdm/lightdm.conf # This is now down as a systemd service to handle username conf on boot sed -i 's/#autologin-user=.*/autologin-user=UID_1000_PLACEHOLDER/g' /etc/lightdm/lightdm.conf + systemctl enable update_lightdm_conf.service +# cancel-rename overrides auto login see https://github.com/RPi-Distro/pi-gen/issues/780 +if [ "${BASE_DISTRO}" == "raspbian" ] || [ "${BASE_DISTRO}" == "raspios64" ] || [ "${BASE_DISTRO}" == "raspios" ]; then + mkdir -p /var/lib/userconf-pi + touch /var/lib/userconf-pi/autologin +fi + # set the gui to run the main script of the GUI session sed -i "s@GUI_SESSION_PLACEHOLDEFR@${GUI_STARTUP_SCRIPT}@g" /opt/custompios/scripts/start_gui +# Set the boot target to use a gui +systemctl set-default graphical.target + rm -r /usr/sbin/policy-rc.d || true