Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
f05688dc12 | |||
091b5deaa8 | |||
93e4beb61f | |||
76b4ff511d | |||
2995207e6b | |||
5aa8bd3333 | |||
699ea06445 | |||
4b9a883113 |
@@ -158,7 +158,7 @@ move=false
|
|||||||
readonly table="%-18s %-18s %-25s %-27s %-27s %-10s"
|
readonly table="%-18s %-18s %-25s %-27s %-27s %-10s"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: ${0##*/} [options] (with -q [libname])"
|
echo "Usage: ${0##*/} [options]"
|
||||||
echo ' -u Show upgrade packages'
|
echo ' -u Show upgrade packages'
|
||||||
echo ' -d Show downgrade packages'
|
echo ' -d Show downgrade packages'
|
||||||
echo ' -m Show packages to move'
|
echo ' -m Show packages to move'
|
||||||
|
@@ -247,6 +247,15 @@ download_sources() {
|
|||||||
die "Could not download sources."
|
die "Could not download sources."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
move_logfiles() {
|
||||||
|
local l
|
||||||
|
for l in "$copydir"/logdest/*; do
|
||||||
|
[[ $l == */logpipe.* ]] && continue
|
||||||
|
chown "$src_owner" "$l"
|
||||||
|
mv "$l" "$LOGDEST"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
move_products() {
|
move_products() {
|
||||||
local pkgfile
|
local pkgfile
|
||||||
for pkgfile in "$copydir"/pkgdest/*; do
|
for pkgfile in "$copydir"/pkgdest/*; do
|
||||||
@@ -259,12 +268,7 @@ move_products() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
local l
|
move_logfiles
|
||||||
for l in "$copydir"/logdest/*; do
|
|
||||||
[[ $l == */logpipe.* ]] && continue
|
|
||||||
chown "$src_owner" "$l"
|
|
||||||
mv "$l" "$LOGDEST"
|
|
||||||
done
|
|
||||||
|
|
||||||
for s in "$copydir"/srcpkgdest/*; do
|
for s in "$copydir"/srcpkgdest/*; do
|
||||||
chown "$src_owner" "$s"
|
chown "$src_owner" "$s"
|
||||||
@@ -379,6 +383,7 @@ then
|
|||||||
move_products
|
move_products
|
||||||
else
|
else
|
||||||
(( ret += 1 ))
|
(( ret += 1 ))
|
||||||
|
move_logfiles
|
||||||
fi
|
fi
|
||||||
|
|
||||||
(( temp_chroot )) && delete_chroot "$copydir" "$copy"
|
(( temp_chroot )) && delete_chroot "$copydir" "$copy"
|
||||||
|
@@ -15,7 +15,7 @@ DLAGENTS=('file::/usr/bin/curl -gqC - -o %o %u'
|
|||||||
'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
|
'ftp::/usr/bin/curl -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
|
||||||
'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
|
'http::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
|
||||||
'https::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
|
'https::/usr/bin/curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u'
|
||||||
'rsync::/usr/bin/rsync --no-motd -z %u %o'
|
'rsync::/usr/bin/rsync --no-motd -zz %u %o'
|
||||||
'scp::/usr/bin/scp -C %u %o')
|
'scp::/usr/bin/scp -C %u %o')
|
||||||
|
|
||||||
# Other common tools:
|
# Other common tools:
|
||||||
|
@@ -2,30 +2,6 @@
|
|||||||
|
|
||||||
#{{{ calamares
|
#{{{ calamares
|
||||||
|
|
||||||
write_users_conf(){
|
|
||||||
local yaml
|
|
||||||
yaml=$(write_yaml_header)
|
|
||||||
yaml+=$(write_yaml_map 0 'defaultGroups')
|
|
||||||
local IFS=','
|
|
||||||
for g in "${ADDGROUPS[@]}"; do
|
|
||||||
yaml+=$(write_yaml_seq 2 "$g")
|
|
||||||
done
|
|
||||||
unset IFS
|
|
||||||
yaml+=$(write_yaml_map 0 'autologinGroup' 'autologin')
|
|
||||||
yaml+=$(write_yaml_map 0 'doAutologin' 'false')
|
|
||||||
yaml+=$(write_yaml_map 0 'sudoersGroup' 'wheel')
|
|
||||||
yaml+=$(write_yaml_map 0 'setRootPassword' 'true')
|
|
||||||
yaml+=$(write_yaml_map 0 'availableShells' '/bin/bash, /bin/zsh')
|
|
||||||
# yaml+=$(write_yaml_map 0 'passwordRequirements')
|
|
||||||
# yaml+=$(write_yaml_map 2 'minLength' '-1')
|
|
||||||
# yaml+=$(write_yaml_map 2 'maxLength' '-1')
|
|
||||||
# yaml+=$(write_yaml_map 2 'libpwquality')
|
|
||||||
# yaml+=$(write_yaml_seq 4 "minlen=8")
|
|
||||||
# yaml+=$(write_yaml_seq 4 "minclass=80")
|
|
||||||
yaml+=$(write_empty_line)
|
|
||||||
printf '%s' "${yaml}"
|
|
||||||
}
|
|
||||||
|
|
||||||
write_services_conf(){
|
write_services_conf(){
|
||||||
local key1="$1" val1="$2" key2="$3" val2="$4"
|
local key1="$1" val1="$2" key2="$3" val2="$4"
|
||||||
local yaml
|
local yaml
|
||||||
@@ -86,7 +62,6 @@ configure_calamares(){
|
|||||||
local mods="$1/etc/calamares/modules"
|
local mods="$1/etc/calamares/modules"
|
||||||
if [[ -d "$mods" ]];then
|
if [[ -d "$mods" ]];then
|
||||||
msg2 "Configuring: Calamares"
|
msg2 "Configuring: Calamares"
|
||||||
write_users_conf > "$mods"/users.conf
|
|
||||||
write_services_"${INITSYS}"_conf "$mods"
|
write_services_"${INITSYS}"_conf "$mods"
|
||||||
write_postcfg > "$mods"/postcfg.conf
|
write_postcfg > "$mods"/postcfg.conf
|
||||||
write_unpackfs > "$mods"/unpackfs.conf
|
write_unpackfs > "$mods"/unpackfs.conf
|
||||||
|
@@ -2,46 +2,23 @@
|
|||||||
|
|
||||||
#{{{ session
|
#{{{ session
|
||||||
|
|
||||||
configure_hosts(){
|
|
||||||
sed -e "s|localhost.localdomain|localhost.localdomain ${HOST_NAME}|" -i "$1"/etc/hosts
|
|
||||||
}
|
|
||||||
|
|
||||||
configure_logind(){
|
|
||||||
local conf=$1/etc/elogind/logind.conf
|
|
||||||
if [[ -e "$conf" ]];then
|
|
||||||
msg2 "Configuring: logind"
|
|
||||||
sed -i 's/#\(HandleSuspendKey=\)suspend/\1ignore/' "$conf"
|
|
||||||
sed -i 's/#\(HandleLidSwitch=\)suspend/\1ignore/' "$conf"
|
|
||||||
sed -i 's/#\(HandleHibernateKey=\)hibernate/\1ignore/' "$conf"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
configure_services(){
|
configure_services(){
|
||||||
local mnt="$1"
|
local mnt="$1"
|
||||||
add_svc_"${INITSYS}" "$mnt" "${SERVICES[*]} ${SERVICES_LIVE[*]}"
|
add_svc_"${INITSYS}" "$mnt" "${SERVICES[*]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_system(){
|
|
||||||
local mnt="$1"
|
|
||||||
configure_logind "$mnt"
|
|
||||||
echo "${HOST_NAME}" > "$mnt"/etc/hostname
|
|
||||||
}
|
|
||||||
|
|
||||||
write_live_session_conf(){
|
write_live_session_conf(){
|
||||||
local conf=''
|
local conf=''
|
||||||
conf+=$(printf '%s\n' '# live session configuration')
|
conf+=$(printf '%s\n' '# live session configuration')
|
||||||
conf+=$(printf "\nAUTOLOGIN=%s\n" "${AUTOLOGIN}")
|
conf+=$(printf "\nAUTOLOGIN=%s\n" "${AUTOLOGIN}")
|
||||||
conf+=$(printf "\nUSER_NAME=%s\n" "${USER_NAME}")
|
|
||||||
conf+=$(printf "\nPASSWORD=%s\n" "${PASSWORD}")
|
conf+=$(printf "\nPASSWORD=%s\n" "${PASSWORD}")
|
||||||
conf+=$(printf "\nADDGROUPS='%s'\n" "${ADDGROUPS}")
|
|
||||||
printf '%s' "$conf"
|
printf '%s' "$conf"
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_chroot(){
|
configure_chroot(){
|
||||||
local fs="$1"
|
local fs="$1"
|
||||||
msg "Configuring [%s]" "${fs##*/}"
|
msg "Configuring [%s]" "${fs##*/}"
|
||||||
configure_hosts "$fs"
|
|
||||||
configure_system "$fs"
|
|
||||||
configure_services "$fs"
|
configure_services "$fs"
|
||||||
configure_calamares "$fs"
|
configure_calamares "$fs"
|
||||||
[[ ! -d "$fs/etc/artools" ]] && mkdir -p "$fs/etc/artools"
|
[[ ! -d "$fs/etc/artools" ]] && mkdir -p "$fs/etc/artools"
|
||||||
|
@@ -5,11 +5,7 @@
|
|||||||
show_profile(){
|
show_profile(){
|
||||||
msg2 "iso_file: %s" "${iso_file}"
|
msg2 "iso_file: %s" "${iso_file}"
|
||||||
msg2 "AUTOLOGIN: %s" "${AUTOLOGIN}"
|
msg2 "AUTOLOGIN: %s" "${AUTOLOGIN}"
|
||||||
msg2 "HOST_NAME: %s" "${HOST_NAME}"
|
|
||||||
msg2 "USER_NAME: %s" "${USER_NAME}"
|
|
||||||
msg2 "PASSWORD: %s" "${PASSWORD}"
|
msg2 "PASSWORD: %s" "${PASSWORD}"
|
||||||
msg2 "ADDGROUPS: %s" "${ADDGROUPS}"
|
|
||||||
msg2 "SERVICES_LIVE: %s" "${SERVICES_LIVE[*]}"
|
|
||||||
msg2 "SERVICES: %s" "${SERVICES[*]}"
|
msg2 "SERVICES: %s" "${SERVICES[*]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,32 +24,14 @@ load_profile(){
|
|||||||
# shellcheck disable=1090
|
# shellcheck disable=1090
|
||||||
[[ -r "$profile_dir/${profile}"/profile.conf ]] && . "$profile_dir/${profile}"/profile.conf
|
[[ -r "$profile_dir/${profile}"/profile.conf ]] && . "$profile_dir/${profile}"/profile.conf
|
||||||
|
|
||||||
DISPLAYMANAGER=${DISPLAYMANAGER:-'none'}
|
AUTOLOGIN=${AUTOLOGIN:-true}
|
||||||
|
|
||||||
AUTOLOGIN=${AUTOLOGIN:-"true"}
|
|
||||||
[[ ${DISPLAYMANAGER} == 'none' ]] && AUTOLOGIN="false"
|
|
||||||
|
|
||||||
HOST_NAME=${HOST_NAME:-'artix'}
|
|
||||||
|
|
||||||
USER_NAME=${USER_NAME:-'artix'}
|
|
||||||
|
|
||||||
PASSWORD=${PASSWORD:-'artix'}
|
PASSWORD=${PASSWORD:-'artix'}
|
||||||
|
|
||||||
ADDGROUPS=${ADDGROUPS:-"video,power,optical,network,lp,scanner,wheel,users,log"}
|
|
||||||
|
|
||||||
if [[ -z "${SERVICES[*]}" ]];then
|
if [[ -z "${SERVICES[*]}" ]];then
|
||||||
SERVICES=('acpid' 'bluetoothd' 'cronie' 'cupsd' 'syslog-ng' 'connmand')
|
SERVICES=('acpid' 'bluetoothd' 'cronie' 'cupsd' 'syslog-ng' 'connmand')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${DISPLAYMANAGER} != "none" ]];then
|
|
||||||
case "${INITSYS}" in
|
|
||||||
'openrc') SERVICES+=('xdm') ;;
|
|
||||||
'runit'|'s6') SERVICES+=("${DISPLAYMANAGER}") ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
SERVICES_LIVE=('artix-live' 'pacman-init')
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,19 +2,11 @@
|
|||||||
|
|
||||||
#{{{ services
|
#{{{ services
|
||||||
|
|
||||||
set_xdm(){
|
|
||||||
if [[ -f "$1"/etc/conf.d/xdm ]];then
|
|
||||||
local conf='DISPLAYMANAGER="'${DISPLAYMANAGER}'"'
|
|
||||||
sed -i -e "s|^.*DISPLAYMANAGER=.*|${conf}|" "$1"/etc/conf.d/xdm
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
add_svc_openrc(){
|
add_svc_openrc(){
|
||||||
local mnt="$1" names="$2" rlvl="${3:-default}"
|
local mnt="$1" names="$2" rlvl="${3:-default}"
|
||||||
for svc in $names; do
|
for svc in $names; do
|
||||||
if [[ -f $mnt/etc/init.d/$svc ]];then
|
if [[ -f $mnt/etc/init.d/$svc ]];then
|
||||||
msg2 "Setting [%s]: %s" "${INITSYS}" "$svc"
|
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
||||||
[[ $svc == "xdm" ]] && set_xdm "$mnt"
|
|
||||||
chroot "$mnt" rc-update add "$svc" "$rlvl" &>/dev/null
|
chroot "$mnt" rc-update add "$svc" "$rlvl" &>/dev/null
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -24,7 +16,7 @@ add_svc_runit(){
|
|||||||
local mnt="$1" names="$2" rlvl="${3:-default}"
|
local mnt="$1" names="$2" rlvl="${3:-default}"
|
||||||
for svc in $names; do
|
for svc in $names; do
|
||||||
if [[ -d $mnt/etc/runit/sv/$svc ]]; then
|
if [[ -d $mnt/etc/runit/sv/$svc ]]; then
|
||||||
msg2 "Setting [%s]: %s" "${INITSYS}" "$svc"
|
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
||||||
chroot "$mnt" ln -s /etc/runit/sv/"$svc" /etc/runit/runsvdir/"$rlvl" &>/dev/null
|
chroot "$mnt" ln -s /etc/runit/sv/"$svc" /etc/runit/runsvdir/"$rlvl" &>/dev/null
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -37,11 +29,19 @@ add_svc_s6(){
|
|||||||
chroot "$mnt" s6-rc-db -c /etc/s6/rc/compiled type "$svc" &> /dev/null || error=true
|
chroot "$mnt" s6-rc-db -c /etc/s6/rc/compiled type "$svc" &> /dev/null || error=true
|
||||||
ret="$?"
|
ret="$?"
|
||||||
if [ $ret -eq 0 ] && [[ "$error" == false ]]; then
|
if [ $ret -eq 0 ] && [[ "$error" == false ]]; then
|
||||||
msg2 "Setting [%s]: %s" "${INITSYS}" "$svc"
|
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
||||||
chroot "$mnt" s6-rc-bundle-update -c /etc/s6/rc/compiled add "$rlvl" "$svc"
|
chroot "$mnt" s6-rc-bundle-update -c /etc/s6/rc/compiled add "$rlvl" "$svc"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# force artix-live as a dependency if these display managers exist
|
||||||
|
# for displaymanager in gdm lightdm-srv lxdm sddm; do
|
||||||
|
# if [ -f "${work_dir}"/rootfs/etc/s6/sv/$displaymanager/dependencies ]; then
|
||||||
|
# echo "artix-live" >> "${work_dir}"rootfs/etc/s6/sv/$displaymanager/dependencies
|
||||||
|
# fi
|
||||||
|
# done
|
||||||
|
# chroot "$mnt" sh /usr/share/libalpm/scripts/s6-rc-db-update-hook
|
||||||
|
|
||||||
# rebuild s6-linux-init binaries
|
# rebuild s6-linux-init binaries
|
||||||
chroot "$mnt" rm -r /etc/s6/current
|
chroot "$mnt" rm -r /etc/s6/current
|
||||||
chroot "$mnt" s6-linux-init-maker -1 -N -f /etc/s6/skel -G "/usr/bin/agetty -L -8 tty1 115200" -c /etc/s6/current /etc/s6/current
|
chroot "$mnt" s6-linux-init-maker -1 -N -f /etc/s6/skel -G "/usr/bin/agetty -L -8 tty1 115200" -c /etc/s6/current /etc/s6/current
|
||||||
|
Reference in New Issue
Block a user