create user early to make autologin work

pull/4/head
artoo 3 years ago
parent 96cc41dcde
commit dd34bf3df9
  1. 16
      bin/artix-live
  2. 10
      lib/util-live.sh

@ -6,9 +6,6 @@ LOGFILE='/var/log/artix-live.log'
load_live_config "/etc/artools/live.conf" || load_live_config "/usr/share/artools/live.conf"
detect_desktop_env
echo "Detected ${DEFAULT_DESKTOP_EXECUTABLE} ${DEFAULT_DESKTOP_FILE}" >> "${LOGFILE}"
CONSOLEFONT="$(kernel_cmdline vconsole.font)"
CONSOLEMAP="$(kernel_cmdline vconsole.font.map)"
echo "Got consolefont ${CONSOLEFONT} and consolemap ${CONSOLEMAP}" >> "${LOGFILE}"
@ -20,14 +17,19 @@ echo "Activated swap and added to fstab" >> "${LOGFILE}"
configure_language
echo "Finished localization" >> "${LOGFILE}"
configure_user 'root'
echo "Configured root user" >> "${LOGFILE}"
configure_user "${USER_NAME}"
echo "Created user ${USER_NAME} with password ${PASSWORD}" >> "${LOGFILE}"
detect_desktop_env
echo "Detected ${DEFAULT_DESKTOP_EXECUTABLE} ${DEFAULT_DESKTOP_FILE}" >> "${LOGFILE}"
configure_accountsservice "${USER_NAME}"
echo "Configured accountsservice" >> "${LOGFILE}"
configure_displaymanager
echo "Configured displaymanager" >> "${LOGFILE}"
configure_user 'root'
echo "Configured root user" >> "${LOGFILE}"
configure_user "${USER_NAME}"
echo "Created user ${USER_NAME} with password ${PASSWORD}" >> "${LOGFILE}"

@ -72,13 +72,13 @@ load_desktop_map(){
}
detect_desktop_env(){
local xs=/usr/share/xsessions ex=/usr/bin key val map=( $(load_desktop_map) )
local key val map=( $(load_desktop_map) )
DEFAULT_DESKTOP_FILE="none"
DEFAULT_DESKTOP_EXECUTABLE="none"
for item in "${map[@]}";do
key=${item%:*}
val=${item#*:}
if [[ -f $xs/$key.desktop ]] && [[ -f $ex/$val ]];then
if [[ -f /usr/share/xsessions/$key.desktop ]] && [[ -f /usr/bin/$val ]];then
DEFAULT_DESKTOP_FILE="$key"
DEFAULT_DESKTOP_EXECUTABLE="$val"
fi
@ -110,16 +110,12 @@ configure_accountsservice(){
done
}
set_lightdm_vt(){
sed -i -e 's/^.*minimum-vt=.*/minimum-vt=7/' /etc/lightdm/lightdm.conf
}
configure_displaymanager(){
# Try to detect desktop environment
# Configure display manager
if [[ -f /usr/bin/lightdm ]];then
groupadd -r autologin
set_lightdm_vt
sed -i -e 's/^.*minimum-vt=.*/minimum-vt=7/' /etc/lightdm/lightdm.conf
set_lightdm_greeter
if $(is_valid_de); then
sed -i -e "s/^.*user-session=.*/user-session=$DEFAULT_DESKTOP_FILE/" /etc/lightdm/lightdm.conf

Loading…
Cancel
Save