|
@@ -0,0 +1,34 @@
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+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
|