Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3f05c3e97d | ||
![]() |
edb486c662 | ||
![]() |
088ae05ad8 | ||
![]() |
0cbbe9f23f | ||
![]() |
f591a6b94e | ||
![]() |
47d7a47d96 | ||
![]() |
f0a5f0f442 | ||
![]() |
d3b67b4a1b | ||
![]() |
00e041a143 | ||
![]() |
3b70c77f35 |
9
Makefile
9
Makefile
@@ -1,4 +1,4 @@
|
|||||||
Version=0.3
|
Version=0.4
|
||||||
|
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
SYSCONFDIR = /etc
|
SYSCONFDIR = /etc
|
||||||
@@ -51,9 +51,6 @@ LIBS_PKG = \
|
|||||||
SHARED_PKG = \
|
SHARED_PKG = \
|
||||||
data/makepkg.conf
|
data/makepkg.conf
|
||||||
|
|
||||||
LIST_ISO = \
|
|
||||||
$(wildcard data/iso.list.d/*.list)
|
|
||||||
|
|
||||||
BIN_ISO = \
|
BIN_ISO = \
|
||||||
bin/buildiso \
|
bin/buildiso \
|
||||||
bin/deployiso
|
bin/deployiso
|
||||||
@@ -155,9 +152,6 @@ install_pkg:
|
|||||||
gzip -c man/buildtree.1 > $(DESTDIR)$(PREFIX)/share/man/man1/buildtree.1.gz
|
gzip -c man/buildtree.1 > $(DESTDIR)$(PREFIX)/share/man/man1/buildtree.1.gz
|
||||||
|
|
||||||
install_iso:
|
install_iso:
|
||||||
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/artools/iso.list.d
|
|
||||||
install -m0644 ${LIST_ISO} $(DESTDIR)$(SYSCONFDIR)/artools/iso.list.d
|
|
||||||
|
|
||||||
install -dm0755 $(DESTDIR)$(PREFIX)/bin
|
install -dm0755 $(DESTDIR)$(PREFIX)/bin
|
||||||
install -m0755 ${BIN_ISO} $(DESTDIR)$(PREFIX)/bin
|
install -m0755 ${BIN_ISO} $(DESTDIR)$(PREFIX)/bin
|
||||||
|
|
||||||
@@ -215,7 +209,6 @@ uninstall_pkg:
|
|||||||
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/buildtree.1.gz
|
rm -f $(DESTDIR)$(PREFIX)/share/man/man1/buildtree.1.gz
|
||||||
|
|
||||||
uninstall_iso:
|
uninstall_iso:
|
||||||
for f in ${LIST_ISO}; do rm -f $(DESTDIR)$(SYSCONFDIR)/artools/iso.list.d/$$f; done
|
|
||||||
for f in ${BIN_ISO}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
|
for f in ${BIN_ISO}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
|
||||||
for f in ${SHARED_ISO}; do rm -f $(DESTDIR)$(PREFIX)/share/artools/$$f; done
|
for f in ${SHARED_ISO}; do rm -f $(DESTDIR)$(PREFIX)/share/artools/$$f; done
|
||||||
|
|
||||||
|
@@ -19,56 +19,17 @@ SYSCONFDIR='@sysconfdir@'
|
|||||||
import ${LIBDIR}/util.sh
|
import ${LIBDIR}/util.sh
|
||||||
import ${LIBDIR}/util-iso.sh
|
import ${LIBDIR}/util-iso.sh
|
||||||
|
|
||||||
prepare_build(){
|
|
||||||
timer_start=$(get_timer)
|
|
||||||
profile=$1
|
|
||||||
local profile_dir=${run_dir}/${profile}
|
|
||||||
|
|
||||||
load_profile "${profile_dir}"
|
|
||||||
|
|
||||||
local user_conf=${profile_dir}/user-repos.conf pac_arch='default' pacman_conf
|
|
||||||
[[ "${target_arch}" == 'x86_64' ]] && pac_arch='multilib'
|
|
||||||
if [[ -f ${user_conf} ]];then
|
|
||||||
info "detected: %s" "user-repos.conf"
|
|
||||||
check_user_repos_conf "${user_conf}"
|
|
||||||
pacman_conf=${tmp_dir}/custom-pacman.conf
|
|
||||||
cat ${DATADIR}/pacman-$pac_arch.conf ${user_conf} > "$pacman_conf"
|
|
||||||
else
|
|
||||||
pacman_conf="${DATADIR}/pacman-$pac_arch.conf"
|
|
||||||
fi
|
|
||||||
|
|
||||||
iso_file=$(gen_iso_fn).iso
|
|
||||||
|
|
||||||
mkchroot_args+=(-C ${pacman_conf})
|
|
||||||
work_dir=${chroots_iso}/${profile}/${target_arch}
|
|
||||||
|
|
||||||
iso_dir="${cache_dir_iso}/${profile}"
|
|
||||||
|
|
||||||
iso_root=${chroots_iso}/${profile}/iso
|
|
||||||
mnt_dir=${chroots_iso}/${profile}/mnt
|
|
||||||
prepare_dir "${mnt_dir}"
|
|
||||||
prepare_dir "${iso_dir}"
|
|
||||||
}
|
|
||||||
|
|
||||||
show_profile(){
|
show_profile(){
|
||||||
local prof="$1"
|
prepare_build
|
||||||
prepare_build "$prof"
|
|
||||||
msg2 "iso_file: %s" "${iso_file}"
|
msg2 "iso_file: %s" "${iso_file}"
|
||||||
if ${verbose};then
|
if ${verbose};then
|
||||||
msg2 "autologin: %s" "${autologin}"
|
msg2 "autologin: %s" "${autologin}"
|
||||||
|
|
||||||
[[ ${target_arch} == 'x86_64' ]] && msg2 "multilib: %s" "${multilib}"
|
msg2 "netgroups: %s" "$(get_yaml)"
|
||||||
|
|
||||||
msg2 "extra: %s" "${extra}"
|
|
||||||
|
|
||||||
msg2 "netinstall: %s" "${netinstall}"
|
|
||||||
msg2 "chrootcfg: %s" "${chrootcfg}"
|
|
||||||
${netinstall} && msg2 "netgroups: %s" "$(get_yaml)"
|
|
||||||
|
|
||||||
msg2 "hostname: %s" "${hostname}"
|
msg2 "hostname: %s" "${hostname}"
|
||||||
msg2 "username: %s" "${username}"
|
msg2 "username: %s" "${username}"
|
||||||
msg2 "password: %s" "${password}"
|
msg2 "password: %s" "${password}"
|
||||||
msg2 "login_shell: %s" "${login_shell}"
|
|
||||||
msg2 "addgroups: %s" "${addgroups}"
|
msg2 "addgroups: %s" "${addgroups}"
|
||||||
|
|
||||||
msg2 "enable_live: %s" "${enable_live[*]}"
|
msg2 "enable_live: %s" "${enable_live[*]}"
|
||||||
@@ -82,12 +43,8 @@ display_settings(){
|
|||||||
show_version
|
show_version
|
||||||
show_config
|
show_config
|
||||||
|
|
||||||
# msg "PROFILE:"
|
|
||||||
# msg2 "build_lists: %s" "$(show_build_lists ${list_dir_iso})"
|
|
||||||
# msg2 "build_list_iso: %s" "${build_list_iso}"
|
|
||||||
msg2 "is_build_list: %s" "${is_build_list}"
|
|
||||||
|
|
||||||
msg "OPTIONS:"
|
msg "OPTIONS:"
|
||||||
|
msg2 "profile: %s" "${profile}"
|
||||||
msg2 "arch: %s" "${target_arch}"
|
msg2 "arch: %s" "${target_arch}"
|
||||||
msg2 "initsys: %s" "${initsys}"
|
msg2 "initsys: %s" "${initsys}"
|
||||||
msg2 "kernel: %s" "${kernel}"
|
msg2 "kernel: %s" "${kernel}"
|
||||||
@@ -104,8 +61,8 @@ display_settings(){
|
|||||||
msg2 "dist_release: %s" "${dist_release}"
|
msg2 "dist_release: %s" "${dist_release}"
|
||||||
msg2 "dist_branding: %s" "${dist_branding}"
|
msg2 "dist_branding: %s" "${dist_branding}"
|
||||||
|
|
||||||
msg "BUILD QUEUE:"
|
msg "BUILD:"
|
||||||
run show_profile "${build_list_iso}"
|
show_profile
|
||||||
}
|
}
|
||||||
|
|
||||||
load_user_info
|
load_user_info
|
||||||
@@ -122,10 +79,11 @@ verbose=false
|
|||||||
persist=false
|
persist=false
|
||||||
|
|
||||||
mkchroot_args=()
|
mkchroot_args=()
|
||||||
|
profile=lxqt
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: ${0##*/} [options]"
|
echo "Usage: ${0##*/} [options]"
|
||||||
echo " -p <profile> Buildset or profile [default: ${build_list_iso}]"
|
echo " -p <profile> Profile [default: ${profile}]"
|
||||||
echo " -a <arch> Arch [default: ${target_arch}]"
|
echo " -a <arch> Arch [default: ${target_arch}]"
|
||||||
echo ' -r <dir> Chroots directory'
|
echo ' -r <dir> Chroots directory'
|
||||||
echo " [default: ${chroots_iso}]"
|
echo " [default: ${chroots_iso}]"
|
||||||
@@ -156,7 +114,7 @@ opts='p:a:r:t:k:i:g:czxmvqh'
|
|||||||
|
|
||||||
while getopts "${opts}" arg; do
|
while getopts "${opts}" arg; do
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
p) build_list_iso="$OPTARG" ;;
|
p) profile="$OPTARG" ;;
|
||||||
a) target_arch="$OPTARG" ;;
|
a) target_arch="$OPTARG" ;;
|
||||||
r) chroots_iso="$OPTARG" ;;
|
r) chroots_iso="$OPTARG" ;;
|
||||||
t) cache_dir_iso="$OPTARG" ;;
|
t) cache_dir_iso="$OPTARG" ;;
|
||||||
@@ -182,4 +140,4 @@ check_requirements
|
|||||||
|
|
||||||
${pretend} && display_settings && exit 1
|
${pretend} && display_settings && exit 1
|
||||||
|
|
||||||
run build "${build_list_iso}"
|
build
|
||||||
|
@@ -37,9 +37,6 @@ display_settings(){
|
|||||||
show_version
|
show_version
|
||||||
show_config
|
show_config
|
||||||
|
|
||||||
# msg "PROFILE:"
|
|
||||||
# msg2 "build_lists: %s" "$(show_build_lists ${list_dir_pkg})"
|
|
||||||
# msg2 "build_list_pkg: %s" "${build_list_pkg}"
|
|
||||||
msg2 "is_build_list: %s" "${is_build_list}"
|
msg2 "is_build_list: %s" "${is_build_list}"
|
||||||
|
|
||||||
msg "OPTIONS:"
|
msg "OPTIONS:"
|
||||||
@@ -64,7 +61,7 @@ display_settings(){
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
msg "BUILD QUEUE:"
|
msg "BUILD QUEUE:"
|
||||||
run show_pkg "${build_list_pkg}"
|
run show_pkg "${build_list}"
|
||||||
}
|
}
|
||||||
|
|
||||||
load_user_info
|
load_user_info
|
||||||
@@ -106,7 +103,7 @@ prepare_build(){
|
|||||||
|
|
||||||
[[ "$pac_arch" == 'multilib' ]] && target_arch='x86_64'
|
[[ "$pac_arch" == 'multilib' ]] && target_arch='x86_64'
|
||||||
|
|
||||||
mkchroot_args+=(-C ${pacman_conf} -M ${makepkg_conf} -U "${build_mirror}")
|
mkchroot_args+=(-C ${pacman_conf} -M ${makepkg_conf})
|
||||||
|
|
||||||
mkchrootpkg_args+=(-r ${work_dir})
|
mkchrootpkg_args+=(-r ${work_dir})
|
||||||
|
|
||||||
@@ -114,7 +111,7 @@ prepare_build(){
|
|||||||
|
|
||||||
prepare_dir "${work_dir}"
|
prepare_dir "${work_dir}"
|
||||||
|
|
||||||
eval_build_list "${list_dir_pkg}" "${build_list_pkg}"
|
eval_build_list "${build_list}"
|
||||||
|
|
||||||
packages=('base-devel')
|
packages=('base-devel')
|
||||||
${is_multilib} && packages+=('multilib-devel')
|
${is_multilib} && packages+=('multilib-devel')
|
||||||
@@ -124,7 +121,7 @@ prepare_build(){
|
|||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: ${0##*/} [options]"
|
echo "Usage: ${0##*/} [options]"
|
||||||
echo " -p <pkg> Build list or pkg [default: ${build_list_pkg}]"
|
echo " -p <pkg> Build list or pkg [default: ${build_list}]"
|
||||||
echo " -a <arch> Arch [default: ${target_arch}]"
|
echo " -a <arch> Arch [default: ${target_arch}]"
|
||||||
echo ' -r <dir> Chroots directory'
|
echo ' -r <dir> Chroots directory'
|
||||||
echo " [default: ${chroots_pkg}]"
|
echo " [default: ${chroots_pkg}]"
|
||||||
@@ -149,7 +146,7 @@ opts='p:a:r:i:odcuwnsqh'
|
|||||||
|
|
||||||
while getopts "${opts}" arg; do
|
while getopts "${opts}" arg; do
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
p) build_list_pkg="$OPTARG" ;;
|
p) build_list="$OPTARG" ;;
|
||||||
a) target_arch="$OPTARG" ;;
|
a) target_arch="$OPTARG" ;;
|
||||||
r) chroots_pkg="$OPTARG" ;;
|
r) chroots_pkg="$OPTARG" ;;
|
||||||
i) install_pkgs+=("$OPTARG"); mkchrootpkg_args+=(-I "${install_pkgs[*]}") ;;
|
i) install_pkgs+=("$OPTARG"); mkchrootpkg_args+=(-I "${install_pkgs[*]}") ;;
|
||||||
@@ -178,4 +175,4 @@ ${delete_first} && delete_chroot "${work_dir}/root" "${work_dir}"
|
|||||||
|
|
||||||
${create_first} && create_chroot "${mkchroot_args[@]}" "${work_dir}/root" "${packages[@]}"
|
${create_first} && create_chroot "${mkchroot_args[@]}" "${work_dir}/root" "${packages[@]}"
|
||||||
|
|
||||||
run make_pkg "${build_list_pkg}"
|
run make_pkg "${build_list}"
|
||||||
|
@@ -20,34 +20,16 @@ import ${LIBDIR}/util.sh
|
|||||||
import ${LIBDIR}/util-yaml-check.sh
|
import ${LIBDIR}/util-yaml-check.sh
|
||||||
import ${LIBDIR}/util-profile.sh
|
import ${LIBDIR}/util-profile.sh
|
||||||
|
|
||||||
prepare_check(){
|
|
||||||
local profile="$1"
|
|
||||||
local profile_dir=${run_dir}/${profile}
|
|
||||||
|
|
||||||
load_profile "${profile_dir}"
|
|
||||||
|
|
||||||
yaml_dir=${cache_dir_netinstall}/${profile}/${target_arch}
|
|
||||||
|
|
||||||
prepare_dir "${yaml_dir}"
|
|
||||||
}
|
|
||||||
|
|
||||||
show_profile(){
|
show_profile(){
|
||||||
prepare_check "$1"
|
prepare_build
|
||||||
msg2 "yaml_dir: %s" "${yaml_dir}"
|
msg2 "yaml_dir: %s" "${yaml_dir}"
|
||||||
msg2 "autologin: %s" "${autologin}"
|
msg2 "autologin: %s" "${autologin}"
|
||||||
|
|
||||||
[[ ${target_arch} == 'x86_64' ]] && msg2 "multilib: %s" "${multilib}"
|
msg2 "netgroups: %s" "$(get_yaml)"
|
||||||
|
|
||||||
msg2 "extra: %s" "${extra}"
|
|
||||||
|
|
||||||
msg2 "netinstall: %s" "${netinstall}"
|
|
||||||
msg2 "chrootcfg: %s" "${chrootcfg}"
|
|
||||||
${netinstall} && msg2 "netgroups: %s" "$(get_yaml)"
|
|
||||||
|
|
||||||
msg2 "hostname: %s" "${hostname}"
|
msg2 "hostname: %s" "${hostname}"
|
||||||
msg2 "username: %s" "${username}"
|
msg2 "username: %s" "${username}"
|
||||||
msg2 "password: %s" "${password}"
|
msg2 "password: %s" "${password}"
|
||||||
msg2 "login_shell: %s" "${login_shell}"
|
|
||||||
msg2 "addgroups: %s" "${addgroups}"
|
msg2 "addgroups: %s" "${addgroups}"
|
||||||
|
|
||||||
msg2 "enable_live: %s" "${enable_live[*]}"
|
msg2 "enable_live: %s" "${enable_live[*]}"
|
||||||
@@ -62,12 +44,8 @@ display_settings(){
|
|||||||
show_version
|
show_version
|
||||||
show_config
|
show_config
|
||||||
|
|
||||||
# msg "PROFILE:"
|
|
||||||
# msg2 "build_lists: %s" "$(show_build_lists ${list_dir_iso})"
|
|
||||||
# msg2 "build_list_iso: %s" "${build_list_iso}"
|
|
||||||
msg2 "is_build_list: %s" "${is_build_list}"
|
|
||||||
|
|
||||||
msg "OPTIONS:"
|
msg "OPTIONS:"
|
||||||
|
msg2 "profile: %s" "${profile}"
|
||||||
msg2 "arch: %s" "${target_arch}"
|
msg2 "arch: %s" "${target_arch}"
|
||||||
msg2 "initsys: %s" "${initsys}"
|
msg2 "initsys: %s" "${initsys}"
|
||||||
msg2 "kernel: %s" "${kernel}"
|
msg2 "kernel: %s" "${kernel}"
|
||||||
@@ -76,8 +54,8 @@ display_settings(){
|
|||||||
msg2 "calamares: %s" "${calamares}"
|
msg2 "calamares: %s" "${calamares}"
|
||||||
msg2 "group: %s" "${group}"
|
msg2 "group: %s" "${group}"
|
||||||
|
|
||||||
msg "CHECK QUEUE:"
|
msg "BUILD:"
|
||||||
run show_profile "${build_list_iso}"
|
show_profile
|
||||||
}
|
}
|
||||||
|
|
||||||
load_user_info
|
load_user_info
|
||||||
@@ -93,10 +71,11 @@ calamares=false
|
|||||||
pretend=false
|
pretend=false
|
||||||
group=false
|
group=false
|
||||||
cache_dir_netinstall="${workspace_dir}/netinstall"
|
cache_dir_netinstall="${workspace_dir}/netinstall"
|
||||||
|
profile=lxqt
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: ${0##*/} [options]"
|
echo "Usage: ${0##*/} [options]"
|
||||||
echo " -p <profile> Buildset or profile [default: ${build_list_iso}]"
|
echo " -p <profile> Buildset or profile [default: ${profile}]"
|
||||||
echo " -a <arch> Arch [default: ${target_arch}]"
|
echo " -a <arch> Arch [default: ${target_arch}]"
|
||||||
echo " -k <name> Kernel to use[default: ${kernel}]"
|
echo " -k <name> Kernel to use[default: ${kernel}]"
|
||||||
echo " -i <name> Init system to use [default: ${initsys}]"
|
echo " -i <name> Init system to use [default: ${initsys}]"
|
||||||
@@ -115,7 +94,7 @@ opts='p:a:i:k:gcqh'
|
|||||||
|
|
||||||
while getopts "${opts}" arg; do
|
while getopts "${opts}" arg; do
|
||||||
case "${arg}" in
|
case "${arg}" in
|
||||||
p) build_list_iso="$OPTARG" ;;
|
p) profile="$OPTARG" ;;
|
||||||
a) target_arch="$OPTARG" ;;
|
a) target_arch="$OPTARG" ;;
|
||||||
i) initsys="$OPTARG" ;;
|
i) initsys="$OPTARG" ;;
|
||||||
k) kernel="$OPTARG" ;;
|
k) kernel="$OPTARG" ;;
|
||||||
@@ -129,10 +108,8 @@ done
|
|||||||
|
|
||||||
shift $(($OPTIND - 1))
|
shift $(($OPTIND - 1))
|
||||||
|
|
||||||
eval_build_list "${list_dir_iso}" "${build_list_iso}"
|
|
||||||
|
|
||||||
${pretend} && display_settings && exit 1
|
${pretend} && display_settings && exit 1
|
||||||
|
|
||||||
${group} && write_pacman_group_yaml "${build_list_iso}" && exit 0
|
${group} && write_pacman_group_yaml "${profile}" && exit 0
|
||||||
|
|
||||||
run make_profile_yaml "${build_list_iso}"
|
build
|
||||||
|
@@ -18,18 +18,12 @@ SYSCONFDIR='@sysconfdir@'
|
|||||||
import ${LIBDIR}/util.sh
|
import ${LIBDIR}/util.sh
|
||||||
import ${LIBDIR}/util-iso-publish.sh
|
import ${LIBDIR}/util-iso-publish.sh
|
||||||
|
|
||||||
show_profile(){
|
|
||||||
prepare_transfer "$1"
|
|
||||||
info "Profile: [$1]"
|
|
||||||
msg2 "src_dir: ${src_dir}"
|
|
||||||
msg2 "target_dir: ${target_dir}"
|
|
||||||
}
|
|
||||||
|
|
||||||
display_settings(){
|
display_settings(){
|
||||||
show_version
|
show_version
|
||||||
show_config
|
show_config
|
||||||
|
|
||||||
msg "OPTIONS:"
|
msg "OPTIONS:"
|
||||||
|
msg2 "profile: %s" "${profile}"
|
||||||
msg2 "uplimit: %s kB/s" "${uplimit}"
|
msg2 "uplimit: %s kB/s" "${uplimit}"
|
||||||
# msg2 "dist_release: %s" "${dist_release}"
|
# msg2 "dist_release: %s" "${dist_release}"
|
||||||
|
|
||||||
@@ -51,7 +45,8 @@ display_settings(){
|
|||||||
msg2 "project: %s" "${project}"
|
msg2 "project: %s" "${project}"
|
||||||
|
|
||||||
msg "UPLOAD:"
|
msg "UPLOAD:"
|
||||||
show_profile "${profile}"
|
msg2 "src_dir: ${src_dir}"
|
||||||
|
msg2 "target_dir: ${target_dir}"
|
||||||
}
|
}
|
||||||
|
|
||||||
load_user_info
|
load_user_info
|
||||||
@@ -62,13 +57,13 @@ pretend=false
|
|||||||
update=false
|
update=false
|
||||||
verbose=false
|
verbose=false
|
||||||
torrent=false
|
torrent=false
|
||||||
profile=''
|
profile=lxqt
|
||||||
|
|
||||||
rsync_args=(-aP --progress -e ssh)
|
rsync_args=(-aP --progress -e ssh)
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: ${0##*/} [options]"
|
echo "Usage: ${0##*/} [options]"
|
||||||
echo " -p Source folder to upload"
|
echo " -p Source folder to upload [default: ${profile}]"
|
||||||
echo " -l Limit bandwidth in kB/s [default:${uplimit}]"
|
echo " -l Limit bandwidth in kB/s [default:${uplimit}]"
|
||||||
echo ' -u Update remote directory'
|
echo ' -u Update remote directory'
|
||||||
echo ' -t Create iso torrent'
|
echo ' -t Create iso torrent'
|
||||||
@@ -101,6 +96,8 @@ timer_start=$(get_timer)
|
|||||||
|
|
||||||
rsync_args+=(--bwlimit=${uplimit})
|
rsync_args+=(--bwlimit=${uplimit})
|
||||||
|
|
||||||
|
prepare_transfer
|
||||||
|
|
||||||
${pretend} && display_settings #&& exit 1
|
${pretend} && display_settings #&& exit 1
|
||||||
|
|
||||||
sync_dir "${profile}"
|
sync_dir
|
||||||
|
@@ -38,13 +38,10 @@
|
|||||||
################ buildpkg ################
|
################ buildpkg ################
|
||||||
|
|
||||||
# default pkg build list; name without .list extension
|
# default pkg build list; name without .list extension
|
||||||
# build_list_pkg=default
|
# build_list=default
|
||||||
|
|
||||||
################ buildiso ################
|
################ buildiso ################
|
||||||
|
|
||||||
# default iso build list; name without .list extension
|
|
||||||
# build_list_iso=default
|
|
||||||
|
|
||||||
# the dist release; default: auto
|
# the dist release; default: auto
|
||||||
# dist_release=rolling
|
# dist_release=rolling
|
||||||
|
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
lxqt
|
|
@@ -2,12 +2,6 @@
|
|||||||
###### use this file in the profile ######
|
###### use this file in the profile ######
|
||||||
##########################################
|
##########################################
|
||||||
|
|
||||||
# use multilib packages; x86_64 only
|
|
||||||
# multilib="true"
|
|
||||||
|
|
||||||
# use extra packages as defined in pkglist to activate a full profile
|
|
||||||
# extra="false"
|
|
||||||
|
|
||||||
################ install ################
|
################ install ################
|
||||||
|
|
||||||
# default displaymanager: none
|
# default displaymanager: none
|
||||||
@@ -17,12 +11,6 @@
|
|||||||
# Set to false to disable autologin in the livecd
|
# Set to false to disable autologin in the livecd
|
||||||
# autologin="true"
|
# autologin="true"
|
||||||
|
|
||||||
# configure calamares for netinstall
|
|
||||||
# netinstall="false"
|
|
||||||
|
|
||||||
# configure calamares to use chrootcfg instead of unpackfs; default: unpackfs
|
|
||||||
# chrootcfg="false"
|
|
||||||
|
|
||||||
# service runlevels
|
# service runlevels
|
||||||
# openrc_boot=('elogind')
|
# openrc_boot=('elogind')
|
||||||
# openrc_default=('acpid' 'bluetooth' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager')
|
# openrc_default=('acpid' 'bluetooth' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager')
|
||||||
|
@@ -173,7 +173,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>build_list_pkg=</varname></term>
|
<term><varname>build_list=</varname></term>
|
||||||
|
|
||||||
<listitem><para>Default list for buildpkg without the .list
|
<listitem><para>Default list for buildpkg without the .list
|
||||||
extension.
|
extension.
|
||||||
@@ -189,13 +189,6 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<para>The following options are understood:</para>
|
<para>The following options are understood:</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
|
||||||
<term><varname>build_list_iso=</varname></term>
|
|
||||||
|
|
||||||
<listitem><para>Default list for buildiso without the .list
|
|
||||||
extension.
|
|
||||||
</para></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>dist_release=</varname></term>
|
<term><varname>dist_release=</varname></term>
|
||||||
|
@@ -75,8 +75,8 @@ along with artools; If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>-p PROFILE...</option></term>
|
<term><option>-p PROFILE...</option></term>
|
||||||
|
|
||||||
<listitem><para>Name of the build list or name of the directory
|
<listitem><para>Name of the name of the directory
|
||||||
you will build. It needs to contain an existing build list or a
|
you will build. It needs to contain a
|
||||||
folder with a valid profile.</para></listitem>
|
folder with a valid profile.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
@@ -73,7 +73,7 @@ along with artools; If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>-p PROFILE...</option></term>
|
<term><option>-p PROFILE...</option></term>
|
||||||
|
|
||||||
<listitem><para>Name of the build list or name of the directory.</para></listitem>
|
<listitem><para>Name of the profile directory.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
@@ -73,7 +73,7 @@ along with artools; If not, see <http://www.gnu.org/licenses/>.
|
|||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>-p PROFILE...</option></term>
|
<term><option>-p PROFILE...</option></term>
|
||||||
|
|
||||||
<listitem><para>Name of the build list or name of the directory
|
<listitem><para>Name of the iso profile directory
|
||||||
you will upload.</para></listitem>
|
you will upload.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
|
@@ -91,42 +91,6 @@ along with artools; If not, see <http://www.gnu.org/licenses/>.
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>netinstall=</varname></term>
|
|
||||||
|
|
||||||
<listitem><para>Accepts
|
|
||||||
<option>false</option> (the default)
|
|
||||||
<option>true</option>.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>chrootcfg=</varname></term>
|
|
||||||
|
|
||||||
<listitem><para>Accepts
|
|
||||||
<option>false</option> (the default)
|
|
||||||
<option>true</option>.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>extra=</varname></term>
|
|
||||||
|
|
||||||
<listitem><para>Accepts
|
|
||||||
<option>false</option> (the default)
|
|
||||||
<option>false</option>.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>multilib=</varname></term>
|
|
||||||
|
|
||||||
<listitem><para>Accepts
|
|
||||||
<option>true</option> (the default)
|
|
||||||
<option>false</option>.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>openrc_boot=</varname></term>
|
<term><varname>openrc_boot=</varname></term>
|
||||||
|
|
||||||
@@ -166,14 +130,6 @@ along with artools; If not, see <http://www.gnu.org/licenses/>.
|
|||||||
</para></listitem>
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>login_shell=</varname></term>
|
|
||||||
|
|
||||||
<listitem><para>Accepts any login shell for the user, eg. /bin/zsh.
|
|
||||||
login_shell defaults to /bin/bash
|
|
||||||
</para></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>addgroups=</varname></term>
|
<term><varname>addgroups=</varname></term>
|
||||||
|
|
||||||
|
@@ -32,17 +32,14 @@ make_torrent(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
prepare_transfer(){
|
prepare_transfer(){
|
||||||
prof="$1"
|
target_dir="/iso/${profile}/"
|
||||||
target_dir="/iso/$prof/"
|
src_dir="${cache_dir_iso}/${profile}/"
|
||||||
src_dir="${cache_dir_iso}/$prof/"
|
|
||||||
${torrent} && make_torrent
|
${torrent} && make_torrent
|
||||||
}
|
}
|
||||||
|
|
||||||
sync_dir(){
|
sync_dir(){
|
||||||
prof="$1"
|
msg "Start upload [%s] ..." "${profile}"
|
||||||
prepare_transfer "$prof"
|
|
||||||
msg "Start upload [%s] ..." "$prof"
|
|
||||||
rsync "${rsync_args[@]}" ${src_dir} $(connect)${target_dir}
|
rsync "${rsync_args[@]}" ${src_dir} $(connect)${target_dir}
|
||||||
msg "Done upload [%s]" "$prof"
|
msg "Done upload [%s]" "${profile}"
|
||||||
show_elapsed_time "${FUNCNAME}" "${timer_start}"
|
show_elapsed_time "${FUNCNAME}" "${timer_start}"
|
||||||
}
|
}
|
||||||
|
@@ -227,10 +227,7 @@ make_iso() {
|
|||||||
gen_iso_fn(){
|
gen_iso_fn(){
|
||||||
local vars=() name
|
local vars=() name
|
||||||
vars+=("${os_id}")
|
vars+=("${os_id}")
|
||||||
# if ! ${chrootcfg};then
|
# vars+=("${profile}")
|
||||||
# [[ -n ${profile} ]] && vars+=("${profile}")
|
|
||||||
# fi
|
|
||||||
# [[ ${initsys} == 'openrc' ]] && vars+=("${initsys}")
|
|
||||||
vars+=("${dist_release}")
|
vars+=("${dist_release}")
|
||||||
vars+=("${target_arch}")
|
vars+=("${target_arch}")
|
||||||
for n in ${vars[@]};do
|
for n in ${vars[@]};do
|
||||||
@@ -370,19 +367,6 @@ make_grub(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_requirements(){
|
|
||||||
|
|
||||||
eval_build_list "${list_dir_iso}" "${build_list_iso}"
|
|
||||||
|
|
||||||
[[ -f ${run_dir}/repo_info ]] || die "%s is not a valid iso profiles directory!" "${run_dir}"
|
|
||||||
|
|
||||||
for sig in TERM HUP QUIT; do
|
|
||||||
trap "trap_exit $sig \"$(gettext "%s signal caught. Exiting...")\" \"$sig\"" "$sig"
|
|
||||||
done
|
|
||||||
trap 'trap_exit INT "$(gettext "Aborted by user! Exiting...")"' INT
|
|
||||||
trap 'trap_exit USR1 "$(gettext "An unknown error has occurred. Exiting...")"' ERR
|
|
||||||
}
|
|
||||||
|
|
||||||
compress_images(){
|
compress_images(){
|
||||||
local timer=$(get_timer)
|
local timer=$(get_timer)
|
||||||
run_safe "make_iso"
|
run_safe "make_iso"
|
||||||
@@ -408,16 +392,42 @@ prepare_images(){
|
|||||||
show_elapsed_time "${FUNCNAME}" "${timer}"
|
show_elapsed_time "${FUNCNAME}" "${timer}"
|
||||||
}
|
}
|
||||||
|
|
||||||
archive_logs(){
|
check_requirements(){
|
||||||
local name=$(gen_iso_fn) ext=log.tar.xz src=${tmp_dir}/archives.list
|
[[ -f ${run_dir}/repo_info ]] || die "%s is not a valid iso profiles directory!" "${run_dir}"
|
||||||
find ${log_dir} -maxdepth 1 -name "$name*.log" -printf "%f\n" > $src
|
|
||||||
msg2 "Archiving log files [%s] ..." "$name.$ext"
|
for sig in TERM HUP QUIT; do
|
||||||
tar -cJf ${log_dir}/$name.$ext -C ${log_dir} -T $src
|
trap "trap_exit $sig \"$(gettext "%s signal caught. Exiting...")\" \"$sig\"" "$sig"
|
||||||
msg2 "Cleaning log files ..."
|
done
|
||||||
find ${log_dir} -maxdepth 1 -name "$name*.log" -delete
|
trap 'trap_exit INT "$(gettext "Aborted by user! Exiting...")"' INT
|
||||||
|
trap 'trap_exit USR1 "$(gettext "An unknown error has occurred. Exiting...")"' ERR
|
||||||
}
|
}
|
||||||
|
|
||||||
make_profile(){
|
prepare_build(){
|
||||||
|
timer_start=$(get_timer)
|
||||||
|
local profile_dir=${run_dir}/${profile}
|
||||||
|
|
||||||
|
load_profile "${profile_dir}"
|
||||||
|
|
||||||
|
local pac_arch='default' pacman_conf
|
||||||
|
[[ "${target_arch}" == 'x86_64' ]] && pac_arch='multilib'
|
||||||
|
|
||||||
|
pacman_conf="${DATADIR}/pacman-$pac_arch.conf"
|
||||||
|
|
||||||
|
iso_file=$(gen_iso_fn).iso
|
||||||
|
|
||||||
|
mkchroot_args+=(-C ${pacman_conf})
|
||||||
|
work_dir=${chroots_iso}/${profile}/${target_arch}
|
||||||
|
|
||||||
|
iso_dir="${cache_dir_iso}/${profile}"
|
||||||
|
|
||||||
|
iso_root=${chroots_iso}/${profile}/iso
|
||||||
|
mnt_dir=${chroots_iso}/${profile}/mnt
|
||||||
|
prepare_dir "${mnt_dir}"
|
||||||
|
prepare_dir "${iso_dir}"
|
||||||
|
}
|
||||||
|
|
||||||
|
build(){
|
||||||
|
prepare_build
|
||||||
msg "Start building [%s]" "${profile}"
|
msg "Start building [%s]" "${profile}"
|
||||||
if ${clean_first};then
|
if ${clean_first};then
|
||||||
chroot_clean "${chroots_iso}/${profile}/${target_arch}"
|
chroot_clean "${chroots_iso}/${profile}/${target_arch}"
|
||||||
@@ -435,26 +445,17 @@ make_profile(){
|
|||||||
if ${iso_only}; then
|
if ${iso_only}; then
|
||||||
[[ ! -d ${work_dir} ]] && die "Create images: buildiso -p %s -x" "${profile}"
|
[[ ! -d ${work_dir} ]] && die "Create images: buildiso -p %s -x" "${profile}"
|
||||||
compress_images
|
compress_images
|
||||||
${verbose} && archive_logs
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if ${images_only}; then
|
if ${images_only}; then
|
||||||
prepare_images
|
prepare_images
|
||||||
${verbose} && archive_logs
|
|
||||||
warning "Continue compress: buildiso -p %s -zc ..." "${profile}"
|
warning "Continue compress: buildiso -p %s -zc ..." "${profile}"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
prepare_images
|
prepare_images
|
||||||
compress_images
|
compress_images
|
||||||
${verbose} && archive_logs
|
|
||||||
fi
|
fi
|
||||||
reset_profile
|
reset_profile
|
||||||
msg "Finished building [%s]" "${profile}"
|
msg "Finished building [%s]" "${profile}"
|
||||||
show_elapsed_time "${FUNCNAME}" "${timer_start}"
|
show_elapsed_time "${FUNCNAME}" "${timer_start}"
|
||||||
}
|
}
|
||||||
|
|
||||||
build(){
|
|
||||||
local prof="$1"
|
|
||||||
prepare_build "$prof"
|
|
||||||
make_profile
|
|
||||||
}
|
|
||||||
|
@@ -27,6 +27,15 @@ update_lock(){
|
|||||||
rsync "${rsync_args[@]}" --exclude='os' "${repos_local}/$repo/" "$(connect)${repos_remote}/$repo/"
|
rsync "${rsync_args[@]}" --exclude='os' "${repos_local}/$repo/" "$(connect)${repos_remote}/$repo/"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
is_locked(){
|
||||||
|
local repo="$1" url="https://${host}/projects/${project}/files/repos"
|
||||||
|
if wget --spider -v $url/$repo/$repo.lock;then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
repo_lock(){
|
repo_lock(){
|
||||||
local repo="$1"
|
local repo="$1"
|
||||||
if [[ ! -f ${repos_local}/$repo/$repo.lock ]];then
|
if [[ ! -f ${repos_local}/$repo/$repo.lock ]];then
|
||||||
@@ -47,8 +56,11 @@ repo_unlock(){
|
|||||||
|
|
||||||
repo_download(){
|
repo_download(){
|
||||||
local repo="$1"
|
local repo="$1"
|
||||||
rsync "${rsync_args[@]}" "$(connect)${repos_remote}/$repo/" "${repos_local}/$repo/"
|
if is_locked "$repo"; then
|
||||||
[[ -f ${repos_local}/$repo/$repo.lock ]] && die "The '%s' repository is locked" "$repo"
|
die "The '%s' repository is locked" "$repo"
|
||||||
|
else
|
||||||
|
rsync "${rsync_args[@]}" "$(connect)${repos_remote}/$repo/" "${repos_local}/$repo/"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
repo_upload(){
|
repo_upload(){
|
||||||
|
@@ -33,7 +33,7 @@ sync_tree_branches(){
|
|||||||
info "needs sync"
|
info "needs sync"
|
||||||
git pull origin $b
|
git pull origin $b
|
||||||
fi
|
fi
|
||||||
msg "Done [%s]" "$repo"
|
msg "Done [%s] (%s)" "$repo" "$b"
|
||||||
done
|
done
|
||||||
git checkout master &> /dev/null
|
git checkout master &> /dev/null
|
||||||
show_elapsed_time "${FUNCNAME}" "${timer}"
|
show_elapsed_time "${FUNCNAME}" "${timer}"
|
||||||
|
@@ -9,14 +9,37 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
repo_add_pkg(){
|
# $1: list_dir
|
||||||
repo="$1" arch="$2" pkg="$3" ext="db.tar.xz"
|
show_build_lists(){
|
||||||
repo-add "$repo/os/$arch/$repo.$ext" "$repo/os/$arch/$pkg"
|
local list temp
|
||||||
|
for item in $(ls $1/*.list); do
|
||||||
|
temp=${item##*/}
|
||||||
|
list=${list:-}${list:+|}${temp%.list}
|
||||||
|
done
|
||||||
|
echo $list
|
||||||
}
|
}
|
||||||
|
|
||||||
repo_del_pkg(){
|
read_build_list(){
|
||||||
repo="$1" arch="$2" pkg="$3" ext="db.tar.xz"
|
local _space="s| ||g" _clean=':a;N;$!ba;s/\n/ /g' _com_rm="s|#.*||g"
|
||||||
repo-remove "$repo/os/$arch/$repo.$ext" "$repo/os/$arch/$pkg"
|
build_list=$(sed "$_com_rm" "$1.list" | sed "$_space" | sed "$_clean")
|
||||||
|
}
|
||||||
|
|
||||||
|
# $1: build list
|
||||||
|
eval_build_list(){
|
||||||
|
eval "case $1 in
|
||||||
|
$(show_build_lists ${list_dir_pkg})) is_build_list=true; read_build_list ${list_dir_pkg}/$1 ;;
|
||||||
|
*) is_build_list=false ;;
|
||||||
|
esac"
|
||||||
|
}
|
||||||
|
|
||||||
|
run(){
|
||||||
|
if ${is_build_list};then
|
||||||
|
for item in ${build_list[@]};do
|
||||||
|
$1 $item
|
||||||
|
done
|
||||||
|
else
|
||||||
|
$1 $2
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
in_array() {
|
in_array() {
|
||||||
|
@@ -39,16 +39,12 @@ load_profile(){
|
|||||||
[[ -z ${autologin} ]] && autologin="true"
|
[[ -z ${autologin} ]] && autologin="true"
|
||||||
[[ ${displaymanager} == 'none' ]] && autologin="false"
|
[[ ${displaymanager} == 'none' ]] && autologin="false"
|
||||||
|
|
||||||
[[ -z ${multilib} ]] && multilib="true"
|
|
||||||
|
|
||||||
[[ -z ${hostname} ]] && hostname="artix"
|
[[ -z ${hostname} ]] && hostname="artix"
|
||||||
|
|
||||||
[[ -z ${username} ]] && username="artix"
|
[[ -z ${username} ]] && username="artix"
|
||||||
|
|
||||||
[[ -z ${password} ]] && password="artix"
|
[[ -z ${password} ]] && password="artix"
|
||||||
|
|
||||||
[[ -z ${login_shell} ]] && login_shell='/bin/bash'
|
|
||||||
|
|
||||||
if [[ -z ${addgroups} ]];then
|
if [[ -z ${addgroups} ]];then
|
||||||
addgroups="video,power,storage,optical,network,lp,scanner,wheel,users"
|
addgroups="video,power,storage,optical,network,lp,scanner,wheel,users"
|
||||||
fi
|
fi
|
||||||
@@ -63,48 +59,31 @@ load_profile(){
|
|||||||
|
|
||||||
[[ ${displaymanager} != "none" ]] && openrc_default+=('xdm')
|
[[ ${displaymanager} != "none" ]] && openrc_default+=('xdm')
|
||||||
|
|
||||||
[[ -z ${netinstall} ]] && netinstall='false'
|
|
||||||
|
|
||||||
[[ -z ${chrootcfg} ]] && chrootcfg='false'
|
|
||||||
|
|
||||||
enable_live=('artix-live' 'pacman-init')
|
enable_live=('artix-live' 'pacman-init')
|
||||||
|
|
||||||
netgroups="https://raw.githubusercontent.com/artix-linux/iso-profiles/master/shared/netgroups"
|
netgroups="https://raw.githubusercontent.com/artix-linux/iso-profiles/master/base/netgroups"
|
||||||
|
|
||||||
basic='true'
|
root_list=${run_dir}/base/Packages-Root
|
||||||
[[ -z ${extra} ]] && extra='false'
|
|
||||||
|
|
||||||
${extra} && basic='false'
|
|
||||||
|
|
||||||
root_list=${run_dir}/shared/Packages-Root
|
|
||||||
[[ -f "$profdir/Packages-Root" ]] && root_list="$profdir/Packages-Root"
|
[[ -f "$profdir/Packages-Root" ]] && root_list="$profdir/Packages-Root"
|
||||||
|
|
||||||
root_overlay="${run_dir}/shared/root-overlay"
|
root_overlay="${run_dir}/base/root-overlay"
|
||||||
[[ -d "$profdir/root-overlay" ]] && root_overlay="$profdir/root-overlay"
|
[[ -d "$profdir/root-overlay" ]] && root_overlay="$profdir/root-overlay"
|
||||||
|
|
||||||
[[ -f "$profdir/Packages-Desktop" ]] && desktop_list=$profdir/Packages-Desktop
|
[[ -f "$profdir/Packages-Desktop" ]] && desktop_list=$profdir/Packages-Desktop
|
||||||
[[ -d "$profdir/desktop-overlay" ]] && desktop_overlay="$profdir/desktop-overlay"
|
[[ -d "$profdir/desktop-overlay" ]] && desktop_overlay="$profdir/desktop-overlay"
|
||||||
|
|
||||||
live_list="${run_dir}/shared/Packages-Live"
|
live_list="${run_dir}/base/Packages-Live"
|
||||||
[[ -f "$profdir/Packages-Live" ]] && live_list="$profdir/Packages-Live"
|
[[ -f "$profdir/Packages-Live" ]] && live_list="$profdir/Packages-Live"
|
||||||
|
|
||||||
live_overlay="${run_dir}/shared/live-overlay"
|
live_overlay="${run_dir}/base/live-overlay"
|
||||||
[[ -d "$profdir/live-overlay" ]] && live_overlay="$profdir/live-overlay"
|
[[ -d "$profdir/live-overlay" ]] && live_overlay="$profdir/live-overlay"
|
||||||
|
|
||||||
if ${netinstall};then
|
|
||||||
sort -u ${run_dir}/shared/Packages-Net ${live_list} > ${tmp_dir}/packages-live-net.list
|
|
||||||
live_list=${tmp_dir}/packages-live-net.list
|
|
||||||
else
|
|
||||||
chrootcfg="false"
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
reset_profile(){
|
reset_profile(){
|
||||||
unset displaymanager
|
unset displaymanager
|
||||||
unset autologin
|
unset autologin
|
||||||
unset multilib
|
|
||||||
unset hostname
|
unset hostname
|
||||||
unset username
|
unset username
|
||||||
unset password
|
unset password
|
||||||
@@ -112,10 +91,6 @@ reset_profile(){
|
|||||||
unset openrc_boot
|
unset openrc_boot
|
||||||
unset openrc_default
|
unset openrc_default
|
||||||
unset enable_live
|
unset enable_live
|
||||||
unset login_shell
|
|
||||||
unset netinstall
|
|
||||||
unset chrootcfg
|
|
||||||
unset extra
|
|
||||||
unset root_list
|
unset root_list
|
||||||
unset desktop_list
|
unset desktop_list
|
||||||
unset live_list
|
unset live_list
|
||||||
@@ -134,9 +109,6 @@ write_live_session_conf(){
|
|||||||
echo '# autologin' >> ${conf}
|
echo '# autologin' >> ${conf}
|
||||||
echo "autologin=${autologin}" >> ${conf}
|
echo "autologin=${autologin}" >> ${conf}
|
||||||
echo '' >> ${conf}
|
echo '' >> ${conf}
|
||||||
echo '# login shell' >> ${conf}
|
|
||||||
echo "login_shell=${login_shell}" >> ${conf}
|
|
||||||
echo '' >> ${conf}
|
|
||||||
echo '# live username' >> ${conf}
|
echo '# live username' >> ${conf}
|
||||||
echo "username=${username}" >> ${conf}
|
echo "username=${username}" >> ${conf}
|
||||||
echo '' >> ${conf}
|
echo '' >> ${conf}
|
||||||
@@ -152,32 +124,18 @@ load_pkgs(){
|
|||||||
local pkglist="$1" arch="$2" init="$3" _kv="$4"
|
local pkglist="$1" arch="$2" init="$3" _kv="$4"
|
||||||
info "Loading Packages: [%s] ..." "${pkglist##*/}"
|
info "Loading Packages: [%s] ..." "${pkglist##*/}"
|
||||||
|
|
||||||
local _init="s|>openrc||g" #_init_rm="s|>runit.*||g"
|
local _init="s|>$init||g"
|
||||||
|
case "$init" in
|
||||||
|
'openrc') _init_rm1="s|>runit.*||g"; _init_rm2="s|>s6*||g" ;;
|
||||||
|
's6') _init_rm1="s|>runit.*||g"; _init_rm2="s|>openrc.*||g" ;;
|
||||||
|
'runit') _init_rm1="s|>s6.*||g"; _init_rm2="s|>openrc.*||g" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
local _basic="s|>basic.*||g"
|
local _arch="s|>x86_64||g" _arch_rm="s|>i686.*||g"
|
||||||
if ${basic};then
|
|
||||||
_basic="s|>basic||g"
|
|
||||||
fi
|
|
||||||
|
|
||||||
local _extra="s|>extra.*||g"
|
|
||||||
if ${extra};then
|
|
||||||
_extra="s|>extra||g"
|
|
||||||
fi
|
|
||||||
|
|
||||||
local _multi _arch _arch_rm
|
|
||||||
|
|
||||||
if [[ "$arch" == 'i686' ]];then
|
if [[ "$arch" == 'i686' ]];then
|
||||||
_arch="s|>i686||g"
|
_arch="s|>i686||g"
|
||||||
_arch_rm="s|>x86_64.*||g"
|
_arch_rm="s|>x86_64.*||g"
|
||||||
_multi="s|>multilib.*||g"
|
|
||||||
else
|
|
||||||
_arch="s|>x86_64||g"
|
|
||||||
_arch_rm="s|>i686.*||g"
|
|
||||||
if ${multilib};then
|
|
||||||
_multi="s|>multilib||g"
|
|
||||||
else
|
|
||||||
_multi="s|>multilib.*||g"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local _blacklist="s|>blacklist.*||g" \
|
local _blacklist="s|>blacklist.*||g" \
|
||||||
@@ -191,11 +149,10 @@ load_pkgs(){
|
|||||||
| sed "$_blacklist" \
|
| sed "$_blacklist" \
|
||||||
| sed "$_purge" \
|
| sed "$_purge" \
|
||||||
| sed "$_init" \
|
| sed "$_init" \
|
||||||
|
| sed "$_init_rm1" \
|
||||||
|
| sed "$_init_rm2" \
|
||||||
| sed "$_arch" \
|
| sed "$_arch" \
|
||||||
| sed "$_arch_rm" \
|
| sed "$_arch_rm" \
|
||||||
| sed "$_multi" \
|
|
||||||
| sed "$_kernel" \
|
| sed "$_kernel" \
|
||||||
| sed "$_basic" \
|
|
||||||
| sed "$_extra" \
|
|
||||||
| sed "$_clean"))
|
| sed "$_clean"))
|
||||||
}
|
}
|
||||||
|
@@ -12,36 +12,48 @@
|
|||||||
import ${LIBDIR}/util-yaml.sh
|
import ${LIBDIR}/util-yaml.sh
|
||||||
|
|
||||||
write_netgroup_yaml(){
|
write_netgroup_yaml(){
|
||||||
msg2 "Writing %s ..." "${2##*/}"
|
local name="$1" yaml="$2"
|
||||||
echo "---" > "$2"
|
msg2 "Writing %s ..." "${yaml##*/}"
|
||||||
echo "- name: '$1'" >> "$2"
|
echo "---" > "$yaml"
|
||||||
echo " description: '$1'" >> "$2"
|
echo "- name: '$name'" >> "$yaml"
|
||||||
echo " selected: false" >> "$2"
|
echo " description: '$name'" >> "$yaml"
|
||||||
echo " hidden: false" >> "$2"
|
echo " selected: false" >> "$yaml"
|
||||||
echo " critical: false" >> "$2"
|
echo " hidden: false" >> "$yaml"
|
||||||
echo " packages:" >> "$2"
|
echo " critical: false" >> "$yaml"
|
||||||
|
echo " packages:" >> "$yaml"
|
||||||
for p in ${packages[@]};do
|
for p in ${packages[@]};do
|
||||||
echo " - $p" >> "$2"
|
echo " - $p" >> "$yaml"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
write_pacman_group_yaml(){
|
write_pacman_group_yaml(){
|
||||||
packages=$(pacman -Sgq "$1")
|
local group="$1"
|
||||||
|
packages=$(pacman -Sgq "$group")
|
||||||
prepare_dir "${cache_dir_netinstall}/pacman"
|
prepare_dir "${cache_dir_netinstall}/pacman"
|
||||||
write_netgroup_yaml "$1" "${cache_dir_netinstall}/pacman/$1.yaml"
|
write_netgroup_yaml "$group" "${cache_dir_netinstall}/pacman/$group.yaml"
|
||||||
}
|
}
|
||||||
|
|
||||||
gen_fn(){
|
gen_fn(){
|
||||||
echo "${yaml_dir}/$1-${target_arch}-${initsys}.yaml"
|
echo "${yaml_dir}/$1-${target_arch}-${initsys}.yaml"
|
||||||
}
|
}
|
||||||
|
|
||||||
make_profile_yaml(){
|
prepare_build(){
|
||||||
prepare_check "$1"
|
local profile_dir=${run_dir}/${profile}
|
||||||
|
|
||||||
|
load_profile "${profile_dir}"
|
||||||
|
|
||||||
|
yaml_dir=${cache_dir_netinstall}/${profile}/${target_arch}
|
||||||
|
|
||||||
|
prepare_dir "${yaml_dir}"
|
||||||
|
}
|
||||||
|
|
||||||
|
build(){
|
||||||
|
prepare_build
|
||||||
load_pkgs "${root_list}" "${target_arch}" "${initsys}" "${kernel}"
|
load_pkgs "${root_list}" "${target_arch}" "${initsys}" "${kernel}"
|
||||||
write_netgroup_yaml "$1" "$(gen_fn "Packages-Root")"
|
write_netgroup_yaml "${profile}" "$(gen_fn "Packages-Root")"
|
||||||
if [[ -f "${desktop_list}" ]]; then
|
if [[ -f "${desktop_list}" ]]; then
|
||||||
load_pkgs "${desktop_list}" "${target_arch}" "${initsys}" "${kernel}"
|
load_pkgs "${desktop_list}" "${target_arch}" "${initsys}" "${kernel}"
|
||||||
write_netgroup_yaml "$1" "$(gen_fn "Packages-Desktop")"
|
write_netgroup_yaml "${profile}" "$(gen_fn "Packages-Desktop")"
|
||||||
fi
|
fi
|
||||||
${calamares} && configure_calamares "${yaml_dir}"
|
${calamares} && configure_calamares "${yaml_dir}"
|
||||||
reset_profile
|
reset_profile
|
||||||
|
@@ -93,21 +93,6 @@ write_initcpio_conf(){
|
|||||||
echo "kernel: ${kernel}" >> "$conf"
|
echo "kernel: ${kernel}" >> "$conf"
|
||||||
}
|
}
|
||||||
|
|
||||||
write_unpack_conf(){
|
|
||||||
local conf="${modules_dir}/unpackfs.conf"
|
|
||||||
msg2 "Writing %s ..." "${conf##*/}"
|
|
||||||
echo "---" > "$conf"
|
|
||||||
echo "unpack:" >> "$conf"
|
|
||||||
echo " - source: \"/run/artix/bootmnt/${os_id}/${target_arch}/rootfs.sfs\"" >> "$conf"
|
|
||||||
echo " sourcefs: \"squashfs\"" >> "$conf"
|
|
||||||
echo " destination: \"\"" >> "$conf"
|
|
||||||
if [[ -f "${desktop_list}" ]] ; then
|
|
||||||
echo " - source: \"/run/artix/bootmnt/${os_id}/${target_arch}/desktopfs.sfs\"" >> "$conf"
|
|
||||||
echo " sourcefs: \"squashfs\"" >> "$conf"
|
|
||||||
echo " destination: \"\"" >> "$conf"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
write_users_conf(){
|
write_users_conf(){
|
||||||
local conf="${modules_dir}/users.conf"
|
local conf="${modules_dir}/users.conf"
|
||||||
msg2 "Writing %s ..." "${conf##*/}"
|
msg2 "Writing %s ..." "${conf##*/}"
|
||||||
@@ -127,15 +112,6 @@ write_users_conf(){
|
|||||||
echo "avatarFilePath: ~/.face" >> "$conf" # mostly used file-name for avatar
|
echo "avatarFilePath: ~/.face" >> "$conf" # mostly used file-name for avatar
|
||||||
}
|
}
|
||||||
|
|
||||||
write_packages_conf(){
|
|
||||||
local conf="${modules_dir}/packages.conf"
|
|
||||||
msg2 "Writing %s ..." "${conf##*/}"
|
|
||||||
echo "---" > "$conf"
|
|
||||||
echo "backend: pacman" >> "$conf"
|
|
||||||
echo '' >> "$conf"
|
|
||||||
echo "update_db: true" >> "$conf"
|
|
||||||
}
|
|
||||||
|
|
||||||
write_welcome_conf(){
|
write_welcome_conf(){
|
||||||
local conf="${modules_dir}/welcome.conf"
|
local conf="${modules_dir}/welcome.conf"
|
||||||
msg2 "Writing %s ..." "${conf##*/}"
|
msg2 "Writing %s ..." "${conf##*/}"
|
||||||
@@ -158,9 +134,7 @@ write_welcome_conf(){
|
|||||||
echo " - storage" >> "$conf"
|
echo " - storage" >> "$conf"
|
||||||
echo " - ram" >> "$conf"
|
echo " - ram" >> "$conf"
|
||||||
echo " - root" >> "$conf"
|
echo " - root" >> "$conf"
|
||||||
if ${netinstall};then
|
echo " - internet" >> "$conf"
|
||||||
echo " - internet" >> "$conf"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
write_umount_conf(){
|
write_umount_conf(){
|
||||||
@@ -172,17 +146,7 @@ write_umount_conf(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_yaml(){
|
get_yaml(){
|
||||||
local args=() yaml
|
echo "netgroups-${initsys}.yaml"
|
||||||
if ${chrootcfg};then
|
|
||||||
args+=("chrootcfg")
|
|
||||||
else
|
|
||||||
args+=("packages")
|
|
||||||
fi
|
|
||||||
args+=("${initsys}")
|
|
||||||
for arg in ${args[@]};do
|
|
||||||
yaml=${yaml:-}${yaml:+-}${arg}
|
|
||||||
done
|
|
||||||
echo "${yaml}.yaml"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
write_netinstall_conf(){
|
write_netinstall_conf(){
|
||||||
@@ -213,26 +177,13 @@ write_settings_conf(){
|
|||||||
echo " - keyboard" >> "$conf"
|
echo " - keyboard" >> "$conf"
|
||||||
echo " - partition" >> "$conf"
|
echo " - partition" >> "$conf"
|
||||||
echo " - users" >> "$conf" && write_users_conf
|
echo " - users" >> "$conf" && write_users_conf
|
||||||
if ${netinstall};then
|
echo " - netinstall" >> "$conf" && write_netinstall_conf
|
||||||
echo " - netinstall" >> "$conf" && write_netinstall_conf
|
|
||||||
fi
|
|
||||||
echo " - summary" >> "$conf"
|
echo " - summary" >> "$conf"
|
||||||
echo " - exec:" >> "$conf"
|
echo " - exec:" >> "$conf"
|
||||||
echo " - partition" >> "$conf"
|
echo " - partition" >> "$conf"
|
||||||
echo " - mount" >> "$conf"
|
echo " - mount" >> "$conf"
|
||||||
if ${netinstall};then
|
echo " - chrootcfg" >> "$conf"
|
||||||
if ${chrootcfg}; then
|
echo " - networkcfg" >> "$conf"
|
||||||
echo " - chrootcfg" >> "$conf"
|
|
||||||
echo " - networkcfg" >> "$conf"
|
|
||||||
else
|
|
||||||
echo " - unpackfs" >> "$conf" && write_unpack_conf
|
|
||||||
echo " - networkcfg" >> "$conf"
|
|
||||||
echo " - packages" >> "$conf" && write_packages_conf
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo " - unpackfs" >> "$conf" && write_unpack_conf
|
|
||||||
echo " - networkcfg" >> "$conf"
|
|
||||||
fi
|
|
||||||
echo " - machineid" >> "$conf" && write_machineid_conf
|
echo " - machineid" >> "$conf" && write_machineid_conf
|
||||||
echo " - fstab" >> "$conf"
|
echo " - fstab" >> "$conf"
|
||||||
echo " - locale" >> "$conf"
|
echo " - locale" >> "$conf"
|
||||||
|
106
lib/util.sh
106
lib/util.sh
@@ -8,80 +8,6 @@
|
|||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
# $1: section
|
|
||||||
parse_section() {
|
|
||||||
local is_section=0
|
|
||||||
while read line; do
|
|
||||||
[[ $line =~ ^\ {0,}# ]] && continue
|
|
||||||
[[ -z "$line" ]] && continue
|
|
||||||
if [ $is_section == 0 ]; then
|
|
||||||
if [[ $line =~ ^\[.*?\] ]]; then
|
|
||||||
line=${line:1:$((${#line}-2))}
|
|
||||||
section=${line// /}
|
|
||||||
if [[ $section == $1 ]]; then
|
|
||||||
is_section=1
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
elif [[ $line =~ ^\[.*?\] && $is_section == 1 ]]; then
|
|
||||||
break
|
|
||||||
else
|
|
||||||
pc_key=${line%%=*}
|
|
||||||
pc_key=${pc_key// /}
|
|
||||||
pc_value=${line##*=}
|
|
||||||
pc_value=${pc_value## }
|
|
||||||
eval "$pc_key='$pc_value'"
|
|
||||||
fi
|
|
||||||
done < "$2"
|
|
||||||
}
|
|
||||||
|
|
||||||
get_repos() {
|
|
||||||
local section repos=() filter='^\ {0,}#'
|
|
||||||
while read line; do
|
|
||||||
[[ $line =~ "${filter}" ]] && continue
|
|
||||||
[[ -z "$line" ]] && continue
|
|
||||||
if [[ $line =~ ^\[.*?\] ]]; then
|
|
||||||
line=${line:1:$((${#line}-2))}
|
|
||||||
section=${line// /}
|
|
||||||
case ${section} in
|
|
||||||
"options") continue ;;
|
|
||||||
*) repos+=("${section}") ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
done < "$1"
|
|
||||||
echo ${repos[@]}
|
|
||||||
}
|
|
||||||
|
|
||||||
check_user_repos_conf(){
|
|
||||||
local repositories=$(get_repos "$1") uri='file://'
|
|
||||||
for repo in ${repositories[@]}; do
|
|
||||||
msg2 "parsing repo [%s] ..." "${repo}"
|
|
||||||
parse_section "${repo}" "$1"
|
|
||||||
[[ ${pc_value} == $uri* ]] && die "Using local repositories is not supported!"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# $1: list_dir
|
|
||||||
show_build_lists(){
|
|
||||||
local list temp
|
|
||||||
for item in $(ls $1/*.list); do
|
|
||||||
temp=${item##*/}
|
|
||||||
list=${list:-}${list:+|}${temp%.list}
|
|
||||||
done
|
|
||||||
echo $list
|
|
||||||
}
|
|
||||||
|
|
||||||
# $1: make_conf_dir
|
|
||||||
show_build_profiles(){
|
|
||||||
local cpuarch temp
|
|
||||||
for item in $(ls $1/*.conf); do
|
|
||||||
temp=${item##*/}
|
|
||||||
cpuarch=${cpuarch:-}${cpuarch:+|}${temp%.conf}
|
|
||||||
done
|
|
||||||
echo $cpuarch
|
|
||||||
}
|
|
||||||
|
|
||||||
get_timer(){
|
get_timer(){
|
||||||
echo $(date +%s)
|
echo $(date +%s)
|
||||||
}
|
}
|
||||||
@@ -189,7 +115,7 @@ init_buildpkg(){
|
|||||||
|
|
||||||
[[ -d ${AT_USERCONFDIR}/pkg.list.d ]] && list_dir_pkg=${AT_USERCONFDIR}/pkg.list.d
|
[[ -d ${AT_USERCONFDIR}/pkg.list.d ]] && list_dir_pkg=${AT_USERCONFDIR}/pkg.list.d
|
||||||
|
|
||||||
[[ -z ${build_list_pkg} ]] && build_list_pkg='default'
|
[[ -z ${build_list} ]] && build_list='default'
|
||||||
|
|
||||||
cache_dir_pkg=${workspace_dir}/pkg
|
cache_dir_pkg=${workspace_dir}/pkg
|
||||||
|
|
||||||
@@ -199,12 +125,6 @@ init_buildpkg(){
|
|||||||
init_buildiso(){
|
init_buildiso(){
|
||||||
chroots_iso="${chroots_dir}/buildiso"
|
chroots_iso="${chroots_dir}/buildiso"
|
||||||
|
|
||||||
list_dir_iso="${SYSCONFDIR}/iso.list.d"
|
|
||||||
|
|
||||||
[[ -d ${AT_USERCONFDIR}/iso.list.d ]] && list_dir_iso=${AT_USERCONFDIR}/iso.list.d
|
|
||||||
|
|
||||||
[[ -z ${build_list_iso} ]] && build_list_iso='default'
|
|
||||||
|
|
||||||
cache_dir_iso="${workspace_dir}/iso"
|
cache_dir_iso="${workspace_dir}/iso"
|
||||||
|
|
||||||
prepare_dir "${cache_dir_iso}"
|
prepare_dir "${cache_dir_iso}"
|
||||||
@@ -312,30 +232,6 @@ show_config(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
read_build_list(){
|
|
||||||
local _space="s| ||g" _clean=':a;N;$!ba;s/\n/ /g' _com_rm="s|#.*||g"
|
|
||||||
build_list=$(sed "$_com_rm" "$1.list" | sed "$_space" | sed "$_clean")
|
|
||||||
}
|
|
||||||
|
|
||||||
# $1: list_dir
|
|
||||||
# $2: build list
|
|
||||||
eval_build_list(){
|
|
||||||
eval "case $2 in
|
|
||||||
$(show_build_lists $1)) is_build_list=true; read_build_list $1/$2 ;;
|
|
||||||
*) is_build_list=false ;;
|
|
||||||
esac"
|
|
||||||
}
|
|
||||||
|
|
||||||
run(){
|
|
||||||
if ${is_build_list};then
|
|
||||||
for item in ${build_list[@]};do
|
|
||||||
$1 $item
|
|
||||||
done
|
|
||||||
else
|
|
||||||
$1 $2
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
check_root() {
|
check_root() {
|
||||||
(( EUID == 0 )) && return
|
(( EUID == 0 )) && return
|
||||||
if type -P sudo >/dev/null; then
|
if type -P sudo >/dev/null; then
|
||||||
|
Reference in New Issue
Block a user