Compare commits

...

13 Commits
0.5.2 ... 0.5.4

Author SHA1 Message Date
artoo
01142309ac Merge pull request #29 from artix-linux/devel
Devel-0.5.4
2017-08-18 20:02:42 +02:00
udeved
d630ed2582 buildpkg: autocreate root chroot 2017-08-18 19:55:16 +02:00
udeved
9c546ca7fb buildiso, buildyaml: kill run_dir 2017-08-18 18:50:57 +02:00
udeved
a6a74c69f1 util-iso: fix traps 2017-08-18 13:40:51 +02:00
udeved
0f51544da4 buildiso: always load systemwide base profile 2017-08-18 12:23:31 +02:00
udeved
afe30328a6 data: remove example profile.conf & repo_info 2017-08-18 12:22:46 +02:00
udeved
9d7148b60e clean up code 2017-08-18 10:00:55 +02:00
artoo
afa239995c Merge pull request #28 from artix-linux/devel
Devel-0.5.3
2017-08-18 01:14:53 +02:00
udeved
0b4a4840e3 update readme 2017-08-18 01:14:09 +02:00
udeved
034e5a0a82 util: #18 2017-08-18 01:11:31 +02:00
udeved
d2590ddd74 util-profile: adopt system wide base profile 2017-08-18 01:10:50 +02:00
udeved
2975de2fb5 buildtree: prepare to drop import repos 2017-08-17 23:46:26 +02:00
udeved
b9383b628c remove pkglist.d 2017-08-17 11:53:01 +02:00
19 changed files with 84 additions and 222 deletions

View File

@@ -59,8 +59,7 @@ LIBS_ISO = \
$(wildcard lib/util-iso*.sh) $(wildcard lib/util-iso*.sh)
SHARED_ISO = \ SHARED_ISO = \
data/mkinitcpio.conf \ data/mkinitcpio.conf
data/profile.conf.example
CPIOHOOKS = \ CPIOHOOKS = \
$(wildcard initcpio/hooks/*) $(wildcard initcpio/hooks/*)
@@ -81,9 +80,6 @@ LIBS_YAML = \
SHARED_YAML = \ SHARED_YAML = \
data/linux.preset data/linux.preset
INFO = \
data/repo_info
BASE = \ BASE = \
$(wildcard data/base/Packages-*) \ $(wildcard data/base/Packages-*) \
data/base/profile.conf data/base/profile.conf
@@ -132,9 +128,6 @@ install_base:
install -m0644 ${SHARED_BASE} $(DESTDIR)$(PREFIX)/share/artools install -m0644 ${SHARED_BASE} $(DESTDIR)$(PREFIX)/share/artools
install_pkg: install_pkg:
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/artools/pkg.list.d
install -m0644 ${LIST_PKG} $(DESTDIR)$(SYSCONFDIR)/artools/pkg.list.d
install -dm0755 $(DESTDIR)$(SYSCONFDIR)/artools/import.list.d install -dm0755 $(DESTDIR)$(SYSCONFDIR)/artools/import.list.d
install -m0644 ${LIST_IMPORT} $(DESTDIR)$(SYSCONFDIR)/artools/import.list.d install -m0644 ${LIST_IMPORT} $(DESTDIR)$(SYSCONFDIR)/artools/import.list.d
@@ -153,8 +146,8 @@ install_pkg:
install -m0644 ${SHARED_PKG} $(DESTDIR)$(PREFIX)/share/artools install -m0644 ${SHARED_PKG} $(DESTDIR)$(PREFIX)/share/artools
install_isobase: install_isobase:
install -dm0755 $(DESTDIR)$(PREFIX)/share/artools/iso-profiles # install -dm0755 $(DESTDIR)$(PREFIX)/share/artools/iso-profiles
install -m0644 ${INFO} $(DESTDIR)$(PREFIX)/share/artools/iso-profiles # install -m0644 ${INFO} $(DESTDIR)$(PREFIX)/share/artools/iso-profiles
install -dm0755 $(DESTDIR)$(PREFIX)/share/artools/iso-profiles/base install -dm0755 $(DESTDIR)$(PREFIX)/share/artools/iso-profiles/base
install -m0644 ${BASE} $(DESTDIR)$(PREFIX)/share/artools/iso-profiles/base install -m0644 ${BASE} $(DESTDIR)$(PREFIX)/share/artools/iso-profiles/base
@@ -207,7 +200,6 @@ uninstall_base:
for f in ${LIBS_BASE}; do rm -f $(DESTDIR)$(PREFIX)/lib/artools/$$f; done for f in ${LIBS_BASE}; do rm -f $(DESTDIR)$(PREFIX)/lib/artools/$$f; done
uninstall_pkg: uninstall_pkg:
for f in ${LIST_PKG}; do rm -f $(DESTDIR)$(SYSCONFDIR)/artools/pkg.list.d/$$f; done
for f in ${LIST_IMPORT}; do rm -f $(DESTDIR)$(SYSCONFDIR)/artools/import.list.d/$$f; done for f in ${LIST_IMPORT}; do rm -f $(DESTDIR)$(SYSCONFDIR)/artools/import.list.d/$$f; done
for f in ${ARCH_CONF}; do rm -f $(DESTDIR)$(SYSCONFDIR)/artools/make.conf.d/$$f; done for f in ${ARCH_CONF}; do rm -f $(DESTDIR)$(SYSCONFDIR)/artools/make.conf.d/$$f; done
for f in ${BIN_PKG}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done for f in ${BIN_PKG}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
@@ -216,7 +208,7 @@ uninstall_pkg:
for f in ${LIBS_PKG}; do rm -f $(DESTDIR)$(PREFIX)/lib/artools/$$f; done for f in ${LIBS_PKG}; do rm -f $(DESTDIR)$(PREFIX)/lib/artools/$$f; done
uninstall_isobase: uninstall_isobase:
for f in ${INFO}; do rm -f $(DESTDIR)$(PREFIX)/share/artools/iso-profiles/$$f; done # for f in ${INFO}; do rm -f $(DESTDIR)$(PREFIX)/share/artools/iso-profiles/$$f; done
for f in ${BASE}; do rm -f $(DESTDIR)$(PREFIX)/share/artools/iso-profiles/base/$$f; done for f in ${BASE}; do rm -f $(DESTDIR)$(PREFIX)/share/artools/iso-profiles/base/$$f; done
for f in ${LIVE_ETC}; do rm -f $(DESTDIR)$(PREFIX)/share/artools/iso-profiles/base/live-overlay/etc/$$f; done for f in ${LIVE_ETC}; do rm -f $(DESTDIR)$(PREFIX)/share/artools/iso-profiles/base/live-overlay/etc/$$f; done
for f in ${LIVE_ETC_DEFAULT}; do rm -f $(DESTDIR)$(PREFIX)/share/artools/iso-profiles/base/live-overlay/etc/default/$$f; done for f in ${LIVE_ETC_DEFAULT}; do rm -f $(DESTDIR)$(PREFIX)/share/artools/iso-profiles/base/live-overlay/etc/default/$$f; done

View File

@@ -31,16 +31,12 @@ By default it is commented and shows just initialization values done in code.
Tools configuration is done in artools.conf or by args. Tools configuration is done in artools.conf or by args.
Specifying args will override artools.conf settings. Specifying args will override artools.conf settings.
User build lists(eg 'my-super-build.list') can be placed in
~~~ ~~~
$HOME/.config/artools/pkg.list.d $HOME/.config/artools/import.list.d
$HOME/.config/artools/iso.list.d
~~~ ~~~
overriding overriding
~~~ ~~~
/etc/artools/pkg.list.d /etc/artools/import.list.d
/etc/artools/iso.list.d
~~~ ~~~

View File

@@ -19,8 +19,38 @@ SYSCONFDIR='@sysconfdir@'
import ${LIBDIR}/util.sh import ${LIBDIR}/util.sh
import ${LIBDIR}/util-iso.sh import ${LIBDIR}/util-iso.sh
prepare_traps(){
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
}
prepare_build(){
timer_start=$(get_timer)
load_profile "${profile}"
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}"
}
show_profile(){ show_profile(){
prepare_build
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}"
@@ -36,7 +66,6 @@ show_profile(){
msg2 "openrc_boot: %s" "${openrc_boot[*]}" msg2 "openrc_boot: %s" "${openrc_boot[*]}"
msg2 "openrc_default: %s" "${openrc_default[*]}" msg2 "openrc_default: %s" "${openrc_default[*]}"
fi fi
reset_profile
} }
display_settings(){ display_settings(){
@@ -69,8 +98,6 @@ load_user_info
load_config "${AT_USERCONFDIR}/artools.conf" || load_config "${SYSCONFDIR}/artools.conf" load_config "${AT_USERCONFDIR}/artools.conf" || load_config "${SYSCONFDIR}/artools.conf"
load_run_dir
clean_first=true clean_first=true
pretend=false pretend=false
images_only=false images_only=false
@@ -135,7 +162,9 @@ shift $(($OPTIND - 1))
check_root check_root
check_requirements prepare_traps
prepare_build
${pretend} && display_settings && exit 1 ${pretend} && display_settings && exit 1

View File

@@ -178,8 +178,13 @@ prepare_build
${pretend} && display_settings && exit ${pretend} && display_settings && exit
${delete_first} && delete_chroot "${work_dir}/root" "${work_dir}" if ${delete_first};then
delete_chroot "${work_dir}/root" "${work_dir}"
delete_chroot "${work_dir}/$OWNER" "${work_dir}"
fi
${create_first} && create_chroot "${mkchroot_args[@]}" "${work_dir}/root" "${packages[@]}" if ${create_first} || [[ ! -d ${work_dir}/root ]];then
create_chroot "${mkchroot_args[@]}" "${work_dir}/root" "${packages[@]}"
fi
build "${package}" build "${package}"

View File

@@ -37,7 +37,6 @@ display_settings(){
msg "ARGS:" msg "ARGS:"
msg2 "verbose: %s" "${verbose}" msg2 "verbose: %s" "${verbose}"
msg2 "artix: %s" "${artix}"
msg2 "arch: %s" "${arch}" msg2 "arch: %s" "${arch}"
msg2 "import_arch: %s" "${import_arch}" msg2 "import_arch: %s" "${import_arch}"
@@ -57,7 +56,6 @@ load_user_info
load_config "${AT_USERCONFDIR}/artools.conf" || load_config "${SYSCONFDIR}/artools.conf" load_config "${AT_USERCONFDIR}/artools.conf" || load_config "${SYSCONFDIR}/artools.conf"
artix=false
pretend=false pretend=false
arch=false arch=false
import_arch=false import_arch=false
@@ -67,7 +65,6 @@ rsync_args=(-aWx --progress --delete --no-R --no-implied-dirs)
usage() { usage() {
echo "Usage: ${0##*/} [options]" echo "Usage: ${0##*/} [options]"
echo " -x Sync artix import tree"
echo " -a Sync arch tree" echo " -a Sync arch tree"
echo ' -i Import arch packages' echo ' -i Import arch packages'
echo ' -v Verbose import output' echo ' -v Verbose import output'
@@ -80,11 +77,10 @@ usage() {
orig_argv=("$0" "$@") orig_argv=("$0" "$@")
opts='xaivqh' opts='aivqh'
while getopts "${opts}" arg; do while getopts "${opts}" arg; do
case "${arg}" in case "${arg}" in
x) artix=true ;;
a) arch=true ;; a) arch=true ;;
i) import_arch=true ;; i) import_arch=true ;;
v) verbose=true; rsync_args+=(-v --stats) ;; v) verbose=true; rsync_args+=(-v --stats) ;;
@@ -101,8 +97,6 @@ prepare_dir "${tree_dir_arch}"
${pretend} && display_settings && exit 1 ${pretend} && display_settings && exit 1
${artix} && sync_tree_artix
${arch} && sync_tree_arch ${arch} && sync_tree_arch
${import_arch} && import_from_arch ${import_arch} && import_from_arch

View File

@@ -21,7 +21,6 @@ import ${LIBDIR}/util-yaml-check.sh
import ${LIBDIR}/util-profile.sh import ${LIBDIR}/util-profile.sh
show_profile(){ show_profile(){
prepare_build
msg2 "yaml_dir: %s" "${yaml_dir}" msg2 "yaml_dir: %s" "${yaml_dir}"
msg2 "autologin: %s" "${autologin}" msg2 "autologin: %s" "${autologin}"
@@ -35,9 +34,6 @@ show_profile(){
msg2 "enable_live: %s" "${enable_live[*]}" msg2 "enable_live: %s" "${enable_live[*]}"
msg2 "openrc_boot: %s" "${openrc_boot[*]}" msg2 "openrc_boot: %s" "${openrc_boot[*]}"
msg2 "openrc_default: %s" "${openrc_default[*]}" msg2 "openrc_default: %s" "${openrc_default[*]}"
reset_profile
unset yaml_dir
} }
display_settings(){ display_settings(){
@@ -62,11 +58,6 @@ load_user_info
load_config "${AT_USERCONFDIR}/artools.conf" || load_config "${SYSCONFDIR}/artools.conf" load_config "${AT_USERCONFDIR}/artools.conf" || load_config "${SYSCONFDIR}/artools.conf"
# to force old way to have buildiso run in iso-profiles dir
# run_dir=$(pwd)
load_run_dir
calamares=false calamares=false
pretend=false pretend=false
group=false group=false
@@ -107,6 +98,8 @@ done
shift $(($OPTIND - 1)) shift $(($OPTIND - 1))
prepare_build
${pretend} && display_settings && exit 1 ${pretend} && display_settings && exit 1
${group} && write_pacman_group_yaml "${profile}" && exit 0 ${group} && write_pacman_group_yaml "${profile}" && exit 0

View File

@@ -63,6 +63,7 @@ add_pkg=false
del_pkg=false del_pkg=false
copy_pkg=false copy_pkg=false
package='' package=''
repository='system'
rsync_args=(-rtxisP --progress --delete -e ssh) rsync_args=(-rtxisP --progress --delete -e ssh)

View File

@@ -8,9 +8,6 @@
# build dir where buildpkg or buildiso chroots are created # build dir where buildpkg or buildiso chroots are created
# chroots_dir=/var/lib/artools # chroots_dir=/var/lib/artools
# custom build mirror server
# build_mirror=https://netcologne.dl.sourceforge.net/project/artix-linux/repos
# the server user # the server user
# account=[SetUser] # account=[SetUser]
@@ -27,8 +24,8 @@
################ artools-pkg ################ ################ artools-pkg ################
############################################# #############################################
# artix import tree # artix testing branches import tree
# repo_tree_import=('system-arch' 'world-arch' 'galaxy-arch') # repo_tree_import=('system' 'world' 'galaxy')
# host_tree_artix=https://github.com/artix-linux # host_tree_artix=https://github.com/artix-linux
@@ -44,9 +41,6 @@
################ artools-iso ################ ################ artools-iso ################
############################################# #############################################
# the default profile
# profile=base
# the dist release; default: auto # the dist release; default: auto
# dist_release=rolling # dist_release=rolling

View File

@@ -1 +0,0 @@
openrc

View File

@@ -1,30 +0,0 @@
##########################################
###### use this file in the profile ######
##########################################
################ install ################
# default displaymanager: none
# supported; lightdm, sddm, gdm, lxdm, mdm
# displaymanager="none"
# Set to false to disable autologin in the livecd
# autologin="true"
# service runlevels
# openrc_boot=('elogind')
# openrc_default=('acpid' 'bluetooth' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager')
# unset defaults to given values
# addgroups="video,power,storage,optical,network,lp,scanner,wheel,users"
################# live-session #################
# unset defaults to given value
# hostname="artix"
# unset defaults to given value
# username="artix"
# unset defaults to given value
# password="artix"

View File

@@ -1 +0,0 @@
0.5

View File

@@ -35,7 +35,6 @@ error_function() {
run_log(){ run_log(){
local func="$1" local func="$1"
local logfile=${log_dir}/$(gen_iso_fn).$func.log local logfile=${log_dir}/$(gen_iso_fn).$func.log
# local tmpfile=${tmp_dir}/$func.ansi.log
logpipe=$(mktemp -u "${tmp_dir}/$func.pipe.XXXXXXXX") logpipe=$(mktemp -u "${tmp_dir}/$func.pipe.XXXXXXXX")
mkfifo "$logpipe" mkfifo "$logpipe"
tee "$logfile" < "$logpipe" & tee "$logfile" < "$logpipe" &
@@ -43,8 +42,6 @@ run_log(){
$func &> "$logpipe" $func &> "$logpipe"
wait $teepid wait $teepid
rm "$logpipe" rm "$logpipe"
# cat $tmpfile | perl -pe 's/\e\[?.*?[\@-~]//g' > $logfile
# rm "$tmpfile"
} }
run_safe() { run_safe() {
@@ -392,42 +389,7 @@ prepare_images(){
show_elapsed_time "${FUNCNAME}" "${timer}" show_elapsed_time "${FUNCNAME}" "${timer}"
} }
check_requirements(){
[[ -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
}
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(){ 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}"
@@ -447,7 +409,6 @@ build(){
prepare_images prepare_images
compress_images compress_images
fi fi
reset_profile
msg "Finished building [%s]" "${profile}" msg "Finished building [%s]" "${profile}"
show_elapsed_time "${FUNCNAME}" "${timer_start}" show_elapsed_time "${FUNCNAME}" "${timer_start}"
} }

View File

@@ -49,21 +49,6 @@ clone_tree(){
show_elapsed_time "${FUNCNAME}" "${timer}" show_elapsed_time "${FUNCNAME}" "${timer}"
} }
sync_tree_artix(){
cd ${tree_dir_artix}
for repo in ${repo_tree_import[@]};do
if [[ -d ${repo} ]];then
cd ${repo}
$(is_dirty) && die "[%s] has uncommited changes!" "${repo}"
sync_tree "${repo}"
cd ..
else
clone_tree "${repo}" "${host_tree_artix}/${repo}"
fi
done
cd ..
}
sync_tree_arch(){ sync_tree_arch(){
cd ${tree_dir_arch} cd ${tree_dir_arch}
for repo in ${repo_tree_arch[@]};do for repo in ${repo_tree_arch[@]};do
@@ -95,15 +80,16 @@ is_untracked(){
} }
import_from_arch(){ import_from_arch(){
local timer=$(get_timer) local timer=$(get_timer) branch='testing'
for repo in ${repo_tree_import[@]};do for repo in ${repo_tree_import[@]};do
read_import_list "$repo" read_import_list "$repo"
if [[ -n ${import_list[@]} ]];then if [[ -n ${import_list[@]} ]];then
cd ${tree_dir_artix}/$repo cd ${tree_dir_artix}/$repo
# git checkout master &> /dev/null git checkout $branch &> /dev/null
$(is_dirty) && die "[%s] has uncommited changes!" "${repo}" $(is_dirty) && die "[%s] has uncommited changes!" "${repo}"
git pull origin $branch &> /dev/null
local arch_dir=packages local arch_dir=packages
[[ $repo == "galaxy-arch" ]] && arch_dir=community [[ $repo == "galaxy" ]] && arch_dir=community
msg "Import into [%s]" "$repo" msg "Import into [%s]" "$repo"
for pkg in ${import_list[@]};do for pkg in ${import_list[@]};do
rsync "${rsync_args[@]}" ${tree_dir_arch}/$arch_dir/$pkg/trunk/ ${tree_dir_artix}/$repo/$pkg/ rsync "${rsync_args[@]}" ${tree_dir_arch}/$arch_dir/$pkg/trunk/ ${tree_dir_artix}/$repo/$pkg/

View File

@@ -8,31 +8,29 @@
# 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.
write_repo_conf(){
local repos=$(find $USER_HOME -type f -name "repo_info")
local path name
[[ -z ${repos[@]} ]] && run_dir=${DATADIR}/iso-profiles && return 1
for r in ${repos[@]}; do
path=${r%/repo_info}
name=${path##*/}
echo "run_dir=$path" > ${AT_USERCONFDIR}/$name.conf
done
}
load_run_dir(){
local gitrepo='iso-profiles'
[[ -f ${AT_USERCONFDIR}/$gitrepo.conf ]] || write_repo_conf
[[ -r ${AT_USERCONFDIR}/$gitrepo.conf ]] && source ${AT_USERCONFDIR}/$gitrepo.conf
return 0
}
load_profile(){ load_profile(){
local profdir="$1" local prof="$1"
local profile_conf="$profdir/profile.conf" local profdir="${DATADIR}/iso-profiles/$prof"
[[ "$prof" != 'base' ]] && profdir=${workspace_dir}/iso-profiles/$prof
[[ -f ${profile_conf} ]] || return 1 root_list="${DATADIR}/iso-profiles/base/Packages-Root"
[[ -f "$profdir/Packages-Root" ]] && root_list="$profdir/Packages-Root"
[[ -r ${profile_conf} ]] && source ${profile_conf} root_overlay="${DATADIR}/iso-profiles/base/root-overlay"
[[ -d "$profdir/root-overlay" ]] && root_overlay="$profdir/root-overlay"
[[ -f "$profdir/Packages-Desktop" ]] && desktop_list="$profdir/Packages-Desktop"
[[ -d "$profdir/desktop-overlay" ]] && desktop_overlay="$profdir/desktop-overlay"
live_list="${DATADIR}/iso-profiles/base/Packages-Live"
[[ -f "$profdir/Packages-Live" ]] && live_list="$profdir/Packages-Live"
live_overlay="${DATADIR}/iso-profiles/base/live-overlay"
[[ -d "$profdir/live-overlay" ]] && live_overlay="$profdir/live-overlay"
[[ -f $profdir/profile.conf ]] || return 1
[[ -r $profdir/profile.conf ]] && source $profdir/profile.conf
[[ -z ${displaymanager} ]] && displaymanager="none" [[ -z ${displaymanager} ]] && displaymanager="none"
@@ -61,44 +59,11 @@ load_profile(){
enable_live=('artix-live' 'pacman-init') enable_live=('artix-live' 'pacman-init')
netgroups="https://raw.githubusercontent.com/artix-linux/netgroups/master" [[ -z ${netgroups} ]] && netgroups="https://raw.githubusercontent.com/artix-linux/netgroups/master"
root_list=${run_dir}/base/Packages-Root
[[ -f "$profdir/Packages-Root" ]] && root_list="$profdir/Packages-Root"
root_overlay="${run_dir}/base/root-overlay"
[[ -d "$profdir/root-overlay" ]] && root_overlay="$profdir/root-overlay"
[[ -f "$profdir/Packages-Desktop" ]] && desktop_list=$profdir/Packages-Desktop
[[ -d "$profdir/desktop-overlay" ]] && desktop_overlay="$profdir/desktop-overlay"
live_list="${run_dir}/base/Packages-Live"
[[ -f "$profdir/Packages-Live" ]] && live_list="$profdir/Packages-Live"
live_overlay="${run_dir}/base/live-overlay"
[[ -d "$profdir/live-overlay" ]] && live_overlay="$profdir/live-overlay"
return 0 return 0
} }
reset_profile(){
unset displaymanager
unset autologin
unset hostname
unset username
unset password
unset addgroups
unset openrc_boot
unset openrc_default
unset enable_live
unset root_list
unset desktop_list
unset live_list
unset root_overlay
unset desktop_overlay
unset live_overlay
}
write_live_session_conf(){ write_live_session_conf(){
local path=$1${SYSCONFDIR} local path=$1${SYSCONFDIR}
[[ ! -d $path ]] && mkdir -p "$path" [[ ! -d $path ]] && mkdir -p "$path"

View File

@@ -38,17 +38,12 @@ gen_fn(){
} }
prepare_build(){ prepare_build(){
local profile_dir=${run_dir}/${profile} load_profile "${profile}"
load_profile "${profile_dir}"
yaml_dir=${cache_dir_netinstall}/${profile}/${target_arch} yaml_dir=${cache_dir_netinstall}/${profile}/${target_arch}
prepare_dir "${yaml_dir}" prepare_dir "${yaml_dir}"
} }
build(){ build(){
prepare_build
load_pkgs "${root_list}" "${target_arch}" "${initsys}" "${kernel}" load_pkgs "${root_list}" "${target_arch}" "${initsys}" "${kernel}"
write_netgroup_yaml "${profile}" "$(gen_fn "Packages-Root")" write_netgroup_yaml "${profile}" "$(gen_fn "Packages-Root")"
if [[ -f "${desktop_list}" ]]; then if [[ -f "${desktop_list}" ]]; then
@@ -56,6 +51,4 @@ build(){
write_netgroup_yaml "${profile}" "$(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
unset yaml_dir
} }

View File

@@ -37,14 +37,9 @@ prepare_dir(){
[[ ! -d $1 ]] && mkdir -p $1 [[ ! -d $1 ]] && mkdir -p $1
} }
get_release(){
source /etc/lsb-release
echo "${DISTRIB_RELEASE}"
}
get_distname(){ get_distname(){
source /etc/lsb-release source /usr/lib/os-release
echo "${DISTRIB_ID%Linux}" echo "${NAME%Linux}"
} }
get_disturl(){ get_disturl(){
@@ -68,8 +63,6 @@ init_artools_base(){
[[ -z ${chroots_dir} ]] && chroots_dir='/var/lib/artools' [[ -z ${chroots_dir} ]] && chroots_dir='/var/lib/artools'
[[ -z ${build_mirror} ]] && build_mirror='https://downloads.sourceforge.net/project/artix-linux/repos'
log_dir='/var/log/artools' log_dir='/var/log/artools'
tmp_dir='/tmp' tmp_dir='/tmp'
@@ -91,9 +84,7 @@ init_artools_pkg(){
[[ -z ${tree_dir_artix} ]] && tree_dir_artix=${workspace_dir}/artix [[ -z ${tree_dir_artix} ]] && tree_dir_artix=${workspace_dir}/artix
[[ -z ${repo_tree_artix[@]} ]] && repo_tree_artix=('system' 'world' 'galaxy') [[ -z ${repo_tree_import[@]} ]] && repo_tree_import=('system' 'world' 'galaxy')
[[ -z ${repo_tree_import[@]} ]] && repo_tree_import=('system-arch' 'world-arch' 'galaxy-arch')
[[ -z ${host_tree_artix} ]] && host_tree_artix='https://github.com/artix-linux' [[ -z ${host_tree_artix} ]] && host_tree_artix='https://github.com/artix-linux'
@@ -109,18 +100,12 @@ init_artools_pkg(){
chroots_pkg="${chroots_dir}/buildpkg" chroots_pkg="${chroots_dir}/buildpkg"
list_dir_pkg="${SYSCONFDIR}/pkg.list.d"
make_conf_dir="${SYSCONFDIR}/make.conf.d" make_conf_dir="${SYSCONFDIR}/make.conf.d"
[[ -d ${AT_USERCONFDIR}/pkg.list.d ]] && list_dir_pkg=${AT_USERCONFDIR}/pkg.list.d
cache_dir_pkg=${workspace_dir}/pkg cache_dir_pkg=${workspace_dir}/pkg
prepare_dir "${cache_dir_pkg}" prepare_dir "${cache_dir_pkg}"
repository='system'
[[ -z ${repos_local} ]] && repos_local="${workspace_dir}/repos" [[ -z ${repos_local} ]] && repos_local="${workspace_dir}/repos"
repos_remote="/${repos_local##*/}" repos_remote="/${repos_local##*/}"
@@ -133,9 +118,9 @@ init_artools_iso(){
prepare_dir "${cache_dir_iso}" prepare_dir "${cache_dir_iso}"
[[ -z ${profile} ]] && profile='base' profile='base'
[[ -z ${dist_release} ]] && dist_release=$(get_release) [[ -z ${dist_release} ]] && dist_release=$(date +%Y%m%d)
dist_name=$(get_distname) dist_name=$(get_distname)