Compare commits

...

6 Commits

Author SHA1 Message Date
e17b84f4a0 iso-fixes (#156)
All checks were successful
Artools shellcheck / lint (push) Successful in 25s
Reviewed-on: #156
Co-authored-by: Artoo <artoo@artixlinux.org>
Co-committed-by: Artoo <artoo@artixlinux.org>
2025-08-29 22:38:21 +02:00
4718c88229 Merge pull request 'buildiso: load optional livefs packages-init' (#155) from iso-opt-yaml-key into master
All checks were successful
Artools shellcheck / lint (push) Successful in 29s
Reviewed-on: #155
2025-08-28 00:55:17 +02:00
d1ddaaf06a buildiso: load optional livefs packages-init
All checks were successful
Artools shellcheck / lint (pull_request) Successful in 56s
2025-08-27 23:48:23 +02:00
9484fff9f8 buildiso: handle s6 DM in proper lib (#154)
All checks were successful
Artools shellcheck / lint (push) Successful in 1m14s
Reviewed-on: #154
Co-authored-by: Artoo <artoo@artixlinux.org>
Co-committed-by: Artoo <artoo@artixlinux.org>
2025-08-26 17:11:44 +02:00
1e2e5f44e1 buildiso: add s6 service error handling
All checks were successful
Artools shellcheck / lint (push) Successful in 41s
2025-08-22 15:42:18 +02:00
764d47ad8f buildiso: add service error handling
All checks were successful
Artools shellcheck / lint (push) Successful in 1m37s
2025-08-22 15:11:38 +02:00
3 changed files with 54 additions and 32 deletions

View File

@@ -19,10 +19,12 @@ rootfs:
s6: [] s6: []
# optional # optional
# livefs: livefs:
# packages: [] packages: []
# packages-init: # optional
# dinit: [] packages-init:
# openrc: [] dinit: []
# runit: [] openrc: []
# s6: [] runit: []
s6: []

View File

@@ -43,6 +43,8 @@ load_profile(){
HAS_LIVE=$(yq -P '. | has("livefs")' "$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
} }
@@ -51,6 +53,7 @@ load_pkgs(){
local common_base local common_base
local common_apps local common_apps
local common_misc
local common_xorg local common_xorg
local common_boot local common_boot
local common_init local common_init
@@ -70,12 +73,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"
@@ -84,6 +87,9 @@ load_pkgs(){
msg2 "Loading Packages: [%s] ..." "common.packages-xorg" msg2 "Loading Packages: [%s] ..." "common.packages-xorg"
mapfile -t common_xorg < <(yq -P '.packages-xorg[]' "$common_yaml") mapfile -t common_xorg < <(yq -P '.packages-xorg[]' "$common_yaml")
fi fi
msg2 "Loading Packages: [%s] ..." "common.packages-misc"
mapfile -t common_misc < <(yq -P '.packages-misc[]' "$common_yaml")
fi fi
msg2 "Loading Packages: [%s] ..." "rootfs.packages" msg2 "Loading Packages: [%s] ..." "rootfs.packages"
@@ -94,32 +100,22 @@ 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[@]}"
"${common_xorg[@]}"
"${common_misc[@]}"
) )
if "${HAS_LIVE}"; then
packages+=(
"${common_xorg}"
)
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}" if "${HAS_LIVE_INIT}"; then
mapfile -t packages_live_init < <(live_key_init="$live_key_init" yq -P 'eval(strenv(live_key_init))' "$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")
fi
packages+=( packages+=(
"${packages_live[@]}" "${packages_live[@]}"

View File

@@ -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
} }