Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
4718c88229 | |||
d1ddaaf06a
|
|||
9484fff9f8 | |||
1e2e5f44e1
|
|||
764d47ad8f
|
|||
9e67c31d61 |
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
|||||||
SHELL=/bin/bash
|
SHELL=/bin/bash
|
||||||
|
|
||||||
V=0.36
|
V=0.37
|
||||||
BUILDTOOLVER ?= $(V)
|
BUILDTOOLVER ?= $(V)
|
||||||
|
|
||||||
CHROOTVER=0.12
|
CHROOTVER=0.12
|
||||||
|
@@ -1,17 +0,0 @@
|
|||||||
################ install ################
|
|
||||||
|
|
||||||
# start services
|
|
||||||
# bluetoothd, cupsd, DM are added to the pkglist dynamicly
|
|
||||||
# metalog or syslog-ng is added to the pkglist dynamicly
|
|
||||||
# connmand or NetworkManager is added to the pkglist dynamicly
|
|
||||||
# only added if in array, these pkgs have no list entry
|
|
||||||
|
|
||||||
SERVICES=('acpid' 'bluetoothd' 'cronie' 'cupsd' 'metalog' 'connmand')
|
|
||||||
|
|
||||||
################# live-session #################
|
|
||||||
|
|
||||||
# default value
|
|
||||||
# PASSWORD="artix"
|
|
||||||
|
|
||||||
# Set to false to disable autologin in the live session
|
|
||||||
AUTOLOGIN="false"
|
|
30
contrib/iso/profile.yaml.example
Normal file
30
contrib/iso/profile.yaml.example
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# required
|
||||||
|
live-session:
|
||||||
|
user: "artix"
|
||||||
|
password: "artix"
|
||||||
|
autologin: true
|
||||||
|
use-xlibre: false
|
||||||
|
services: []
|
||||||
|
user-services: []
|
||||||
|
|
||||||
|
# required
|
||||||
|
rootfs:
|
||||||
|
packages: []
|
||||||
|
packages-init:
|
||||||
|
dinit: []
|
||||||
|
openrc: []
|
||||||
|
runit: []
|
||||||
|
s6: []
|
||||||
|
|
||||||
|
# optional
|
||||||
|
livefs:
|
||||||
|
packages: []
|
||||||
|
# optional
|
||||||
|
packages-init:
|
||||||
|
dinit: []
|
||||||
|
openrc: []
|
||||||
|
runit: []
|
||||||
|
s6: []
|
||||||
|
|
@@ -88,7 +88,7 @@ make_rootfs() {
|
|||||||
msg "Prepare [Base installation] (rootfs)"
|
msg "Prepare [Base installation] (rootfs)"
|
||||||
local rootfs="${work_dir}/rootfs"
|
local rootfs="${work_dir}/rootfs"
|
||||||
|
|
||||||
load_pkgs "${root_list}"
|
load_pkgs "rootfs"
|
||||||
|
|
||||||
prepare_dir "${rootfs}"
|
prepare_dir "${rootfs}"
|
||||||
|
|
||||||
@@ -100,7 +100,9 @@ make_rootfs() {
|
|||||||
|
|
||||||
copy_overlay "${root_overlay}" "${rootfs}"
|
copy_overlay "${root_overlay}" "${rootfs}"
|
||||||
|
|
||||||
[[ -z ${live_list} ]] && configure_chroot "${rootfs}"
|
if ! "${HAS_LIVE}"; then
|
||||||
|
configure_chroot "${rootfs}"
|
||||||
|
fi
|
||||||
|
|
||||||
clean_up_chroot "${rootfs}"
|
clean_up_chroot "${rootfs}"
|
||||||
|
|
||||||
@@ -115,7 +117,7 @@ make_livefs() {
|
|||||||
msg "Prepare [Live installation] (livefs)"
|
msg "Prepare [Live installation] (livefs)"
|
||||||
local livefs="${work_dir}/livefs"
|
local livefs="${work_dir}/livefs"
|
||||||
|
|
||||||
load_pkgs "${live_list}"
|
load_pkgs "livefs"
|
||||||
|
|
||||||
prepare_dir "${livefs}"
|
prepare_dir "${livefs}"
|
||||||
|
|
||||||
@@ -141,7 +143,7 @@ make_bootfs() {
|
|||||||
if [[ ! -e ${work_dir}/bootfs.lock ]]; then
|
if [[ ! -e ${work_dir}/bootfs.lock ]]; then
|
||||||
msg "Prepare [/iso/boot]"
|
msg "Prepare [/iso/boot]"
|
||||||
|
|
||||||
load_pkgs "${common_dir}/Packages-boot"
|
load_pkgs "bootfs"
|
||||||
|
|
||||||
prepare_dir "${iso_root}/boot"
|
prepare_dir "${iso_root}/boot"
|
||||||
|
|
||||||
@@ -171,7 +173,9 @@ make_grub(){
|
|||||||
msg "Prepare [/iso/boot/grub]"
|
msg "Prepare [/iso/boot/grub]"
|
||||||
|
|
||||||
local layer=${work_dir}/rootfs
|
local layer=${work_dir}/rootfs
|
||||||
[[ -n ${live_list} ]] && layer=${work_dir}/livefs
|
if "${HAS_LIVE}"; then
|
||||||
|
layer=${work_dir}/livefs
|
||||||
|
fi
|
||||||
|
|
||||||
prepare_grub "${work_dir}/rootfs" "$layer"
|
prepare_grub "${work_dir}/rootfs" "$layer"
|
||||||
|
|
||||||
@@ -280,7 +284,7 @@ mk_boot(){
|
|||||||
|
|
||||||
mk_chroots(){
|
mk_chroots(){
|
||||||
run_safe "make_rootfs"
|
run_safe "make_rootfs"
|
||||||
if [[ -n ${live_list} ]]; then
|
if "${HAS_LIVE}"; then
|
||||||
run_safe "make_livefs"
|
run_safe "make_livefs"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@@ -21,13 +21,22 @@ configure_calamares(){
|
|||||||
msg2 "Configuring: Calamares %s" "$config"
|
msg2 "Configuring: Calamares %s" "$config"
|
||||||
|
|
||||||
if [[ -f "$mods"/services-artix.conf ]]; then
|
if [[ -f "$mods"/services-artix.conf ]]; then
|
||||||
local svc
|
local svc usvc
|
||||||
svc=$(yaml_array "${SERVICES[@]}") \
|
svc=$(yaml_array "${SERVICES[@]}") \
|
||||||
yq -P 'with(.;
|
yq -P 'with(.;
|
||||||
.command = "artix-service" |
|
.command = "artix-service" |
|
||||||
.services = env(svc) )' \
|
.services = env(svc) )' \
|
||||||
-i "$mods"/services-artix.conf
|
-i "$mods"/services-artix.conf
|
||||||
fi
|
fi
|
||||||
|
if [[ -f "$mods"/postcfg.conf ]]; then
|
||||||
|
local usvc initsys
|
||||||
|
initsys="${INITSYS}" \
|
||||||
|
usvc=$(yaml_array "${USER_SERVICES[@]}") \
|
||||||
|
yq -P 'with(.;
|
||||||
|
.initsys = env(initsys) |
|
||||||
|
.user-services = env(usvc) )' \
|
||||||
|
-i "$mods"/postcfg.conf
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [[ -d "$1"/etc/calamares-offline ]]; then
|
if [[ -d "$1"/etc/calamares-offline ]]; then
|
||||||
|
@@ -4,9 +4,21 @@
|
|||||||
|
|
||||||
#{{{ session
|
#{{{ session
|
||||||
|
|
||||||
|
configure_user(){
|
||||||
|
local -r grps="users,lp,video,network,storage,wheel,audio,power,log,optical,network,scanner"
|
||||||
|
|
||||||
|
chroot "$1" useradd -m -G "$grps" -s /bin/bash "${LIVEUSER}"
|
||||||
|
echo "${LIVEUSER}:${PASSWORD}" | chroot "$1" chpasswd
|
||||||
|
echo "root:${PASSWORD}" | chroot "$1" chpasswd
|
||||||
|
}
|
||||||
|
|
||||||
configure_services(){
|
configure_services(){
|
||||||
local mnt="$1"
|
local mnt="$1"
|
||||||
add_svc_"${INITSYS}" "$mnt" "${SERVICES[*]}"
|
add_svc_"${INITSYS}" "$mnt"
|
||||||
|
|
||||||
|
if [[ "${INITSYS}" == "openrc" ]] || [[ "${INITSYS}" == "dinit" ]]; then
|
||||||
|
add_user_svc_"${INITSYS}" "$mnt"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -14,13 +26,14 @@ 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 "\nPASSWORD=%s\n" "${PASSWORD}")
|
conf+=$(printf "\nLIVEUSER=%s\n" "${LIVEUSER}")
|
||||||
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_user "$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"
|
||||||
|
@@ -7,6 +7,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 "LIVEUSER: %s" "${LIVEUSER}"
|
||||||
msg2 "PASSWORD: %s" "${PASSWORD}"
|
msg2 "PASSWORD: %s" "${PASSWORD}"
|
||||||
msg2 "SERVICES: %s" "${SERVICES[*]}"
|
msg2 "SERVICES: %s" "${SERVICES[*]}"
|
||||||
}
|
}
|
||||||
@@ -15,79 +16,121 @@ load_profile(){
|
|||||||
local profile_dir="${DATADIR}/iso-profiles"
|
local profile_dir="${DATADIR}/iso-profiles"
|
||||||
[[ -d "${WORKSPACE_DIR}"/iso-profiles ]] && profile_dir="${WORKSPACE_DIR}"/iso-profiles
|
[[ -d "${WORKSPACE_DIR}"/iso-profiles ]] && profile_dir="${WORKSPACE_DIR}"/iso-profiles
|
||||||
|
|
||||||
root_list="$profile_dir/${profile}/Packages-Root"
|
|
||||||
root_overlay="$profile_dir/${profile}/root-overlay"
|
root_overlay="$profile_dir/${profile}/root-overlay"
|
||||||
|
|
||||||
[[ -f "$profile_dir/${profile}/Packages-Live" ]] && live_list="$profile_dir/${profile}/Packages-Live"
|
|
||||||
[[ -d "$profile_dir/${profile}/live-overlay" ]] && live_overlay="$profile_dir/${profile}/live-overlay"
|
[[ -d "$profile_dir/${profile}/live-overlay" ]] && live_overlay="$profile_dir/${profile}/live-overlay"
|
||||||
|
|
||||||
common_dir="${DATADIR}/iso-profiles/common"
|
common_dir="${DATADIR}/iso-profiles/common"
|
||||||
[[ -d "$profile_dir"/common ]] && common_dir="${profile_dir}"/common
|
[[ -d "$profile_dir"/common ]] && common_dir="${profile_dir}"/common
|
||||||
|
|
||||||
[[ -f $profile_dir/${profile}/profile.conf ]] || return 1
|
profile_yaml=$profile_dir/${profile}/profile.yaml
|
||||||
|
|
||||||
# shellcheck source=contrib/iso/profile.conf.example
|
common_yaml="${common_dir}/common.yaml"
|
||||||
[[ -r "$profile_dir/${profile}"/profile.conf ]] && . "$profile_dir/${profile}"/profile.conf
|
|
||||||
|
|
||||||
AUTOLOGIN=${AUTOLOGIN:-true}
|
[[ -f $profile_yaml ]] || return 1
|
||||||
|
|
||||||
PASSWORD=${PASSWORD:-'artix'}
|
LIVEUSER=$(yq -P '.live-session.user' "$profile_yaml")
|
||||||
|
|
||||||
if [[ -z "${SERVICES[*]}" ]];then
|
PASSWORD=$(yq -P '.live-session.password' "$profile_yaml")
|
||||||
SERVICES=('acpid' 'bluetoothd' 'cronie' 'cupsd' 'syslog-ng' 'connmand')
|
|
||||||
fi
|
AUTOLOGIN=$(yq -P '.live-session.autologin' "$profile_yaml")
|
||||||
|
|
||||||
|
USE_XLIBRE=$(yq -P '.live-session.use-xlibre' "$profile_yaml")
|
||||||
|
|
||||||
|
mapfile -t SERVICES < <(yq -P '.live-session.services[]' "$profile_yaml")
|
||||||
|
|
||||||
|
mapfile -t USER_SERVICES < <(yq -P '.live-session.user-services[]' "$profile_yaml")
|
||||||
|
|
||||||
|
HAS_LIVE=$(yq -P '. | has("livefs")' "$profile_yaml")
|
||||||
|
|
||||||
|
HAS_LIVE_INIT=$(yq -P '.livefs | has("packages-init")' "$profile_yaml")
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
read_from_list() {
|
|
||||||
local list="$1"
|
|
||||||
local _space="s| ||g"
|
|
||||||
#local _clean=':a;N;$!ba;s/\n/ /g'
|
|
||||||
local _clean='/^$/d'
|
|
||||||
local _com_rm="s|#.*||g"
|
|
||||||
local _init="s|@initsys@|${INITSYS}|g"
|
|
||||||
|
|
||||||
mapfile -t pkgs < <(sed "$_com_rm" "$list" \
|
|
||||||
| sed "$_space" \
|
|
||||||
| sed "$_init" \
|
|
||||||
| sed "$_clean" | sort -u)
|
|
||||||
}
|
|
||||||
|
|
||||||
load_pkgs(){
|
load_pkgs(){
|
||||||
local pkglist="$1"
|
local list="$1"
|
||||||
|
|
||||||
|
local common_base
|
||||||
|
local common_apps
|
||||||
|
local common_xorg
|
||||||
|
local common_boot
|
||||||
|
local common_init
|
||||||
|
local packages_root
|
||||||
|
local packages_live
|
||||||
|
local packages_root_init
|
||||||
|
local packages_live_init
|
||||||
|
|
||||||
|
local common_key_init=".packages-init.${INITSYS}[]"
|
||||||
|
local root_key_init=".rootfs.packages-init.${INITSYS}[]"
|
||||||
|
local live_key_init=".livefs.packages-init.${INITSYS}[]"
|
||||||
|
|
||||||
packages=()
|
packages=()
|
||||||
|
|
||||||
if [[ "${pkglist##*/}" == "Packages-Root" ]]; then
|
case "$list" in
|
||||||
for l in base apps "${INITSYS}"; do
|
rootfs)
|
||||||
msg2 "Loading Packages: [%s] ..." "Packages-${l}"
|
msg2 "Loading Packages: [%s] ..." "common.packages-base"
|
||||||
read_from_list "${common_dir}/Packages-${l}"
|
mapfile -t common_base < <(yq -P '.packages-base[]' "$common_yaml")
|
||||||
packages+=("${pkgs[@]}")
|
|
||||||
|
|
||||||
done
|
msg2 "Loading Packages: [%s] ..." "common.packages-init.${INITSYS}"
|
||||||
|
mapfile -t common_init < <(common_key_init="$common_key_init" yq -P 'eval(strenv(common_key_init))' "$common_yaml")
|
||||||
|
|
||||||
if [[ -n "${live_list}" ]]; then
|
msg2 "Loading Packages: [%s] ..." "common.packages-apps"
|
||||||
msg2 "Loading Packages: [Packages-xorg] ..."
|
mapfile -t common_apps < <(yq -P '.packages-apps[]' "$common_yaml")
|
||||||
read_from_list "${common_dir}/Packages-xorg"
|
|
||||||
packages+=("${pkgs[@]}")
|
if "${HAS_LIVE}"; then
|
||||||
|
if ${USE_XLIBRE}; then
|
||||||
|
msg2 "Loading Packages: [%s] ..." "common.packages-xlibre"
|
||||||
|
mapfile -t common_xorg < <(yq -P '.packages-xlibre[]' "$common_yaml")
|
||||||
|
else
|
||||||
|
msg2 "Loading Packages: [%s] ..." "common.packages-xorg"
|
||||||
|
mapfile -t common_xorg < <(yq -P '.packages-xorg[]' "$common_yaml")
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for svc in "${SERVICES[@]}"; do
|
msg2 "Loading Packages: [%s] ..." "rootfs.packages"
|
||||||
case "$svc" in
|
mapfile -t packages_root < <(yq -P '.rootfs.packages[]' "$profile_yaml")
|
||||||
sddm|gdm|lightdm|mdm|greetd|lxdm|xdm)
|
|
||||||
packages+=("$svc-${INITSYS}"); display_manager="$svc" ;;
|
msg2 "Loading Packages: [%s] ..." "rootfs.packages-init.${INITSYS}"
|
||||||
NetworkManager) packages+=("networkmanager-${INITSYS}") ;;
|
mapfile -t packages_root_init < <(root_key_init="$root_key_init" yq -P 'eval(strenv(root_key_init))' "$profile_yaml")
|
||||||
connmand) packages+=("connman-${INITSYS}") ;;
|
|
||||||
cupsd) packages+=("cups-${INITSYS}") ;;
|
packages+=(
|
||||||
bluetoothd) packages+=("bluez-${INITSYS}") ;;
|
"${common_base[@]}"
|
||||||
syslog-ng|metalog) packages+=("$svc-${INITSYS}") ;;
|
"${common_init[@]}"
|
||||||
|
"${common_apps[@]}"
|
||||||
|
"${packages_root[@]}"
|
||||||
|
"${packages_root_init[@]}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if "${HAS_LIVE}"; then
|
||||||
|
packages+=(
|
||||||
|
"${common_xorg}"
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
livefs)
|
||||||
|
msg2 "Loading Packages: [%s] ..." "livefs.packages"
|
||||||
|
mapfile -t packages_live < <(yq -P '.livefs.packages[]' "$profile_yaml")
|
||||||
|
|
||||||
|
if "${HAS_LIVE_INIT}"; then
|
||||||
|
msg2 "Loading Packages: [%s] ..." "livefs.packages-init.${INITSYS}"
|
||||||
|
mapfile -t packages_live_init < <(live_key_init="$live_key_init" yq -P 'eval(strenv(live_key_init))' "$profile_yaml")
|
||||||
|
fi
|
||||||
|
|
||||||
|
packages+=(
|
||||||
|
"${packages_live[@]}"
|
||||||
|
"${packages_live_init[@]}"
|
||||||
|
)
|
||||||
|
;;
|
||||||
|
bootfs)
|
||||||
|
msg2 "Loading Packages: [%s] ..." "common.packages-boot"
|
||||||
|
mapfile -t common_boot < <(yq -P '.packages-boot[]' "$common_yaml")
|
||||||
|
|
||||||
|
packages+=(
|
||||||
|
"${common_boot[@]}"
|
||||||
|
)
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
|
||||||
|
|
||||||
fi
|
|
||||||
msg2 "Loading Packages: [%s] ..." "${pkglist##*/}"
|
|
||||||
read_from_list "${pkglist}"
|
|
||||||
packages+=("${pkgs[@]}")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#}}}
|
#}}}
|
||||||
|
@@ -5,36 +5,69 @@
|
|||||||
#{{{ services
|
#{{{ services
|
||||||
|
|
||||||
add_svc_openrc(){
|
add_svc_openrc(){
|
||||||
local mnt="$1" names="$2" rlvl="${3:-default}"
|
local mnt="$1" rlvl="${2:-default}"
|
||||||
for svc in $names; do
|
for svc in "${SERVICES[@]}"; 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"
|
||||||
chroot "$mnt" rc-update add "$svc" "$rlvl" &>/dev/null
|
chroot "$mnt" rc-update add "$svc" "$rlvl" &>/dev/null
|
||||||
|
else
|
||||||
|
warning "Service %s not found. Skipping." "$svc"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
add_user_svc_openrc(){
|
||||||
|
local mnt="$1" rlvl="${2:-default}"
|
||||||
|
for svc in "${USER_SERVICES[@]}"; do
|
||||||
|
if [[ -f "$mnt"/etc/user/init.d/"$svc" ]];then
|
||||||
|
msg2 "Setting user %s: [%s]" "${INITSYS}" "$svc"
|
||||||
|
local rc=".config/rc/runlevels/default"
|
||||||
|
chroot "$mnt" mkdir -p /home/"${LIVEUSER}/$rc"
|
||||||
|
chroot "$mnt" ln -s /etc/user/init.d/"$svc" /home/"${LIVEUSER}/$rc/$svc"
|
||||||
|
chroot "$mnt" chown -R "${LIVEUSER}:${LIVEUSER}" /home/"${LIVEUSER}"/.config/rc
|
||||||
|
else
|
||||||
|
warning "Service %s not found. Skipping." "$svc"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
add_svc_runit(){
|
add_svc_runit(){
|
||||||
local mnt="$1" names="$2" rlvl="${3:-default}"
|
local mnt="$1" rlvl="${2:-default}"
|
||||||
for svc in $names; do
|
for svc in "${SERVICES[@]}"; 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
|
||||||
|
else
|
||||||
|
warning "Service %s not found. Skipping." "$svc"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
add_svc_s6(){
|
add_svc_s6(){
|
||||||
local mnt="$1" names="$2" rlvl="${3:-default}" dep
|
local mnt="$1" rlvl="${2:-default}" dep
|
||||||
|
local display_manager
|
||||||
|
local supported_dms=(sddm gdm lightdm mdm greetd lxdm xdm)
|
||||||
|
|
||||||
|
for dm in "${supported_dms[@]}"; do
|
||||||
|
if in_array "$dm" "${SERVICES[@]}"; then
|
||||||
|
display_manager="$dm"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
dep="$mnt"/etc/s6/sv/"$display_manager"-srv/dependencies.d
|
dep="$mnt"/etc/s6/sv/"$display_manager"-srv/dependencies.d
|
||||||
for svc in $names; do
|
|
||||||
|
for svc in "${SERVICES[@]}"; do
|
||||||
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
||||||
|
if [[ -d "$mnt"/etc/s6/sv/"$svc" ]] || [[ -d "$mnt"/etc/s6/sv/"$svc"-srv ]]; then
|
||||||
chroot "$mnt" s6-service add "$rlvl" "$svc"
|
chroot "$mnt" s6-service add "$rlvl" "$svc"
|
||||||
if [[ "$svc" == "$display_manager" ]]; then
|
if [[ "$svc" == "$display_manager" ]]; then
|
||||||
if [[ -d "$dep" ]]; then
|
if [[ -d "$dep" ]]; then
|
||||||
touch "$dep"/artix-live
|
touch "$dep"/artix-live
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
warning "Service %s not found. Skipping." "$svc"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
chroot "$mnt" s6-db-reload -r
|
chroot "$mnt" s6-db-reload -r
|
||||||
@@ -47,22 +80,29 @@ add_svc_s6(){
|
|||||||
chroot "$mnt" cp -a "$src"/bin /usr
|
chroot "$mnt" cp -a "$src"/bin /usr
|
||||||
}
|
}
|
||||||
|
|
||||||
add_svc_suite66(){
|
add_svc_dinit(){
|
||||||
local mnt="$1" names="$2"
|
local mnt="$1"
|
||||||
for svc in $names; do
|
for svc in "${SERVICES[@]}"; do
|
||||||
if [[ -f "$mnt"/etc/66/service/"$svc" ]]; then
|
if [[ -f "$mnt"/etc/dinit.d/"$svc" ]]; then
|
||||||
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
||||||
chroot "$mnt" 66-enable -t default "$svc" &>/dev/null
|
chroot "$mnt" dinitctl enable -o "$svc" &>/dev/null
|
||||||
|
else
|
||||||
|
warning "Service %s not found. Skipping." "$svc"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
add_svc_dinit(){
|
add_user_svc_dinit(){
|
||||||
local mnt="$1" names="$2"
|
local mnt="$1"
|
||||||
for svc in $names; do
|
for svc in "${USER_SERVICES[@]}"; do
|
||||||
if [[ -d $mnt/etc/dinit.d/boot.d ]]; then
|
if [[ -f "$mnt"/etc/dinit.d/user/"$svc" ]]; then
|
||||||
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
msg2 "Setting user %s: [%s]" "${INITSYS}" "$svc"
|
||||||
chroot "$mnt" dinitctl enable -o "$svc" &>/dev/null
|
local usr_sv="/home/${LIVEUSER}/.config/dinit.d"
|
||||||
|
chroot "$mnt" mkdir -p "$usr_sv"/boot.d
|
||||||
|
chroot "$mnt" ln -s /etc/dinit.d/user/"$svc" "$usr_sv"/boot.d/"$svc"
|
||||||
|
chroot "$mnt" chown -R "${LIVEUSER}:${LIVEUSER}" "$usr_sv"
|
||||||
|
else
|
||||||
|
warning "Service %s not found. Skipping." "$svc"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user