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 if [ "${BUILD_SYSTEM}" = "Debian" ]
47 # true hack ! -- nohar
48 chroot /root cp /usr/share/gdm/defaults.conf /etc/gdm/gdm.conf
51 # Configure GDM autologin
53 sed -i -e "s/^AutomaticLoginEnable=.*\$/AutomaticLoginEnable=true/" \
54 -e "s/^AutomaticLogin=.*\$/AutomaticLogin=$USERNAME/" \
55 -e "s/^TimedLoginEnable=.*\$/TimedLoginEnable=true/" \
56 -e "s/^TimedLogin=.*\$/TimedLogin=$USERNAME/" \
57 -e "s/^TimedLoginDelay=.*\$/TimedLoginDelay=10/" \
61 if [ -f /root/etc/kde3/kdm/kdmrc ]
63 # Configure KDM autologin
64 sed -i -r -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
65 -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=$USERNAME/" \
66 -e "s/^#?AutoReLogin=.*\$/AutoReLogin=true/" \
67 /root/etc/kde3/kdm/kdmrc