0.7.9 Linux release from ayufan
#27
Oh, woops.  But look at the source of raspi-config, the autologin parts. https://github.com/RPi-Distro/raspi-config  Armbian has something similar, maybe derived from it.  You might even be able to copy out the code and make it run, it's just a bash script.  Or manually do what the script does.

There are 2 different autologin scenarios for console and GUI.  Checking for autologin:
Code:
get_autologin() {
 if [ $(get_boot_cli) -eq 0 ]; then
   # booting to CLI - check the autologin in getty or initd */
   if grep -q autologin /etc/systemd/system/getty.target.wants/getty@tty1.servi
ce ; then  
     echo 0
   else
     echo 1
   fi
 else    
   # booting to desktop - check the autologin for lightdm */
   if grep -q "^autologin-user=" /etc/lightdm/lightdm.conf ; then
     echo 0
   else
     echo 1
   fi
 fi
}

Setting autologin:
Code:
     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/lightdm/lightdm.conf -i -e "s/^\(#\|\)autologin-user=.*/autologin-user=$SUDO_USER/"
         disable_raspi_config_at_boot
       else
         whiptail --msgbox "Do 'sudo apt-get install lightdm' to allow configuration of boot to desktop" 20 60 2
         return 1
       fi
       ;;
     *)
       whiptail --msgbox "Programmer error, unrecognised boot option" 20 60 2
       return 1
That $SUDO_USER gets populated with who runs sudo.  If you're already root and you run raspi-config without sudo the user name is an empty string, it doesn't work.  But root can run sudo just fine.  Except root autologin is blocked elsewhere.


Messages In This Thread
0.7.9 Linux release from ayufan - by Luke - 07-24-2018, 03:31 PM
RE: 0.7.8 Linux release from ayufan - by ab1jx - 07-24-2018, 04:52 PM
RE: 0.7.8 Linux release from ayufan - by Luke - 07-25-2018, 03:52 AM
RE: 0.7.8 Linux release from ayufan - by ab1jx - 07-27-2018, 06:09 PM
RE: 0.7.8 Linux release from ayufan - by ab1jx - 07-28-2018, 06:36 AM
RE: 0.7.9 Linux release from ayufan - by Luke - 07-30-2018, 05:01 AM
RE: 0.7.9 Linux release from ayufan - by ab1jx - 08-05-2018, 02:37 PM
RE: 0.7.9 Linux release from ayufan - by ab1jx - 08-06-2018, 09:45 AM
RE: 0.7.9 Linux release from ayufan - by ab1jx - 08-06-2018, 11:17 AM
RE: 0.7.9 Linux release from ayufan - by lucho - 08-07-2018, 03:41 AM
RE: 0.7.9 Linux release from ayufan - by lucho - 08-09-2018, 05:08 AM
RE: 0.7.9 Linux release from ayufan - by ab1jx - 08-07-2018, 04:45 PM
RE: 0.7.9 Linux release from ayufan - by ab1jx - 08-07-2018, 08:15 PM
RE: 0.7.9 Linux release from ayufan - by ab1jx - 08-07-2018, 06:35 PM
RE: 0.7.9 Linux release from ayufan - by ab1jx - 08-07-2018, 06:56 PM
RE: 0.7.9 Linux release from ayufan - by ab1jx - 08-08-2018, 01:44 PM
RE: 0.7.9 Linux release from ayufan - by Bullet64 - 08-08-2018, 09:24 PM
RE: 0.7.9 Linux release from ayufan - by festor89 - 11-16-2018, 03:54 PM
RE: 0.7.9 Linux release from ayufan - by festor89 - 11-17-2018, 02:35 AM
RE: 0.7.9 Linux release from ayufan - by Bullet64 - 11-17-2018, 03:26 AM
RE: 0.7.9 Linux release from ayufan - by nuumio - 11-19-2018, 08:04 AM
RE: 0.7.9 Linux release from ayufan - by nuumio - 12-04-2018, 02:03 PM
RE: 0.7.9 Linux release from ayufan - by Luke - 02-25-2019, 02:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  irradium (based on crux linux) RockPro64 riscv64, aarch64 mara 7 1,863 11-20-2024, 03:53 PM
Last Post: mara
Exclamation Ethernet regression on Linux Kernel 6.5.4? Deathcrow 3 1,481 09-22-2023, 04:27 AM
Last Post: diederik
  Installing CH431SER on Ayufan 0.9.14: gitlab-ci-linux-build-159 Thisone 4 2,264 07-14-2023, 04:22 AM
Last Post: hunderteins
  GPIO on Ayufan 0.9.14 Build Thisone 7 3,459 04-23-2023, 01:32 PM
Last Post: diederik
  Linux laptop does not detect the board when plugged in via USB soupy 1 4,488 04-13-2023, 03:01 AM
Last Post: Reynold Grady
  RockPro64 linux console video mode callegar 0 1,129 09-06-2022, 02:32 PM
Last Post: callegar
Brick Maintained Linux booting from eMMC ootoovak 10 9,893 04-30-2022, 03:57 PM
Last Post: TRS-80
  Armbian 22.02 Release Announcement TRS-80 0 1,406 02-28-2022, 05:08 PM
Last Post: TRS-80
  How I Got Fedora Linux to Boot From eMMC (or microSD, for that matter) whitecat23 4 5,367 01-03-2022, 10:32 AM
Last Post: whitecat23
  Compiling ayufan mainline - DT-overlay missing Mentaluproar 0 1,676 07-24-2021, 09:46 PM
Last Post: Mentaluproar

Forum Jump:


Users browsing this thread: 3 Guest(s)