Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
c24367f987 | |||
0ccfdbfc21 | |||
c30cd6999b | |||
e5b37014d0 | |||
96ae6855ac | |||
22014421b1 |
2
Makefile
2
Makefile
@@ -1,4 +1,4 @@
|
|||||||
VERSION = 0.5
|
VERSION = 0.7
|
||||||
|
|
||||||
PKG = live-services
|
PKG = live-services
|
||||||
TOOLS = artools
|
TOOLS = artools
|
||||||
|
@@ -16,7 +16,7 @@ load_live_config "${SYSCONFDIR}/live.conf" || load_live_config "${DATADIR}/live.
|
|||||||
|
|
||||||
livetimer=$(get_timer_ms)
|
livetimer=$(get_timer_ms)
|
||||||
detect_desktop_env
|
detect_desktop_env
|
||||||
echo "Detected ${default_desktop_executable} ${default_desktop_file}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
echo "Detected ${DEFAULT_DESKTOP_EXECUTABLE} ${DEFAULT_DESKTOP_FILE}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
||||||
|
|
||||||
livetimer=$(get_timer_ms)
|
livetimer=$(get_timer_ms)
|
||||||
CONSOLEFONT="$(kernel_cmdline vconsole.font)"
|
CONSOLEFONT="$(kernel_cmdline vconsole.font)"
|
||||||
@@ -35,10 +35,10 @@ echo "Finished localization: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
|||||||
|
|
||||||
livetimer=$(get_timer_ms)
|
livetimer=$(get_timer_ms)
|
||||||
configure_user
|
configure_user
|
||||||
echo "Created user ${username} with password ${password}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
echo "Created user ${USER_NAME} with password ${PASSWORD}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
||||||
|
|
||||||
livetimer=$(get_timer_ms)
|
livetimer=$(get_timer_ms)
|
||||||
configure_accountsservice "${username}"
|
configure_accountsservice "${USER_NAME}"
|
||||||
echo "Configured accountsservice: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
echo "Configured accountsservice: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
||||||
|
|
||||||
livetimer=$(get_timer_ms)
|
livetimer=$(get_timer_ms)
|
||||||
|
@@ -3,19 +3,19 @@
|
|||||||
xdg=$(xdg-user-dir DESKTOP)
|
xdg=$(xdg-user-dir DESKTOP)
|
||||||
src=/usr/share/applications
|
src=/usr/share/applications
|
||||||
|
|
||||||
if [[ -f $src/konversation.desktop ]]; then
|
if [[ -f $src/org.kde.konversation.desktop ]]; then
|
||||||
install -Dm755 $src/konversation.desktop \
|
install -m644 $src/org.kde.konversation.desktop \
|
||||||
$xdg/konversation.desktop
|
$xdg/org.kde.konversation.desktop
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f /usr/bin/calamares ]]; then
|
# if [[ -f /usr/bin/calamares ]]; then
|
||||||
install -Dm755 $src/calamares.desktop \
|
# cp $src/calamares.desktop \
|
||||||
$xdg/calamares.desktop
|
# $xdg/calamares.desktop
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
docs=/usr/share/doc/artix
|
docs=/usr/share/doc/artix
|
||||||
|
|
||||||
for f in {Configuration,Installation,Migration,Troubleshooting}.pdf;do
|
for f in {Configuration,Troubleshooting}.pdf;do
|
||||||
ln -s $docs/$f $xdg/$f
|
ln -s $docs/$f $xdg/$f
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -24,3 +24,5 @@ if [[ -d /run/openrc ]];then
|
|||||||
else
|
else
|
||||||
ln -s $docs/Runit.pdf $xdg/Runit.pdf
|
ln -s $docs/Runit.pdf $xdg/Runit.pdf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "live session details: /var/log/artix-live.log" > $xdg/README.txt
|
||||||
|
@@ -1,20 +1,20 @@
|
|||||||
# live session configuration
|
# live session configuration
|
||||||
|
|
||||||
# autologin
|
# autologin
|
||||||
autologin=true
|
AUTOLOGIN=true
|
||||||
|
|
||||||
# live username
|
# live username
|
||||||
username=artix
|
USER_NAME=artix
|
||||||
|
|
||||||
# live password
|
# live password
|
||||||
password=artix
|
PASSWORD=artix
|
||||||
|
|
||||||
# live group membership
|
# live group membership
|
||||||
addgroups='video,power,disk,storage,optical,network,lp,scanner,wheel'
|
ADDGROUPS='video,power,disk,storage,optical,network,lp,scanner,wheel'
|
||||||
|
|
||||||
# default_desktop_file
|
# default desktop file
|
||||||
default_desktop_file=lxqt
|
DEFAULT_DESKTOP_FILE=lxqt
|
||||||
|
|
||||||
# default_desktop_executable
|
# default desktop executable
|
||||||
default_desktop_executable=lxqt-session
|
DEFAULT_DESKTOP_EXECUTABLE=lxqt-session
|
||||||
|
|
||||||
|
@@ -50,17 +50,17 @@ load_live_config(){
|
|||||||
|
|
||||||
[[ -f $1 ]] || return 1
|
[[ -f $1 ]] || return 1
|
||||||
|
|
||||||
live_conf="$1"
|
local live_conf="$1"
|
||||||
|
|
||||||
[[ -r ${live_conf} ]] && source ${live_conf}
|
[[ -r ${live_conf} ]] && source ${live_conf}
|
||||||
|
|
||||||
[[ -z ${autologin} ]] && autologin=true
|
[[ -z ${AUTOLOGIN} ]] && AUTOLOGIN=true
|
||||||
|
|
||||||
[[ -z ${username} ]] && username="artix"
|
[[ -z ${USER_NAME} ]] && USER_NAME="artix"
|
||||||
|
|
||||||
[[ -z ${password} ]] && password="artix"
|
[[ -z ${PASSWORD} ]] && PASSWORD="artix"
|
||||||
|
|
||||||
[[ -z ${addgroups} ]] && addgroups="video,power,storage,optical,network,lp,scanner,wheel,users,audio"
|
[[ -z ${ADDGROUPS} ]] && ADDGROUPS="video,power,storage,optical,network,lp,scanner,wheel,users,audio"
|
||||||
|
|
||||||
echo "Loaded ${live_conf}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
echo "Loaded ${live_conf}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
|
||||||
|
|
||||||
@@ -68,8 +68,8 @@ load_live_config(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
is_valid_de(){
|
is_valid_de(){
|
||||||
if [[ ${default_desktop_executable} != "none" ]] && \
|
if [[ ${DEFAULT_DESKTOP_EXECUTABLE} != "none" ]] && \
|
||||||
[[ ${default_desktop_file} != "none" ]]; then
|
[[ ${DEFAULT_DESKTOP_FILE} != "none" ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
@@ -85,14 +85,14 @@ load_desktop_map(){
|
|||||||
|
|
||||||
detect_desktop_env(){
|
detect_desktop_env(){
|
||||||
local xs=/usr/share/xsessions ex=/usr/bin key val map=( $(load_desktop_map) )
|
local xs=/usr/share/xsessions ex=/usr/bin key val map=( $(load_desktop_map) )
|
||||||
default_desktop_file="none"
|
DEFAULT_DESKTOP_FILE="none"
|
||||||
default_desktop_executable="none"
|
DEFAULT_DESKTOP_EXECUTABLE="none"
|
||||||
for item in "${map[@]}";do
|
for item in "${map[@]}";do
|
||||||
key=${item%:*}
|
key=${item%:*}
|
||||||
val=${item#*:}
|
val=${item#*:}
|
||||||
if [[ -f $xs/$key.desktop ]] && [[ -f $ex/$val ]];then
|
if [[ -f $xs/$key.desktop ]] && [[ -f $ex/$val ]];then
|
||||||
default_desktop_file="$key"
|
DEFAULT_DESKTOP_FILE="$key"
|
||||||
default_desktop_executable="$val"
|
DEFAULT_DESKTOP_EXECUTABLE="$val"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ configure_accountsservice(){
|
|||||||
local path=/var/lib/AccountsService/users
|
local path=/var/lib/AccountsService/users
|
||||||
if [ -d "${path}" ] ; then
|
if [ -d "${path}" ] ; then
|
||||||
echo "[User]" > ${path}/$1
|
echo "[User]" > ${path}/$1
|
||||||
echo "XSession=${default_desktop_file}" >> ${path}/$1
|
echo "XSession=${DEFAULT_DESKTOP_FILE}" >> ${path}/$1
|
||||||
if [[ -f "/var/lib/AccountsService/icons/$1.png" ]];then
|
if [[ -f "/var/lib/AccountsService/icons/$1.png" ]];then
|
||||||
echo "Icon=/var/lib/AccountsService/icons/$1.png" >> ${path}/$1
|
echo "Icon=/var/lib/AccountsService/icons/$1.png" >> ${path}/$1
|
||||||
fi
|
fi
|
||||||
@@ -134,62 +134,62 @@ configure_displaymanager(){
|
|||||||
set_lightdm_vt
|
set_lightdm_vt
|
||||||
set_lightdm_greeter
|
set_lightdm_greeter
|
||||||
if $(is_valid_de); then
|
if $(is_valid_de); then
|
||||||
sed -i -e "s/^.*user-session=.*/user-session=$default_desktop_file/" /etc/lightdm/lightdm.conf
|
sed -i -e "s/^.*user-session=.*/user-session=$DEFAULT_DESKTOP_FILE/" /etc/lightdm/lightdm.conf
|
||||||
fi
|
fi
|
||||||
if ${autologin};then
|
if ${AUTOLOGIN};then
|
||||||
gpasswd -a ${username} autologin &> /dev/null
|
gpasswd -a ${USER_NAME} autologin &> /dev/null
|
||||||
sed -i -e "s/^.*autologin-user=.*/autologin-user=${username}/" /etc/lightdm/lightdm.conf
|
sed -i -e "s/^.*autologin-user=.*/autologin-user=${USER_NAME}/" /etc/lightdm/lightdm.conf
|
||||||
sed -i -e "s/^.*autologin-user-timeout=.*/autologin-user-timeout=0/" /etc/lightdm/lightdm.conf
|
sed -i -e "s/^.*autologin-user-timeout=.*/autologin-user-timeout=0/" /etc/lightdm/lightdm.conf
|
||||||
sed -i -e "s/^.*pam-autologin-service=.*/pam-autologin-service=lightdm-autologin/" /etc/lightdm/lightdm.conf
|
sed -i -e "s/^.*pam-autologin-service=.*/pam-autologin-service=lightdm-autologin/" /etc/lightdm/lightdm.conf
|
||||||
fi
|
fi
|
||||||
elif [[ -f /usr/bin/gdm ]];then
|
elif [[ -f /usr/bin/gdm ]];then
|
||||||
configure_accountsservice "gdm"
|
configure_accountsservice "gdm"
|
||||||
if ${autologin};then
|
if ${AUTOLOGIN};then
|
||||||
sed -i -e "s/\[daemon\]/\[daemon\]\nAutomaticLogin=${username}\nAutomaticLoginEnable=True/" /etc/gdm/custom.conf
|
sed -i -e "s/\[daemon\]/\[daemon\]\nAutomaticLogin=${USER_NAME}\nAutomaticLoginEnable=True/" /etc/gdm/custom.conf
|
||||||
fi
|
fi
|
||||||
elif [[ -f /usr/bin/sddm ]];then
|
elif [[ -f /usr/bin/sddm ]];then
|
||||||
if $(is_valid_de); then
|
if $(is_valid_de); then
|
||||||
sed -i -e "s|^Session=.*|Session=$default_desktop_file.desktop|" /etc/sddm.conf
|
sed -i -e "s|^Session=.*|Session=$DEFAULT_DESKTOP_FILE.desktop|" /etc/sddm.conf
|
||||||
fi
|
fi
|
||||||
if ${autologin};then
|
if ${AUTOLOGIN};then
|
||||||
sed -i -e "s|^User=.*|User=${username}|" /etc/sddm.conf
|
sed -i -e "s|^User=.*|User=${USER_NAME}|" /etc/sddm.conf
|
||||||
fi
|
fi
|
||||||
elif [[ -f /usr/bin/lxdm ]];then
|
elif [[ -f /usr/bin/lxdm ]];then
|
||||||
if $(is_valid_de); then
|
if $(is_valid_de); then
|
||||||
sed -i -e "s|^.*session=.*|session=/usr/bin/$default_desktop_executable|" /etc/lxdm/lxdm.conf
|
sed -i -e "s|^.*session=.*|session=/usr/bin/${DEFAULT_DESKTOP_EXECUTABLE}|" /etc/lxdm/lxdm.conf
|
||||||
fi
|
fi
|
||||||
if ${autologin};then
|
if ${AUTOLOGIN};then
|
||||||
sed -i -e "s/^.*autologin=.*/autologin=${username}/" /etc/lxdm/lxdm.conf
|
sed -i -e "s/^.*autologin=.*/autologin=${USER_NAME}/" /etc/lxdm/lxdm.conf
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
gen_pw(){
|
gen_pw(){
|
||||||
echo $(perl -e 'print crypt($ARGV[0], "password")' ${password})
|
echo $(perl -e 'print crypt($ARGV[0], "password")' ${PASSWORD})
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_user(){
|
configure_user(){
|
||||||
# set up user and password
|
# set up user and password
|
||||||
if [[ -n ${password} ]];then
|
if [[ -n ${PASSWORD} ]];then
|
||||||
useradd -m -G ${addgroups} -p $(gen_pw) -s /bin/bash ${username}
|
useradd -m -G ${ADDGROUPS} -p $(gen_pw) -s /bin/bash ${USER_NAME}
|
||||||
else
|
else
|
||||||
useradd -m -G ${addgroups} -s /bin/bash ${username}
|
useradd -m -G ${ADDGROUPS} -s /bin/bash ${USER_NAME}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
find_legacy_keymap(){
|
find_legacy_keymap(){
|
||||||
local file="${DATADIR}/kbd-model.map"
|
local file="${DATADIR}/kbd-model.map" kt="$1"
|
||||||
while read -r line || [[ -n $line ]]; do
|
while read -r line || [[ -n $line ]]; do
|
||||||
if [[ -z $line ]] || [[ $line == \#* ]]; then
|
if [[ -z $line ]] || [[ $line == \#* ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mapping=( $line ); # parses columns
|
local mapping=( $line ); # parses columns
|
||||||
if [[ ${#mapping[@]} != 5 ]]; then
|
if [[ ${#mapping[@]} != 5 ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${keytable}" != "${mapping[0]}" ]]; then
|
if [[ "$kt" != "${mapping[0]}" ]]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -212,12 +212,13 @@ write_x11_config(){
|
|||||||
local X11_MODEL="pc105"
|
local X11_MODEL="pc105"
|
||||||
local X11_VARIANT=""
|
local X11_VARIANT=""
|
||||||
local X11_OPTIONS="terminate:ctrl_alt_bksp"
|
local X11_OPTIONS="terminate:ctrl_alt_bksp"
|
||||||
|
local kt="$1"
|
||||||
|
|
||||||
find_legacy_keymap
|
find_legacy_keymap "$kt"
|
||||||
|
|
||||||
# layout not found, use KBLAYOUT
|
# layout not found, use KBLAYOUT
|
||||||
if [[ -z "$X11_LAYOUT" ]]; then
|
if [[ -z "$X11_LAYOUT" ]]; then
|
||||||
X11_LAYOUT="${keytable}"
|
X11_LAYOUT="$kt"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# create X11 keyboard layout config
|
# create X11 keyboard layout config
|
||||||
@@ -239,7 +240,7 @@ write_x11_config(){
|
|||||||
configure_language(){
|
configure_language(){
|
||||||
# hack to be able to set the locale on bootup
|
# hack to be able to set the locale on bootup
|
||||||
local lang=$(get_lang)
|
local lang=$(get_lang)
|
||||||
keytable=$(get_keytable)
|
local keytable=$(get_keytable)
|
||||||
local timezone=$(get_tz)
|
local timezone=$(get_tz)
|
||||||
# Fallback
|
# Fallback
|
||||||
# [[ -z "${lang}" ]] && lang="en_US"
|
# [[ -z "${lang}" ]] && lang="en_US"
|
||||||
@@ -257,7 +258,7 @@ configure_language(){
|
|||||||
echo "LANG=${lang}.UTF-8" > /etc/locale.conf
|
echo "LANG=${lang}.UTF-8" > /etc/locale.conf
|
||||||
ln -sf /usr/share/zoneinfo/${timezone} /etc/localtime
|
ln -sf /usr/share/zoneinfo/${timezone} /etc/localtime
|
||||||
|
|
||||||
write_x11_config
|
write_x11_config "${keytable}"
|
||||||
|
|
||||||
loadkeys "${keytable}"
|
loadkeys "${keytable}"
|
||||||
|
|
||||||
@@ -276,6 +277,6 @@ configure_swap(){
|
|||||||
|
|
||||||
configure_user_root(){
|
configure_user_root(){
|
||||||
# set up root password
|
# set up root password
|
||||||
echo "root:${password}" | chroot $1 chpasswd
|
echo "root:${PASSWORD}" | chroot $1 chpasswd
|
||||||
cp /etc/skel/.{bash_profile,bashrc,bash_logout} /root/
|
cp /etc/skel/.{bash_profile,bashrc,bash_logout} /root/
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user