pull/1/head
artoo 4 years ago
parent 5a1bddf043
commit a5920b81da
  1. 0
      bin/99_zzz-portable-efi
  2. 33
      bin/artix-live
  3. 50
      bin/artix-live.in
  4. 0
      bin/desktop-items
  5. 9
      data/live.conf
  6. 2
      data/rc/gnupg-mount.in
  7. 48
      lib/util-live.sh

@ -0,0 +1,33 @@
#!/bin/sh
LOGFILE='/var/log/artix-live.log'
. /usr/lib/artools/util-live.sh
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}"
# Activate swap
configure_swap
echo "Activated swap and added to fstab" >> "${LOGFILE}"
configure_language
echo "Finished localization" >> "${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}"

@ -1,50 +0,0 @@
#!/bin/sh
LIBDIR='@libdir@'
DATADIR='@datadir@'
SYSCONFDIR='@sysconfdir@'
LOGFILE='/var/log/artix-live.log'
export LC_MESSAGES=C
export LANG=C
livetimer=$(date +%s%3N)
[[ -r ${LIBDIR}/util-live.sh ]] && source ${LIBDIR}/util-live.sh
load_live_config "${SYSCONFDIR}/live.conf" || load_live_config "${DATADIR}/live.conf"
livetimer=$(get_timer_ms)
detect_desktop_env
echo "Detected ${DEFAULT_DESKTOP_EXECUTABLE} ${DEFAULT_DESKTOP_FILE}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
livetimer=$(get_timer_ms)
CONSOLEFONT="$(kernel_cmdline vconsole.font)"
CONSOLEMAP="$(kernel_cmdline vconsole.font.map)"
arch=$(uname -m)
echo "Got consolefont and arch $arch: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
# Activate swap
livetimer=$(get_timer_ms)
configure_swap
echo "Activated swap and added to fstab: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
livetimer=$(get_timer_ms)
configure_language
echo "Finished localization: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
livetimer=$(get_timer_ms)
configure_user
echo "Created user ${USER_NAME} with password ${PASSWORD}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
livetimer=$(get_timer_ms)
configure_accountsservice "${USER_NAME}"
echo "Configured accountsservice: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
livetimer=$(get_timer_ms)
configure_displaymanager
echo "Configured displaymanager: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
livetimer=$(get_timer_ms)
configure_user_root /
echo "Configured root user: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"

@ -10,11 +10,4 @@ USER_NAME=artix
PASSWORD=artix
# live group membership
ADDGROUPS='video,power,disk,storage,optical,network,lp,scanner,wheel'
# default desktop file
DEFAULT_DESKTOP_FILE=lxqt
# default desktop executable
DEFAULT_DESKTOP_EXECUTABLE=lxqt-session
ADDGROUPS='video,power,cdrom,network,lp,scanner,wheel'

@ -1,5 +1,5 @@
#!/usr/bin/openrc-run
# Copyright 2015 artoo (artoo@cromnix.org)
# Copyright 2019 artoo (artoo@artixlinux.org)
# Distributed under the terms of the GNU General Public License v2
target_dir=/etc/pacman.d/gnupg

@ -9,6 +9,9 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
export LC_MESSAGES=C
export LANG=C
kernel_cmdline(){
for param in $(cat /proc/cmdline); do
case "${param}" in
@ -33,19 +36,6 @@ get_tz(){
echo $(kernel_cmdline tz)
}
get_cal_mode(){
echo $(kernel_cmdline netinstall)
}
get_timer_ms(){
echo $(date +%s%3N)
}
# $1: start timer
elapsed_time_ms(){
echo $(echo $1 $(get_timer_ms) | awk '{ printf "%0.3f",($2-$1)/1000 }')
}
load_live_config(){
[[ -f $1 ]] || return 1
@ -62,8 +52,6 @@ load_live_config(){
[[ -z ${ADDGROUPS} ]] && ADDGROUPS="video,power,storage,optical,network,lp,scanner,wheel,users,audio"
echo "Loaded ${live_conf}: $(elapsed_time_ms ${livetimer})ms" >> "${LOGFILE}"
return 0
}
@ -168,15 +156,6 @@ gen_pw(){
echo $(perl -e 'print crypt($ARGV[0], "password")' ${PASSWORD})
}
configure_user(){
# set up user and password
if [[ -n ${PASSWORD} ]];then
useradd -m -G ${ADDGROUPS} -p $(gen_pw) -s /bin/bash ${USER_NAME}
else
useradd -m -G ${ADDGROUPS} -s /bin/bash ${USER_NAME}
fi
}
find_legacy_keymap(){
local file="${DATADIR}/kbd-model.map" kt="$1"
while read -r line || [[ -n $line ]]; do
@ -242,15 +221,9 @@ configure_language(){
local lang=$(get_lang)
local keytable=$(get_keytable)
local timezone=$(get_tz)
# Fallback
# [[ -z "${lang}" ]] && lang="en_US"
# [[ -z "${keytable}" ]] && keytable="us"
# [[ -z "${timezone}" ]] && timezone="Etc/UTC"
sed -e "s/#${lang}.UTF-8/${lang}.UTF-8/" -i /etc/locale.gen
# echo "LANG=${lang}.UTF-8" >> /etc/environment
if [[ -d /run/openrc ]]; then
sed -i "s/keymap=.*/keymap=\"${keytable}\"/" /etc/conf.d/keymaps
fi
@ -275,8 +248,15 @@ configure_swap(){
fi
}
configure_user_root(){
# set up root password
echo "root:${PASSWORD}" | chroot $1 chpasswd
cp /etc/skel/.{bash_profile,bashrc,bash_logout} /root/
configure_user(){
local user="$1"
if [[ "$user" == 'root' ]];then
echo "root:${PASSWORD}" | chroot / chpasswd
cp /etc/skel/.{bash_profile,bashrc,bash_logout} /root/
else
local args=(-m -G ${ADDGROUPS} -s /bin/bash $user)
# set up user and password
[[ -n ${PASSWORD} ]] && args+=(-p $(gen_pw))
useradd "${args[@]}"
fi
}

Loading…
Cancel
Save