123456789101112131415161718192021222324252627282930313233343536 |
- #!/bin/sh
- type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
- USERNAME=$(getarg live.user)
- [ -z "$USERNAME" ] && USERNAME=anon
- if [ -d ${NEWROOT}/etc/gdm ]; then
- GDMCustomFile=${NEWROOT}/etc/gdm/custom.conf
- AutologinParameters="AutomaticLoginEnable=true\nAutomaticLogin=$USERNAME"
-
- if ! `grep -qs 'AutomaticLoginEnable' $GDMCustomFile` ; then
- if ! `grep -qs '\[daemon\]' $GDMCustomFile` ; then
- echo '[daemon]' >> $GDMCustomFile
- fi
- sed -i "s/\[daemon\]/\[daemon\]\n$AutologinParameters/" $GDMCustomFile
- fi
- fi
- if [ -r ${NEWROOT}/etc/lightdm.conf ]; then
- sed -i -e "s|^\#\(default-user=\).*|\1$USERNAME|" \
- ${NEWROOT}/etc/lightdm.conf
- sed -i -e "s|^\#\(default-user-timeout=\).*|\10|" \
- ${NEWROOT}/etc/lightdm.conf
- fi
- if [ -r ${NEWROOT}/etc/lxdm/lxdm.conf ]; then
- sed -i -e "s|^\#\# \(autologin=\).*|\1$USERNAME|" \
- ${NEWROOT}/etc/lxdm/lxdm.conf
- fi
|