5 # initramfs-tools header
21 # live-initramfs header
23 . /scripts/live-functions
25 log_begin_msg "Setting up automatic login..."
27 # live-initramfs script
29 if [ -n "${NOXAUTOLOGIN}" ]
34 # chroot needed to handle symlinks correctly
35 if chroot /root [ -f /etc/gdm/gdm-cdd.conf ]
37 GDMCONF=/etc/gdm/gdm-cdd.conf
39 GDMCONF=/etc/gdm/gdm.conf
42 # chroot needed to handle symlinks correctly
43 if chroot /root [ -f ${GDMCONF} ]
45 # true hack ! -- nohar
46 chroot /root cp /usr/share/gdm/defaults.conf /etc/gdm/gdm.conf
48 # Configure GDM autologin
50 sed -i -e "s/^AutomaticLoginEnable=.*\$/AutomaticLoginEnable=true/" \
51 -e "s/^AutomaticLogin=.*\$/AutomaticLogin=${USERNAME}/" \
52 -e "s/^TimedLoginEnable=.*\$/TimedLoginEnable=true/" \
53 -e "s/^TimedLogin=.*\$/TimedLogin=${USERNAME}/" \
54 -e "s/^TimedLoginDelay=.*\$/TimedLoginDelay=10/" \
58 if [ -d /root/etc/default/kdm.d/ ]
61 cat >> /root/etc/default/kdm.d/live-autologin << EOF
62 AUTOLOGINUSER=${USERNAME}
67 elif [ -f /root/etc/kde3/kdm/kdmrc ]
69 # Configure KDM autologin
70 sed -i -r -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
71 -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=${USERNAME}/" \
72 -e "s/^#?AutoReLogin=.*\$/AutoReLogin=true/" \
73 /root/etc/kde3/kdm/kdmrc
74 elif [ -f /root/usr/lib/kde4/etc/kde4/kdm/kdmrc ]
76 # Configure KDM-KDE4 autologin
77 sed -i -r -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
78 -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=$USERNAME/" \
79 -e "s/^#?AutoReLogin=.*\$/AutoReLogin=true/" \
80 /root/usr/lib/kde4/etc/kde4/kdm/kdmrc