[util-livecd] use pam-autologin for lightdm on openrc

This commit is contained in:
udeved 2015-05-09 01:37:24 +02:00 committed by Ramon Buldó
parent 1663a55289
commit 73d6b469e5

View file

@ -421,18 +421,21 @@ configure_user_root(){
configure_displaymanager(){ configure_displaymanager(){
if [[ -f /usr/bin/lightdm ]];then if [[ -f /usr/bin/lightdm ]];then
gpasswd -a ${username} autologin &> /dev/null gpasswd -a ${username} autologin &> /dev/null
# sed -i -e 's/^.*autologin-user-timeout=.*/autologin-user-timeout=0/' /etc/lightdm/lightdm.conf # hopefully fixes autologin on openrc livecd
if [[ -d /run/openrc ]];then
sed -i -e 's/^.*pam-autologin-service=.*/pam-autologin-service=lightdm-autologin/' /etc/lightdm/lightdm.conf
fi
sed -i -e "s/^.*autologin-user=.*/autologin-user=${username}/" /etc/lightdm/lightdm.conf sed -i -e "s/^.*autologin-user=.*/autologin-user=${username}/" /etc/lightdm/lightdm.conf
elif [[ -f /usr/bin/kdm ]];then elif [[ -f /usr/bin/kdm ]];then
sed -i -e "s/^.*AutoLoginUser=.*/AutoLoginUser=${username}/" /usr/share/config/kdm/kdmrc sed -i -e "s/^.*AutoLoginUser=.*/AutoLoginUser=${username}/" /usr/share/config/kdm/kdmrc
sed -i -e "s/^.*AutoLoginPass=.*/AutoLoginPass=${password}/" /usr/share/config/kdm/kdmrc sed -i -e "s/^.*AutoLoginPass=.*/AutoLoginPass=${password}/" /usr/share/config/kdm/kdmrc
xdg-icon-resource forceupdate --theme hicolor &> /dev/null xdg-icon-resource forceupdate --theme hicolor &> /dev/null
[[ -e "/usr/bin/update-desktop-database" ]] && update-desktop-database -q [[ -e "/usr/bin/update-desktop-database" ]] && update-desktop-database -q
elif [[ -f /usr/bin/sddm ]];then elif [[ -f /usr/bin/sddm ]];then
sed -i -e "s|^User=.*|User=${username}|" /etc/sddm.conf sed -i -e "s|^User=.*|User=${username}|" /etc/sddm.conf
elif [[ -f /usr/bin/lxdm ]];then elif [[ -f /usr/bin/lxdm ]];then
sed -i -e "s/^.*autologin=.*/autologin=${username}/" /etc/lxdm/lxdm.conf sed -i -e "s/^.*autologin=.*/autologin=${username}/" /etc/lxdm/lxdm.conf
elif [[ -f /usr/bin/gdm ]];then elif [[ -f /usr/bin/gdm ]];then
sed -i -e "s/^.*AutomaticLogin=.*/AutomaticLogin=${username}/" /etc/gdm/custom.conf sed -i -e "s/^.*AutomaticLogin=.*/AutomaticLogin=${username}/" /etc/gdm/custom.conf
fi fi
} }