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 [ -z "${NOXAUTOLOGIN}" ]
32 # chroot needed to handle symlinks correctly
33 if chroot /root [ -f /etc/gdm/gdm-cdd.conf ]; then
34 GDMCONF=/etc/gdm/gdm-cdd.conf
36 GDMCONF=/etc/gdm/gdm.conf
39 # chroot needed to handle symlinks correctly
40 if chroot /root [ -f ${GDMCONF} ]; then
41 if [ "${BUILD_SYSTEM}" = "Debian" ]; then
42 # true hack ! -- nohar
43 chroot /root cp /usr/share/gdm/defaults.conf /etc/gdm/gdm.conf
46 # Configure GDM autologin
48 -e "s/^AutomaticLoginEnable=.*\$/AutomaticLoginEnable=true/" \
49 -e "s/^AutomaticLogin=.*\$/AutomaticLogin=$USERNAME/" \
50 -e "s/^TimedLoginEnable=.*\$/TimedLoginEnable=true/" \
51 -e "s/^TimedLogin=.*\$/TimedLogin=$USERNAME/" \
52 -e "s/^TimedLoginDelay=.*\$/TimedLoginDelay=10/" \
56 if [ -f /root/etc/kde3/kdm/kdmrc ]; then
57 # Configure KDM autologin
59 -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
60 -e "s/^#?AutoLoginUser=.*\$/AutoLoginUser=$USERNAME/" \
61 -e "s/^#?AutoReLogin=.*\$/AutoReLogin=true/" \
62 /root/etc/kde3/kdm/kdmrc
67 if chroot /root /usr/bin/which kpersonalizer >/dev/null; then
68 # Disable first-login wizard for KDE
69 if [ ! -f /root/etc/kde3/kpersonalizerrc ]; then
70 cat > /root/etc/kde3/kpersonalizerrc <<EOF
75 echo "I'm not smart enough to disable kpersonalizer startup" >&2
76 echo "Because kpersonalizerrc already exists" >&2