Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
4718c88229 | |||
d1ddaaf06a
|
|||
9484fff9f8 | |||
1e2e5f44e1
|
|||
764d47ad8f
|
|||
9e67c31d61 | |||
41c90f8d49
|
|||
c97a0cdd59
|
|||
1ba16c45f9
|
|||
95afc31152
|
|||
af81317aad | |||
79e12f3d10 | |||
917cd188d9 | |||
bfe462432d
|
|||
896e8e195f
|
|||
12d1b784ff | |||
d8129cbb9a
|
|||
950e0604a4
|
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
||||
SHELL=/bin/bash
|
||||
|
||||
V=0.33
|
||||
V=0.37
|
||||
BUILDTOOLVER ?= $(V)
|
||||
|
||||
CHROOTVER=0.12
|
||||
|
@@ -41,3 +41,6 @@
|
||||
|
||||
# override the default git url for patches repo
|
||||
# PATCH_URL=${GIT_SSH}:artix/artix-patches.git
|
||||
|
||||
# override the default debug pool
|
||||
# PKGDEST_DBG=${WORKSPACE_DIR}/packages-debug
|
||||
|
@@ -3,7 +3,6 @@
|
||||
LIBDIR=${LIBDIR:-'@libdir@'}
|
||||
|
||||
_artixpkg_pkgbase() {
|
||||
source "${LIBDIR}"/pkg/git/config.sh
|
||||
source "${LIBDIR}"/pkg/util.sh
|
||||
ls -1 "${TREE_DIR_ARTIX}" | tr '\n' ' '
|
||||
}
|
||||
@@ -17,7 +16,7 @@ _artixpkg_maintainers() {
|
||||
}
|
||||
|
||||
_artixpkg_completion() {
|
||||
local cur prev comps comps_all repos autorepos teams agents cwords comp_cword_exflag
|
||||
local cur prev comps comps_all repos autorepos teams agents cwords comp_cword_exflag agent_flag_present
|
||||
source "${LIBDIR}"/pkg/db/db.sh 2>/dev/null
|
||||
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
@@ -34,6 +33,7 @@ _artixpkg_completion() {
|
||||
comps_all=""
|
||||
comp_cword_exflag=0
|
||||
comp_cword_all=0
|
||||
agent_flag_present=false
|
||||
for ((i = 0; i < ${#COMP_WORDS[@]} - 1; i++)); do
|
||||
word="${COMP_WORDS[i]}"
|
||||
comps_all+=" $word"
|
||||
@@ -42,6 +42,10 @@ _artixpkg_completion() {
|
||||
comps+=" $word"
|
||||
((comp_cword_exflag++))
|
||||
fi
|
||||
if [[ $word == -a || $word == --agent ]]; then
|
||||
# -a can also refer to --adopt
|
||||
agent_flag_present=true
|
||||
fi
|
||||
done
|
||||
comps="${comps:1}"
|
||||
comps_all="${comps_all:1}"
|
||||
@@ -67,6 +71,13 @@ _artixpkg_completion() {
|
||||
fi
|
||||
done
|
||||
teams="${teams:1}"
|
||||
agents=""
|
||||
for word in "${AGENTS[@]}"; do
|
||||
if [[ $word != -* ]]; then
|
||||
agents+=" $word"
|
||||
fi
|
||||
done
|
||||
agents="${agents:1}"
|
||||
|
||||
case "${comp_cword_exflag}" in
|
||||
1)
|
||||
@@ -79,7 +90,7 @@ _artixpkg_completion() {
|
||||
COMPREPLY=($(compgen -W "maintainer query team topic transfer -h --help" -- ${cur}))
|
||||
;;
|
||||
git)
|
||||
COMPREPLY=($(compgen -W "ci clone config create pull push -h --help" -- ${cur}))
|
||||
COMPREPLY=($(compgen -W "clone config create pull push -h --help" -- ${cur}))
|
||||
;;
|
||||
repo)
|
||||
COMPREPLY=($(compgen -W "add remove move import show -h --help" -- ${cur}))
|
||||
@@ -91,37 +102,6 @@ _artixpkg_completion() {
|
||||
;;
|
||||
*)
|
||||
case "${comps}" in
|
||||
"artixpkg repo add"*)
|
||||
local repoAddCommon="-p --push -r --rebuild -n --nocheck -h --help"
|
||||
case "${comp_cword_exflag}" in
|
||||
3)
|
||||
COMPREPLY=($(compgen -W "$repoAddCommon $autorepos $repos" -- ${cur}))
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "$repoAddCommon $(_artixpkg_pkgbase)" -- ${cur}))
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"artixpkg repo remove"*)
|
||||
case "${comp_cword_exflag}" in
|
||||
3)
|
||||
COMPREPLY=($(compgen -W "-p --push -h --help $autorepos $repos" -- ${cur}))
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "-p --push -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"artixpkg repo move"*)
|
||||
case "${comp_cword_exflag}" in
|
||||
3|4)
|
||||
COMPREPLY=($(compgen -W "-p --push -h --help $autorepos $repos" -- ${cur}))
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "-p --push -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"artixpkg repo import"*)
|
||||
case "${prev}" in
|
||||
"--tag")
|
||||
@@ -136,11 +116,53 @@ _artixpkg_completion() {
|
||||
"artixpkg repo show")
|
||||
COMPREPLY=($(compgen -W "-b --base -p --pkgs -h --help" -- ${cur}))
|
||||
;;
|
||||
"artixpkg git clone"*)
|
||||
"artixpkg repo"*)
|
||||
if [ "$agent_flag_present" = true ] ; then
|
||||
((comp_cword_exflag--))
|
||||
fi
|
||||
case "${prev}" in
|
||||
"-a"|"--agent")
|
||||
COMPREPLY=($(compgen -W "$agents" -- ${cur}))
|
||||
;;
|
||||
*)
|
||||
case "${comps}" in
|
||||
"artixpkg repo add"*)
|
||||
local repoAddCommon="-p --push -r --rebuild -n --nocheck -a --agent -h --help"
|
||||
case "${comp_cword_exflag}" in
|
||||
3)
|
||||
COMPREPLY=($(compgen -W "$repoAddCommon $autorepos $repos" -- ${cur}))
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "$repoAddCommon $(_artixpkg_pkgbase)" -- ${cur}))
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"artixpkg repo remove"*)
|
||||
case "${comp_cword_exflag}" in
|
||||
3)
|
||||
COMPREPLY=($(compgen -W "-p --push -a --agent -h --help $autorepos $repos" -- ${cur}))
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "-p --push -a --agent -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"artixpkg repo move"*)
|
||||
case "${comp_cword_exflag}" in
|
||||
3|4)
|
||||
COMPREPLY=($(compgen -W "-p --push -a --agent -h --help $autorepos $repos" -- ${cur}))
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "-p --push -a --agent -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"artixpkg git clone"*)
|
||||
case "${prev}" in
|
||||
"--protocol")
|
||||
COMPREPLY=($(compgen -W "https" -- ${cur}))
|
||||
;;
|
||||
@@ -155,7 +177,7 @@ _artixpkg_completion() {
|
||||
COMPREPLY=()
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "-m --maintainer --protocol -s --search -t --team -a --agent -j --jobs --all -h --help $(_artixpkg_remotepkgbase ${cur})" -- ${cur}))
|
||||
COMPREPLY=($(compgen -W "-m --maintainer --protocol -s --search -t --team -j --jobs --all -h --help $(_artixpkg_remotepkgbase ${cur})" -- ${cur}))
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@@ -175,14 +197,11 @@ _artixpkg_completion() {
|
||||
;;
|
||||
"artixpkg git create"*)
|
||||
case "${prev}" in
|
||||
"-a"|"--agent")
|
||||
COMPREPLY=($(compgen -W "$agents" -- ${cur}))
|
||||
;;
|
||||
"-t"|"--team")
|
||||
COMPREPLY=($(compgen -W "$teams" -- ${cur}))
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "-c --clone -a --agent -t --team -h --help" -- ${cur}))
|
||||
COMPREPLY=($(compgen -W "-c --clone -t --team -h --help" -- ${cur}))
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@@ -212,29 +231,19 @@ _artixpkg_completion() {
|
||||
"-m"|"--maintainer")
|
||||
COMPREPLY=($(compgen -W "$(_artixpkg_maintainers)" -- ${cur}))
|
||||
;;
|
||||
"-t"|"--topic"|"-j"|"--jobs")
|
||||
"-t"|"--topic")
|
||||
# this flag expects a parameter
|
||||
COMPREPLY=()
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "-m --maintainer -t --topic -j --jobs -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"artixpkg git ci"*)
|
||||
case "${prev}" in
|
||||
"-a"|"--agent")
|
||||
COMPREPLY=($(compgen -W "$agents" -- ${cur}))
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "-a --agent -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||
COMPREPLY=($(compgen -W "-m --maintainer -t --topic -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"artixpkg admin maintainer"*)
|
||||
case "${comp_cword_all}" in
|
||||
3)
|
||||
COMPREPLY=($(compgen -W "-a --adopt --o --orphan -h --help" -- ${cur}))
|
||||
COMPREPLY=($(compgen -W "-a --adopt -o --orphan -h --help" -- ${cur}))
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "-h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||
@@ -272,7 +281,7 @@ _artixpkg_completion() {
|
||||
COMPREPLY=()
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=($(compgen -W "-a --add -r --remove -d --del -j --jobs -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||
COMPREPLY=($(compgen -W "-a --add -r --remove -d --delete -j --jobs -h --help $(_artixpkg_pkgbase)" -- ${cur}))
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
@@ -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)"
|
||||
local rootfs="${work_dir}/rootfs"
|
||||
|
||||
load_pkgs "${root_list}"
|
||||
load_pkgs "rootfs"
|
||||
|
||||
prepare_dir "${rootfs}"
|
||||
|
||||
@@ -100,7 +100,9 @@ make_rootfs() {
|
||||
|
||||
copy_overlay "${root_overlay}" "${rootfs}"
|
||||
|
||||
[[ -z ${live_list} ]] && configure_chroot "${rootfs}"
|
||||
if ! "${HAS_LIVE}"; then
|
||||
configure_chroot "${rootfs}"
|
||||
fi
|
||||
|
||||
clean_up_chroot "${rootfs}"
|
||||
|
||||
@@ -115,7 +117,7 @@ make_livefs() {
|
||||
msg "Prepare [Live installation] (livefs)"
|
||||
local livefs="${work_dir}/livefs"
|
||||
|
||||
load_pkgs "${live_list}"
|
||||
load_pkgs "livefs"
|
||||
|
||||
prepare_dir "${livefs}"
|
||||
|
||||
@@ -141,7 +143,7 @@ make_bootfs() {
|
||||
if [[ ! -e ${work_dir}/bootfs.lock ]]; then
|
||||
msg "Prepare [/iso/boot]"
|
||||
|
||||
load_pkgs "${common_dir}/Packages-boot"
|
||||
load_pkgs "bootfs"
|
||||
|
||||
prepare_dir "${iso_root}/boot"
|
||||
|
||||
@@ -171,7 +173,9 @@ make_grub(){
|
||||
msg "Prepare [/iso/boot/grub]"
|
||||
|
||||
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"
|
||||
|
||||
@@ -280,7 +284,7 @@ mk_boot(){
|
||||
|
||||
mk_chroots(){
|
||||
run_safe "make_rootfs"
|
||||
if [[ -n ${live_list} ]]; then
|
||||
if "${HAS_LIVE}"; then
|
||||
run_safe "make_livefs"
|
||||
fi
|
||||
}
|
||||
|
@@ -21,13 +21,22 @@ configure_calamares(){
|
||||
msg2 "Configuring: Calamares %s" "$config"
|
||||
|
||||
if [[ -f "$mods"/services-artix.conf ]]; then
|
||||
local svc
|
||||
local svc usvc
|
||||
svc=$(yaml_array "${SERVICES[@]}") \
|
||||
yq -P 'with(.;
|
||||
.command = "artix-service" |
|
||||
.services = env(svc) )' \
|
||||
-i "$mods"/services-artix.conf
|
||||
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
|
||||
done
|
||||
if [[ -d "$1"/etc/calamares-offline ]]; then
|
||||
|
@@ -4,9 +4,21 @@
|
||||
|
||||
#{{{ 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(){
|
||||
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=''
|
||||
conf+=$(printf '%s\n' '# live session configuration')
|
||||
conf+=$(printf "\nAUTOLOGIN=%s\n" "${AUTOLOGIN}")
|
||||
conf+=$(printf "\nPASSWORD=%s\n" "${PASSWORD}")
|
||||
conf+=$(printf "\nLIVEUSER=%s\n" "${LIVEUSER}")
|
||||
printf '%s' "$conf"
|
||||
}
|
||||
|
||||
configure_chroot(){
|
||||
local fs="$1"
|
||||
msg "Configuring [%s]" "${fs##*/}"
|
||||
configure_user "$fs"
|
||||
configure_services "$fs"
|
||||
configure_calamares "$fs"
|
||||
[[ ! -d "$fs/etc/artools" ]] && mkdir -p "$fs/etc/artools"
|
||||
|
@@ -7,6 +7,7 @@
|
||||
show_profile(){
|
||||
msg2 "iso_file: %s" "${iso_file}"
|
||||
msg2 "AUTOLOGIN: %s" "${AUTOLOGIN}"
|
||||
msg2 "LIVEUSER: %s" "${LIVEUSER}"
|
||||
msg2 "PASSWORD: %s" "${PASSWORD}"
|
||||
msg2 "SERVICES: %s" "${SERVICES[*]}"
|
||||
}
|
||||
@@ -15,79 +16,121 @@ load_profile(){
|
||||
local profile_dir="${DATADIR}/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"
|
||||
|
||||
[[ -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"
|
||||
|
||||
common_dir="${DATADIR}/iso-profiles/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
|
||||
[[ -r "$profile_dir/${profile}"/profile.conf ]] && . "$profile_dir/${profile}"/profile.conf
|
||||
common_yaml="${common_dir}/common.yaml"
|
||||
|
||||
AUTOLOGIN=${AUTOLOGIN:-true}
|
||||
[[ -f $profile_yaml ]] || return 1
|
||||
|
||||
PASSWORD=${PASSWORD:-'artix'}
|
||||
LIVEUSER=$(yq -P '.live-session.user' "$profile_yaml")
|
||||
|
||||
if [[ -z "${SERVICES[*]}" ]];then
|
||||
SERVICES=('acpid' 'bluetoothd' 'cronie' 'cupsd' 'syslog-ng' 'connmand')
|
||||
fi
|
||||
PASSWORD=$(yq -P '.live-session.password' "$profile_yaml")
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
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(){
|
||||
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=()
|
||||
|
||||
if [[ "${pkglist##*/}" == "Packages-Root" ]]; then
|
||||
for l in base apps "${INITSYS}"; do
|
||||
msg2 "Loading Packages: [%s] ..." "Packages-${l}"
|
||||
read_from_list "${common_dir}/Packages-${l}"
|
||||
packages+=("${pkgs[@]}")
|
||||
case "$list" in
|
||||
rootfs)
|
||||
msg2 "Loading Packages: [%s] ..." "common.packages-base"
|
||||
mapfile -t common_base < <(yq -P '.packages-base[]' "$common_yaml")
|
||||
|
||||
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: [Packages-xorg] ..."
|
||||
read_from_list "${common_dir}/Packages-xorg"
|
||||
packages+=("${pkgs[@]}")
|
||||
fi
|
||||
msg2 "Loading Packages: [%s] ..." "common.packages-apps"
|
||||
mapfile -t common_apps < <(yq -P '.packages-apps[]' "$common_yaml")
|
||||
|
||||
for svc in "${SERVICES[@]}"; do
|
||||
case "$svc" in
|
||||
sddm|gdm|lightdm|mdm|greetd|lxdm|xdm)
|
||||
packages+=("$svc-${INITSYS}"); display_manager="$svc" ;;
|
||||
NetworkManager) packages+=("networkmanager-${INITSYS}") ;;
|
||||
connmand) packages+=("connman-${INITSYS}") ;;
|
||||
cupsd) packages+=("cups-${INITSYS}") ;;
|
||||
bluetoothd) packages+=("bluez-${INITSYS}") ;;
|
||||
syslog-ng|metalog) packages+=("$svc-${INITSYS}") ;;
|
||||
esac
|
||||
done
|
||||
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
|
||||
msg2 "Loading Packages: [%s] ..." "${pkglist##*/}"
|
||||
read_from_list "${pkglist}"
|
||||
packages+=("${pkgs[@]}")
|
||||
msg2 "Loading Packages: [%s] ..." "rootfs.packages"
|
||||
mapfile -t packages_root < <(yq -P '.rootfs.packages[]' "$profile_yaml")
|
||||
|
||||
msg2 "Loading Packages: [%s] ..." "rootfs.packages-init.${INITSYS}"
|
||||
mapfile -t packages_root_init < <(root_key_init="$root_key_init" yq -P 'eval(strenv(root_key_init))' "$profile_yaml")
|
||||
|
||||
packages+=(
|
||||
"${common_base[@]}"
|
||||
"${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
|
||||
}
|
||||
|
||||
#}}}
|
||||
|
@@ -5,35 +5,68 @@
|
||||
#{{{ services
|
||||
|
||||
add_svc_openrc(){
|
||||
local mnt="$1" names="$2" rlvl="${3:-default}"
|
||||
for svc in $names; do
|
||||
local mnt="$1" rlvl="${2:-default}"
|
||||
for svc in "${SERVICES[@]}"; do
|
||||
if [[ -f $mnt/etc/init.d/$svc ]];then
|
||||
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
||||
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
|
||||
done
|
||||
}
|
||||
|
||||
add_svc_runit(){
|
||||
local mnt="$1" names="$2" rlvl="${3:-default}"
|
||||
for svc in $names; do
|
||||
local mnt="$1" rlvl="${2:-default}"
|
||||
for svc in "${SERVICES[@]}"; do
|
||||
if [[ -d $mnt/etc/runit/sv/$svc ]]; then
|
||||
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
||||
chroot "$mnt" ln -s /etc/runit/sv/"$svc" /etc/runit/runsvdir/"$rlvl" &>/dev/null
|
||||
else
|
||||
warning "Service %s not found. Skipping." "$svc"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
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
|
||||
for svc in $names; do
|
||||
|
||||
for svc in "${SERVICES[@]}"; do
|
||||
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
||||
chroot "$mnt" s6-service add "$rlvl" "$svc"
|
||||
if [[ "$svc" == "$display_manager" ]]; then
|
||||
if [[ -d "$dep" ]]; then
|
||||
touch "$dep"/artix-live
|
||||
if [[ -d "$mnt"/etc/s6/sv/"$svc" ]] || [[ -d "$mnt"/etc/s6/sv/"$svc"-srv ]]; then
|
||||
chroot "$mnt" s6-service add "$rlvl" "$svc"
|
||||
if [[ "$svc" == "$display_manager" ]]; then
|
||||
if [[ -d "$dep" ]]; then
|
||||
touch "$dep"/artix-live
|
||||
fi
|
||||
fi
|
||||
else
|
||||
warning "Service %s not found. Skipping." "$svc"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -47,22 +80,29 @@ add_svc_s6(){
|
||||
chroot "$mnt" cp -a "$src"/bin /usr
|
||||
}
|
||||
|
||||
add_svc_suite66(){
|
||||
local mnt="$1" names="$2"
|
||||
for svc in $names; do
|
||||
if [[ -f "$mnt"/etc/66/service/"$svc" ]]; then
|
||||
add_svc_dinit(){
|
||||
local mnt="$1"
|
||||
for svc in "${SERVICES[@]}"; do
|
||||
if [[ -f "$mnt"/etc/dinit.d/"$svc" ]]; then
|
||||
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
|
||||
done
|
||||
}
|
||||
|
||||
add_svc_dinit(){
|
||||
local mnt="$1" names="$2"
|
||||
for svc in $names; do
|
||||
if [[ -d $mnt/etc/dinit.d/boot.d ]]; then
|
||||
msg2 "Setting %s: [%s]" "${INITSYS}" "$svc"
|
||||
chroot "$mnt" ln -s ../"$svc" /etc/dinit.d/boot.d/"$svc" &>/dev/null
|
||||
add_user_svc_dinit(){
|
||||
local mnt="$1"
|
||||
for svc in "${USER_SERVICES[@]}"; do
|
||||
if [[ -f "$mnt"/etc/dinit.d/user/"$svc" ]]; then
|
||||
msg2 "Setting user %s: [%s]" "${INITSYS}" "$svc"
|
||||
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
|
||||
done
|
||||
}
|
||||
|
@@ -7,6 +7,9 @@ ARTOOLS_INCLUDE_GIT_PULL_SH=1
|
||||
|
||||
set -e
|
||||
|
||||
# shellcheck source=src/lib/pkg/db/db.sh
|
||||
source "${LIBDIR}"/pkg/db/db.sh
|
||||
|
||||
|
||||
artixpkg_git_pull_usage() {
|
||||
local -r COMMAND=${_ARTOOLS_COMMAND:-${BASH_SOURCE[0]##*/}}
|
||||
@@ -123,6 +126,11 @@ artixpkg_git_pull() {
|
||||
die 'failed to pull %s' "${pkgbase}"
|
||||
fi
|
||||
|
||||
msg "Querying ${pkgbase} ..."
|
||||
if ! show_db; then
|
||||
warning "Could not query ${REPO_DB}"
|
||||
fi
|
||||
|
||||
)
|
||||
else
|
||||
warning "Skip pulling ${pkgbase}: Directory does not exist"
|
||||
|
@@ -61,8 +61,6 @@ patch_pkgbase(){
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
git --no-pager diff PKGBUILD
|
||||
}
|
||||
|
||||
artixpkg_repo_import_usage() {
|
||||
@@ -142,7 +140,9 @@ artixpkg_repo_import() {
|
||||
esac
|
||||
done
|
||||
|
||||
update_patches
|
||||
if ! (( NP )); then
|
||||
update_patches
|
||||
fi
|
||||
|
||||
pkgbases+=("$@")
|
||||
|
||||
@@ -159,16 +159,18 @@ artixpkg_repo_import() {
|
||||
upstream="${arch_map["$pkgbase"]:-$pkgbase}"
|
||||
|
||||
stat_busy "Checking for upstream url"
|
||||
if ! git config --local --get remote.upstream.url &>/dev/null; then
|
||||
if ! git config get remote.upstream.url &>/dev/null; then
|
||||
git remote add upstream "${GIT_UPSTREAM_URL}/${upstream}".git
|
||||
fi
|
||||
stat_done
|
||||
|
||||
msg2 "Fetching upstream tags"
|
||||
git fetch --tags upstream main
|
||||
stat_busy "Fetching upstream tags"
|
||||
git fetch -fq --prune --tags upstream main
|
||||
stat_done
|
||||
|
||||
local latest version
|
||||
latest=$(git describe --tags FETCH_HEAD)
|
||||
|
||||
version="${latest}"
|
||||
if [[ -n "${TAG}" ]]; then
|
||||
version="${TAG}"
|
||||
@@ -180,21 +182,22 @@ artixpkg_repo_import() {
|
||||
warning "Could not query ${REPO_DB}"
|
||||
fi
|
||||
|
||||
git checkout "${version}" -b "${version}" &>/dev/null
|
||||
git checkout -q "${version}" -b "${version}"
|
||||
local temp
|
||||
temp=$(mktemp -d --tmpdir "${pkgbase}.XXXXXXXXXX")
|
||||
|
||||
rsync "${rsync_args[@]}" "$(pwd)"/ "${temp}"/ &>/dev/null
|
||||
git checkout master &>/dev/null
|
||||
git branch -D "${version}" &>/dev/null
|
||||
rsync "${rsync_args[@]}" -q "$(pwd)"/ "${temp}"/
|
||||
git checkout -q master
|
||||
git branch -q -D "${version}"
|
||||
|
||||
msg "Importing upstream changeset for ${version}"
|
||||
rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/ #&>/dev/null
|
||||
rsync "${rsync_args[@]}" "${temp}"/ "$(pwd)"/
|
||||
|
||||
if ! (( NP )); then
|
||||
msg2 "Patching ${pkgbase} ..."
|
||||
patch_pkgbase "${pkgbase}"
|
||||
fi
|
||||
git --no-pager diff PKGBUILD
|
||||
fi
|
||||
)
|
||||
fi
|
||||
|
@@ -138,6 +138,9 @@ artixpkg_repo_move() {
|
||||
update_yaml_move "${SRC}" "${DEST}"
|
||||
|
||||
team=$(detect_team)
|
||||
if [[ -z "$team" ]]; then
|
||||
team=$(team_from_yaml)
|
||||
fi
|
||||
update_yaml_team "${team}"
|
||||
|
||||
if [[ -z ${AGENT} ]]; then
|
||||
@@ -156,6 +159,9 @@ artixpkg_repo_move() {
|
||||
if [[ "$f" == "${REPO_DB}" ]]; then
|
||||
git add "$f"
|
||||
fi
|
||||
if [[ "$f" == "${REPO_CI}" ]]; then
|
||||
git add "$f"
|
||||
fi
|
||||
done
|
||||
for f in $(git ls-files --others); do
|
||||
if [[ "$f" == "${SRCINFO}" ]]; then
|
||||
|
@@ -112,7 +112,9 @@ artixpkg_repo_remove() {
|
||||
local commit_msg
|
||||
commit_msg=$(get_commit_msg 'remove' "${DEST}")
|
||||
|
||||
# pkg2yaml -o "${SRCINFO}"
|
||||
if ! [[ -f "${SRCINFO}" ]]; then
|
||||
pkg2yaml -o "${SRCINFO}"
|
||||
fi
|
||||
|
||||
upgrade_db
|
||||
|
||||
@@ -130,6 +132,14 @@ artixpkg_repo_remove() {
|
||||
if [[ "$f" == "${REPO_DB}" ]]; then
|
||||
git add "$f"
|
||||
fi
|
||||
if [[ "$f" == "${REPO_CI}" ]]; then
|
||||
git add "$f"
|
||||
fi
|
||||
done
|
||||
for f in $(git ls-files --others); do
|
||||
if [[ "$f" == "${SRCINFO}" ]]; then
|
||||
git add "$f"
|
||||
fi
|
||||
done
|
||||
stat_done
|
||||
|
||||
|
@@ -64,6 +64,8 @@ load_pkg_config(){
|
||||
|
||||
PATCH_URL=${PATCH_URL:-"${GIT_SSH}:artix/artix-patches.git"}
|
||||
|
||||
PKGDEST_DBG=${PKGDEST_DBG:-"${WORKSPACE_DIR}/packages-debug"}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@@ -31,6 +31,18 @@ remove(){
|
||||
# pkg removal will be done by a patched repo-remove honoring -R
|
||||
}
|
||||
|
||||
update_dbg() {
|
||||
local rmp
|
||||
rmp=${pkgname%"${PKGEXT}"}
|
||||
rmp=${rmp%-*}
|
||||
rmp=${rmp%-*}
|
||||
rm -fv "${PKGDEST_DBG}/${rmp}"*
|
||||
if pkgfile=$(find_cached_pkgfile "${pkgname}"); then
|
||||
msg "Found: %s" "${pkgfile}"
|
||||
ln -sfv "${pkgfile}" "${PKGDEST_DBG}"/
|
||||
fi
|
||||
}
|
||||
|
||||
repo_action() {
|
||||
local repo_path
|
||||
# shellcheck disable=SC2153
|
||||
@@ -40,11 +52,13 @@ repo_action() {
|
||||
for pkgname in "${passfiles[@]}"; do
|
||||
"$func"
|
||||
done
|
||||
( cd "${repo_path}" || return
|
||||
if [[ -n "${action}" ]]; then
|
||||
repo-"${action}" "${action_args[@]}" "${dest_repo}.${db_ext}" "${packages[@]}"
|
||||
fi
|
||||
)
|
||||
if ! "${dbg_pkg}"; then
|
||||
( cd "${repo_path}" || return
|
||||
if [[ -n "${action}" ]]; then
|
||||
repo-"${action}" "${action_args[@]}" "${dest_repo}.${db_ext}" "${packages[@]}"
|
||||
fi
|
||||
)
|
||||
fi
|
||||
}
|
||||
|
||||
#}}}
|
||||
@@ -55,9 +69,10 @@ db_ext="db.tar.${DBEXT}"
|
||||
|
||||
add_pkg=false
|
||||
rm_pkg=false
|
||||
dbg_pkg=false
|
||||
|
||||
cmd=${0##*/}
|
||||
dest_repo=${cmd#*-}
|
||||
dest_repo=world #${cmd#*-}
|
||||
action_args=(-R)
|
||||
|
||||
usage() {
|
||||
@@ -65,19 +80,21 @@ usage() {
|
||||
printf ' -d <dest> Destination repository\n'
|
||||
printf ' -a Add package(s) to repository\n'
|
||||
printf ' -r Remove package(s) from repository\n'
|
||||
printf ' -u Update debug repository\n'
|
||||
printf ' -h This help\n'
|
||||
printf '\n'
|
||||
printf '\n'
|
||||
exit "$1"
|
||||
}
|
||||
|
||||
opts='arLRhd:'
|
||||
opts='uarhd:'
|
||||
|
||||
while getopts "${opts}" arg; do
|
||||
case "${arg}" in
|
||||
d) dest_repo="$OPTARG" ;;
|
||||
a) add_pkg=true; rm_pkg=false ;;
|
||||
r) rm_pkg=true; add_pkg=false ;;
|
||||
u) dbg_pkg=true ;;
|
||||
h|?) usage 0 ;;
|
||||
esac
|
||||
done
|
||||
@@ -87,10 +104,14 @@ shift $(( OPTIND - 1 ))
|
||||
passfiles=("$@")
|
||||
|
||||
if [[ -n "${passfiles[*]}" ]]; then
|
||||
if ${add_pkg}; then
|
||||
repo_action add
|
||||
fi
|
||||
if ${rm_pkg}; then
|
||||
repo_action remove
|
||||
if ! "${dbg_pkg}"; then
|
||||
if ${add_pkg}; then
|
||||
repo_action add
|
||||
fi
|
||||
if ${rm_pkg}; then
|
||||
repo_action remove
|
||||
fi
|
||||
else
|
||||
repo_action update_dbg
|
||||
fi
|
||||
fi
|
||||
|
Reference in New Issue
Block a user