fix displaymanagers; changed to match new structure

This commit is contained in:
udeved 2015-01-20 23:26:06 +01:00
parent cca9044502
commit 46ebe5dfd8
3 changed files with 17 additions and 55 deletions

View file

@ -61,7 +61,6 @@ configure_services_live(){
if [[ -f $1/etc/init.d/$svc ]]; then
msg2 "Setting $svc ..."
[[ ! -d $1/etc/runlevels/{boot,default} ]] && mkdir -p $1/etc/runlevels/{boot,default}
# ln -sf /etc/init.d/$svc $1/etc/runlevels/default/$svc
chroot $1 rc-update add $svc default &> /dev/null
fi
done
@ -81,7 +80,6 @@ configure_services(){
if [[ -f $1/etc/init.d/$svc ]]; then
msg2 "Setting $svc ..."
[[ ! -d $1/etc/runlevels/{boot,default} ]] && mkdir -p $1/etc/runlevels/{boot,default}
# ln -sf /etc/init.d/$svc $1/etc/runlevels/default/$svc
chroot $1 rc-update add $svc default &> /dev/null
fi
done
@ -165,10 +163,6 @@ configure_displaymanager(){
sed -i -e 's/^.*user-session=.*/user-session=i3/' $1/etc/lightdm/lightdm.conf
fi
;;
'kdm')
sed -i -e "s/^.*AutoLoginUser=.*/AutoLoginUser=${username}/" $1/usr/share/config/kdm/kdmrc
sed -i -e "s/^.*AutoLoginPass=.*/AutoLoginPass=${password}/" $1/usr/share/config/kdm/kdmrc
;;
'gdm')
configure_accountsservice $1 "gdm"
;;
@ -196,7 +190,6 @@ configure_displaymanager(){
fi
;;
'sddm')
sed -i -e "s|^User=.*|User=${username}|" $1/etc/sddm.conf
if [ -e "$1/usr/bin/startxfce4" ] ; then
sed -i -e 's|^Session=.*|Session=xfce.desktop|' $1/etc/sddm.conf
fi
@ -223,7 +216,6 @@ configure_displaymanager(){
fi
;;
'lxdm')
sed -i -e "s/^.*autologin=.*/autologin=${username}/" $1/etc/lxdm/lxdm.conf
if [ -e "$1/usr/bin/openbox-session" ] ; then
sed -i -e 's|^.*session=.*|session=/usr/bin/openbox-session|' $1/etc/lxdm/lxdm.conf
fi
@ -253,7 +245,6 @@ configure_displaymanager(){
fi
;;
*)
msg2 "No displaymanager used"
break
;;
esac
@ -262,7 +253,6 @@ configure_displaymanager(){
local _conf_xdm='DISPLAYMANAGER="'${displaymanager}'"'
sed -i -e "s|^.*DISPLAYMANAGER=.*|${_conf_xdm}|" $1/etc/conf.d/xdm
[[ ! -d $1/etc/runlevels/default ]] && mkdir -p $1/etc/runlevels/default
# ln -sf /etc/init.d/xdm $1/etc/runlevels/default/xdm
chroot $1 rc-update add xdm default &> /dev/null
else
if [ -e $1/etc/plymouth/plymouthd.conf ] ; then
@ -420,9 +410,7 @@ configure_desktop_image(){
configure_livecd_image(){
msg3 "Configuring [livecd-image]"
# configure_displaymanager "${work_dir}/livecd-image"
configure_hostname "${work_dir}/livecd-image"
configure_hosts "${work_dir}/livecd-image"
@ -434,9 +422,7 @@ configure_livecd_image(){
configure_calamares "${work_dir}/livecd-image"
configure_services_live "${work_dir}/livecd-image"
# configure_plymouth "${work_dir}/livecd-image"
msg3 "Done configuring [livecd-image]"
}

View file

@ -360,18 +360,6 @@ get_release(){
echo $(cat /etc/lsb-release | grep DISTRIB_RELEASE | cut -d= -f2)
}
# configure_live_installer_live(){
# local conf_file="/etc/live-installer/install.conf"
# if [[ -f "$conf_file" ]] ; then
# echo "configure live-installer" >> /tmp/livecd.log
# local release=$(get_release)
# sed -i "s|_version_|$release|g" $conf_file
# sed -i "s|_kernel_|$manjaro_kernel|g" $conf_file
# configure_live_image "$conf_file"
# fi
#
# }
configure_thus_live(){
local conf_file="/etc/thus.conf"
if [[ -f "$conf_file" ]];then
@ -398,27 +386,18 @@ configure_calamares_live(){
fi
}
fix_kdm(){
xdg-icon-resource forceupdate --theme hicolor &> /dev/null
[[ -e "/usr/bin/update-desktop-database" ]] && update-desktop-database -q
}
fix_lightdm(){
groupadd -r autologin
gpasswd -a ${username} autologin &> /dev/null
getent group lightdm > /dev/null 2>&1 || groupadd -g 620 lightdm
getent passwd lightdm > /dev/null 2>&1 || useradd -c 'LightDM Display Manager' -u 620 -g lightdm -d /run/lightdm -s /usr/bin/nologin lightdm
passwd -l lightdm > /dev/null
mkdir -p /run/lightdm > /dev/null
mkdir -p /var/lib/lightdm-data
chown lightdm:lightdm /run/lightdm
sed -i -e 's/^.*autologin-user-timeout=.*/autologin-user-timeout=0/' /etc/lightdm/lightdm.conf
sed -i -e "s/^.*autologin-user=.*/autologin-user=${username}/" /etc/lightdm/lightdm.conf
configure_displaymanager_live(){
if [[ -f /usr/bin/lightdm ]];then
sed -i -e 's/^.*autologin-user-timeout=.*/autologin-user-timeout=0/' /etc/lightdm/lightdm.conf
sed -i -e "s/^.*autologin-user=.*/autologin-user=${username}/" /etc/lightdm/lightdm.conf
elif [[ -f /usr/bin/kdm ]];then
sed -i -e "s/^.*AutoLoginUser=.*/AutoLoginUser=${username}/" /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
[[ -e "/usr/bin/update-desktop-database" ]] && update-desktop-database -q
elif [[ -f /usr/bin/sddm ]];then
sed -i -e "s|^User=.*|User=${username}|" $1/etc/sddm.conf
elif [[ -f /usr/bin/lxdm ]];then
sed -i -e "s/^.*autologin=.*/autologin=${username}/" /etc/lxdm/lxdm.conf
fi
}

View file

@ -54,8 +54,7 @@ DESTDIR="/"
install_localization_live "${DESTDIR}"
# [[ -f /usr/bin/lightdm ]] && fix_lightdm
[[ -f /usr/bin/kdm ]] && fix_kdm
configure_displaymanager_live
echo "configure root password" >> /tmp/livecd.log
@ -64,8 +63,6 @@ cp -a /etc/skel/. /root/
configure_machine_id_live
# configure_live_installer_live
configure_thus_live
configure_calamares_live