1
0
forked from artix/artools

Compare commits

..

4 Commits

Author SHA1 Message Date
e17b84f4a0 iso-fixes (#156)
Reviewed-on: artix/artools#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
Reviewed-on: artix/artools#155
2025-08-28 00:55:17 +02:00
d1ddaaf06a buildiso: load optional livefs packages-init 2025-08-27 23:48:23 +02:00
9484fff9f8 buildiso: handle s6 DM in proper lib (#154)
Reviewed-on: artix/artools#154
Co-authored-by: Artoo <artoo@artixlinux.org>
Co-committed-by: Artoo <artoo@artixlinux.org>
2025-08-26 17:11:44 +02:00
3 changed files with 35 additions and 27 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

@@ -45,7 +45,17 @@ add_svc_runit(){
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"
if [[ -d "$mnt"/etc/s6/sv/"$svc" ]] || [[ -d "$mnt"/etc/s6/sv/"$svc"-srv ]]; then if [[ -d "$mnt"/etc/s6/sv/"$svc" ]] || [[ -d "$mnt"/etc/s6/sv/"$svc"-srv ]]; then