forked from artix/artools
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9484fff9f8 | |||
|
1e2e5f44e1
|
|||
|
764d47ad8f
|
@@ -21,8 +21,4 @@ rootfs:
|
|||||||
# optional
|
# optional
|
||||||
# livefs:
|
# livefs:
|
||||||
# packages: []
|
# packages: []
|
||||||
# packages-init:
|
|
||||||
# dinit: []
|
|
||||||
# openrc: []
|
|
||||||
# runit: []
|
|
||||||
# s6: []
|
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ load_pkgs(){
|
|||||||
local packages_root
|
local packages_root
|
||||||
local packages_live
|
local packages_live
|
||||||
local packages_root_init
|
local packages_root_init
|
||||||
local packages_live_init
|
|
||||||
|
|
||||||
local common_key_init=".packages-init.${INITSYS}[]"
|
local common_key_init=".packages-init.${INITSYS}[]"
|
||||||
local root_key_init=".rootfs.packages-init.${INITSYS}[]"
|
local root_key_init=".rootfs.packages-init.${INITSYS}[]"
|
||||||
@@ -70,12 +69,12 @@ load_pkgs(){
|
|||||||
msg2 "Loading Packages: [%s] ..." "common.packages-base"
|
msg2 "Loading Packages: [%s] ..." "common.packages-base"
|
||||||
mapfile -t common_base < <(yq -P '.packages-base[]' "$common_yaml")
|
mapfile -t common_base < <(yq -P '.packages-base[]' "$common_yaml")
|
||||||
|
|
||||||
msg2 "Loading Packages: [%s] ..." "common.packages-apps"
|
|
||||||
mapfile -t common_apps < <(yq -P '.packages-apps[]' "$common_yaml")
|
|
||||||
|
|
||||||
msg2 "Loading Packages: [%s] ..." "common.packages-init.${INITSYS}"
|
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")
|
mapfile -t common_init < <(common_key_init="$common_key_init" yq -P 'eval(strenv(common_key_init))' "$common_yaml")
|
||||||
|
|
||||||
|
msg2 "Loading Packages: [%s] ..." "common.packages-apps"
|
||||||
|
mapfile -t common_apps < <(yq -P '.packages-apps[]' "$common_yaml")
|
||||||
|
|
||||||
if "${HAS_LIVE}"; then
|
if "${HAS_LIVE}"; then
|
||||||
if ${USE_XLIBRE}; then
|
if ${USE_XLIBRE}; then
|
||||||
msg2 "Loading Packages: [%s] ..." "common.packages-xlibre"
|
msg2 "Loading Packages: [%s] ..." "common.packages-xlibre"
|
||||||
@@ -94,8 +93,8 @@ load_pkgs(){
|
|||||||
|
|
||||||
packages+=(
|
packages+=(
|
||||||
"${common_base[@]}"
|
"${common_base[@]}"
|
||||||
"${common_apps[@]}"
|
|
||||||
"${common_init[@]}"
|
"${common_init[@]}"
|
||||||
|
"${common_apps[@]}"
|
||||||
"${packages_root[@]}"
|
"${packages_root[@]}"
|
||||||
"${packages_root_init[@]}"
|
"${packages_root_init[@]}"
|
||||||
)
|
)
|
||||||
@@ -105,25 +104,13 @@ load_pkgs(){
|
|||||||
"${common_xorg}"
|
"${common_xorg}"
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for svc in "${SERVICES[@]}"; do
|
|
||||||
case "$svc" in
|
|
||||||
sddm|gdm|lightdm|mdm|greetd|lxdm|xdm)
|
|
||||||
display_manager="$svc"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
;;
|
;;
|
||||||
livefs)
|
livefs)
|
||||||
msg2 "Loading Packages: [%s] ..." "livefs.packages"
|
msg2 "Loading Packages: [%s] ..." "livefs.packages"
|
||||||
mapfile -t packages_live < <(yq -P '.livefs.packages[]' "$profile_yaml")
|
mapfile -t packages_live < <(yq -P '.livefs.packages[]' "$profile_yaml")
|
||||||
|
|
||||||
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")
|
|
||||||
|
|
||||||
packages+=(
|
packages+=(
|
||||||
"${packages_live[@]}"
|
"${packages_live[@]}"
|
||||||
"${packages_live_init[@]}"
|
|
||||||
)
|
)
|
||||||
;;
|
;;
|
||||||
bootfs)
|
bootfs)
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ add_svc_openrc(){
|
|||||||
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
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -23,6 +25,8 @@ add_user_svc_openrc(){
|
|||||||
chroot "$mnt" mkdir -p /home/"${LIVEUSER}/$rc"
|
chroot "$mnt" mkdir -p /home/"${LIVEUSER}/$rc"
|
||||||
chroot "$mnt" ln -s /etc/user/init.d/"$svc" /home/"${LIVEUSER}/$rc/$svc"
|
chroot "$mnt" ln -s /etc/user/init.d/"$svc" /home/"${LIVEUSER}/$rc/$svc"
|
||||||
chroot "$mnt" chown -R "${LIVEUSER}:${LIVEUSER}" /home/"${LIVEUSER}"/.config/rc
|
chroot "$mnt" chown -R "${LIVEUSER}:${LIVEUSER}" /home/"${LIVEUSER}"/.config/rc
|
||||||
|
else
|
||||||
|
warning "Service %s not found. Skipping." "$svc"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -33,20 +37,36 @@ add_svc_runit(){
|
|||||||
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" rlvl="${2:-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 "${SERVICES[@]}"; do
|
for svc in "${SERVICES[@]}"; do
|
||||||
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
||||||
chroot "$mnt" s6-service add "$rlvl" "$svc"
|
if [[ -d "$mnt"/etc/s6/sv/"$svc" ]] || [[ -d "$mnt"/etc/s6/sv/"$svc"-srv ]]; then
|
||||||
if [[ "$svc" == "$display_manager" ]]; then
|
chroot "$mnt" s6-service add "$rlvl" "$svc"
|
||||||
if [[ -d "$dep" ]]; then
|
if [[ "$svc" == "$display_manager" ]]; then
|
||||||
touch "$dep"/artix-live
|
if [[ -d "$dep" ]]; then
|
||||||
|
touch "$dep"/artix-live
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
warning "Service %s not found. Skipping." "$svc"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -63,9 +83,11 @@ add_svc_s6(){
|
|||||||
add_svc_dinit(){
|
add_svc_dinit(){
|
||||||
local mnt="$1"
|
local mnt="$1"
|
||||||
for svc in "${SERVICES[@]}"; do
|
for svc in "${SERVICES[@]}"; do
|
||||||
if [[ -d $mnt/etc/dinit.d/boot.d ]]; then
|
if [[ -f "$mnt"/etc/dinit.d/"$svc" ]]; then
|
||||||
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
||||||
chroot "$mnt" dinitctl enable -o "$svc" &>/dev/null
|
chroot "$mnt" dinitctl enable -o "$svc" &>/dev/null
|
||||||
|
else
|
||||||
|
warning "Service %s not found. Skipping." "$svc"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -79,6 +101,8 @@ add_user_svc_dinit(){
|
|||||||
chroot "$mnt" mkdir -p "$usr_sv"/boot.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" ln -s /etc/dinit.d/user/"$svc" "$usr_sv"/boot.d/"$svc"
|
||||||
chroot "$mnt" chown -R "${LIVEUSER}:${LIVEUSER}" "$usr_sv"
|
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