File tree Expand file tree Collapse file tree
src/internal/archiso/injects Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33set -Eeuo pipefail
4+
45script_path=$( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd)
5- rm -rf " $script_path /out"
6- profile_dir=" ${1-" " ${script_path} / configs/ xfce" " } "
7- " $script_path /gen.sh" " $profile_dir "
8- sudo ../archiso/mkarchiso -v -w " $script_path /work" -o " $script_path /out" " $script_path /out/$( basename " $profile_dir " ) "
6+ if [[ -n " ${1-" " } " ]]; then
7+ profile_dir=" ${1-" ${script_path} /configs/xfce" } "
8+ shift 1
9+ fi
10+ work_dir=" $script_path /work"
11+ cache_dir=" $work_dir /alteriso_cache"
12+
13+ mkdir -p " $work_dir /archiso"
14+ mkdir -p " $cache_dir "
15+
16+ # Generate archiso profile
17+ " $script_path /gen.sh" -o " $work_dir /profile" " $profile_dir "
18+
19+ sudo ALTERISO_PACMAN_CACHE=" $cache_dir " \
20+ ../archiso/mkarchiso -v \
21+ -w " $work_dir /archiso" \
22+ -o " $script_path /out" \
23+ " $work_dir /profile"
24+
25+ # sudo ../archiso/mkarchiso \
26+ # -v \
27+ # -w "$work_dir/archiso" \
28+ # -o "$script_path/out" \
29+ # "$work_dir/profile"
Original file line number Diff line number Diff line change 1313mount | cut -d ' ' -f 3 | grep " $script_path /work" | sort -r | xargs -r umount -lf || true
1414
1515# Clean
16- rm -rf " $script_path /work" " $script_path /out "
16+ rm -rf " $script_path /work"
Original file line number Diff line number Diff line change @@ -5,5 +5,4 @@ script_path=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
55exec go run " $script_path /src" profile \
66 --bootloaders " $script_path /bootloaders/" \
77 --modules " $script_path /modules/" \
8- generate \
9- -o " $script_path /out" " $@ "
8+ generate " $@ "
Original file line number Diff line number Diff line change @@ -62,3 +62,16 @@ __alteriso_make_version() {
6262post__make_version () {
6363 __alteriso_make_version
6464}
65+
66+ # Inject pacman cache directory into pacman.conf
67+ pre__make_pacman_conf () {
68+ [[ -n " ${ALTERISO_PACMAN_CACHE-" " } " ]] || return 0
69+
70+ local __alteriso_cachedir=" $ALTERISO_PACMAN_CACHE "
71+ local __alteriso_pacman_conf=" $work_dir /alteriso_pacman.conf"
72+
73+ pacman-conf -c " $pacman_conf " \
74+ | sed -e " s|^CacheDir = .*|CacheDir = $__alteriso_cachedir |" \
75+ > " $__alteriso_pacman_conf "
76+ pacman_conf=" $__alteriso_pacman_conf "
77+ }
You can’t perform that action at this time.
0 commit comments