-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-iso.sh
More file actions
executable file
Β·46 lines (40 loc) Β· 2.43 KB
/
Copy pathbuild-iso.sh
File metadata and controls
executable file
Β·46 lines (40 loc) Β· 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# β BITE-OS β build the installable ISO
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Takes the stock archiso `releng` profile, overlays the BITE-OS customisations
# from iso/, merges the package lists, and runs mkarchiso.
#
# Prereqs: sudo pacman -S archiso (build tool)
# bash repo/build-repo.sh (local [bite-os] repo must exist)
#
# Run: sudo bash build-iso.sh
# Output: out/bite-os-1.0-x86_64.iso
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
set -euo pipefail
DISTRO="$(cd "$(dirname "$0")" && pwd)"
# Build on real disk, NOT /tmp β /tmp is RAM-backed (tmpfs) and the ~10 GB
# airootfs overflows it, causing "Write failed" extraction errors.
PROFILE="$DISTRO/.build-profile"
WORK="$DISTRO/.build-work"
OUT="$DISTRO/out"
[ "$(id -u)" -eq 0 ] || { echo "run as root: sudo bash build-iso.sh" >&2; exit 1; }
command -v mkarchiso >/dev/null || { echo "missing archiso: pacman -S archiso" >&2; exit 1; }
[ -f "$DISTRO/repo/x86_64/bite-os.db.tar.gz" ] || {
echo "local repo not built β run: bash repo/build-repo.sh" >&2; exit 1; }
echo "==> Preparing profile from stock releng"
rm -rf "$PROFILE" "$WORK"
cp -r /usr/share/archiso/configs/releng "$PROFILE"
# Merge package lists: releng's live-boot essentials + the BITE-OS set.
cat "$PROFILE/packages.x86_64" "$DISTRO/iso/packages.x86_64" \
| grep -vE '^\s*#|^\s*$' | sort -u > /tmp/bite-pkgs.txt
echo "==> Overlaying BITE-OS customisations"
cp -rf "$DISTRO/iso/." "$PROFILE/"
mv /tmp/bite-pkgs.txt "$PROFILE/packages.x86_64"
chmod +x "$PROFILE/airootfs/usr/local/bin/bite-os-live-setup" 2>/dev/null || true
echo "==> Building ISO (this takes a while)"
mkdir -p "$OUT"
mkarchiso -v -w "$WORK" -o "$OUT" "$PROFILE"
echo
echo "β Done. ISO is in: $OUT"
echo " Test it: boot the .iso in a VM (GNOME Boxes / virt-manager) before publishing."