Skip to content

Commit fa1e190

Browse files
committed
refactor: Update build process and add legacy build script
1 parent 8874796 commit fa1e190

2 files changed

Lines changed: 47 additions & 15 deletions

File tree

alteriso/build.sh

100755100644
Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,31 @@
22

33
set -Eeuo pipefail
44

5+
# Determine script path
56
script_path=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
67
if [[ -n "${1-""}" ]]; then
78
profile_dir="${1-"${script_path}/configs/xfce"}"
89
shift 1
910
fi
1011
work_dir="$script_path/work"
11-
cache_dir="$work_dir/alteriso_cache"
1212

13-
mkdir -p "$work_dir/archiso"
14-
mkdir -p "$cache_dir"
13+
# Build the Go binary
14+
binfile="$(mktemp -u)"
15+
go build -o "$binfile" "$script_path/src"
1516

16-
# Generate archiso profile
17-
"$script_path/gen.sh" -o "$work_dir/profile" "$profile_dir"
17+
# Set mkarchiso path
18+
PATH="$(realpath "$script_path/../archiso/"):$PATH"
19+
export PATH
1820

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"
21+
# Execute the build command
22+
"$binfile" profile \
23+
--bootloaders "$script_path/bootloaders/" \
24+
--modules "$script_path/modules/" \
25+
build \
26+
--workdir "$work_dir" \
27+
--outdir "$script_path/out" \
28+
"$profile_dir" "$@"
2429

25-
# sudo ../archiso/mkarchiso \
26-
# -v \
27-
# -w "$work_dir/archiso" \
28-
# -o "$script_path/out" \
29-
# "$work_dir/profile"
30+
# Clean up
31+
"$binfile" clean --workdir "$work_dir"
32+
rm "$binfile"

alteriso/legacy_build.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
set -Eeuo pipefail
4+
5+
script_path=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
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"

0 commit comments

Comments
 (0)