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 [ -f /root/etc/kde3/kdm/kdmrc ]
60 # Configure KDM autologin
61 sed -i -r -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
62 -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=${USERNAME}/" \
63 -e "s/^#?AutoReLogin=.*\$/AutoReLogin=true/" \
64 /root/etc/kde3/kdm/kdmrc