RPi-Distro / pi-gen

Tool used to create the official Raspberry Pi OS images
BSD 3-Clause "New" or "Revised" License
2.58k stars 1.61k forks source link

Firstrun.sh overrides autologin of gui because of cancel-rename. #780

Closed guysoft closed 1 month ago

guysoft commented 1 month ago

Hey, I have a distribution that uses autologin to a special gui session as default (fullapgeos). I can see that when flashed with a custom user using rpi-imager, firstrun.sh runs cancel-rename, which then runs:

/usr/bin/raspi-config nonint do_boot_behaviour B3

Is there a way that user changing the default user wont break the auto-login? The user does not select that in any place that I can see in the imager.

This is the pstree that help me catch this. (i stuck code in raspi-config to figure out what is triggering it on first boot):

systemd,1
  `-firstrun.sh,633 /boot/firmware/firstrun.sh
      `-userconf,673 /usr/lib/userconf-pi/userconf boop $5$4SfZSLq/Pi$NVNp/gkGMNZSlXf5kU8HHKkDsyEBBeDM2ZUBhqTKcC3
          `-cancel-rename,710 /usr/bin/cancel-rename boop
              `-raspi-config,731 /usr/bin/raspi-config nonint do_boot_behaviour B3
                  `-pstree,758 -s -a -p 710
guysoft commented 1 month ago

Ok I see:

    if [ -f /var/lib/userconf-pi/autologin ] || [ "$IMG_VER" == "2022-04-04" ]; then
        SUDO_USER="$1" raspi-config nonint do_boot_behaviour B4
    else
        SUDO_USER="$1" raspi-config nonint do_boot_behaviour B3
    fi

I guess I can touch that file

guysoft commented 1 month ago

Might be related: https://github.com/RPi-Distro/pi-gen/issues/614