-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·79 lines (69 loc) · 1.87 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·79 lines (69 loc) · 1.87 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env bash
set -euo pipefail
NAME="Veilbox"
VERSION="2.0"
CODENAME="trixie"
ARCH="${ARCH:-amd64}"
MIRROR="${MIRROR:-http://deb.debian.org/debian}"
OUTPUT_DIR="${OUTPUT_DIR:-$(pwd)/output}"
PARALLEL="${PARALLEL:-$(nproc)}"
usage() {
cat <<EOF
Usage: $0 [command]
Commands:
clean Remove build artifacts
config Re-run lb config (uses auto/config)
build Run lb build (full ISO build)
all clean + config + build
qemu Boot the built ISO in QEMU (if available)
Environment variables:
ARCH Target architecture (default: amd64)
MIRROR Debian mirror URL
OUTPUT_DIR Output directory for the ISO
PARALLEL Parallel jobs for lb build
EOF
exit 0
}
cmd_clean() {
echo "==> Cleaning build artifacts..."
sudo lb clean --purge 2>/dev/null || true
rm -rf "$OUTPUT_DIR" 2>/dev/null || true
}
cmd_config() {
echo "==> Running lb config..."
sudo lb config
}
cmd_build() {
echo "==> Building Veilbox v2 ISO..."
mkdir -p "$OUTPUT_DIR"
sudo lb build 2>&1 | tee "$OUTPUT_DIR/build.log"
local iso
iso=$(ls -t live-image-*.hybrid.iso 2>/dev/null | head -1)
if [ -n "$iso" ]; then
mv "$iso" "$OUTPUT_DIR/veilbox-${VERSION}-${ARCH}.iso"
echo "==> ISO built: $OUTPUT_DIR/veilbox-${VERSION}-${ARCH}.iso"
fi
}
cmd_qemu() {
local iso
iso=$(ls -t "$OUTPUT_DIR"/veilbox-*.iso 2>/dev/null | head -1)
if [ -z "$iso" ]; then
echo "No ISO found in $OUTPUT_DIR" >&2
exit 1
fi
echo "==> Booting $iso in QEMU..."
qemu-system-x86_64 -m 4096 -smp 4 \
-enable-kvm \
-cdrom "$iso" \
-netdev user,id=net0 \
-device virtio-net,netdev=net0 \
-display gtk
}
case "${1:-help}" in
clean) cmd_clean ;;
config) cmd_config ;;
build) cmd_build ;;
all) cmd_clean; cmd_config; cmd_build ;;
qemu) cmd_qemu ;;
*) usage ;;
esac