-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_iso.sh
executable file
·43 lines (36 loc) · 877 Bytes
/
make_iso.sh
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
#!/usr/bin/bash
success() {
echo -e "\e[32;1m$1\e[0m"
}
error() {
echo -e "\e[31;1mError: $1.\e[0m"
}
THIS_DIR=$(pwd)
PROFILE_DIR="$THIS_DIR/profile"
WORK_DIR="$THIS_DIR/work"
OUT_DIR="$THIS_DIR/iso"
pacman_conf() {
echo "[options]"
echo "HoldPkg = pacman glibc"
echo "Architecture = auto"
echo "SigLevel = Never"
echo ""
echo "[offline]"
echo "Server = file://$PROFILE_DIR/airootfs/offline/"
echo ""
echo "[core]"
echo "Include = /etc/pacman.d/mirrorlist"
echo ""
echo "[extra]"
echo "Include = /etc/pacman.d/mirrorlist"
}
if ! pacman_conf > "$PROFILE_DIR/pacman.conf"; then
error "Failed to generate custom pacman.conf"
exit 1
fi
if ! sudo mkarchiso -v -r -w "$WORK_DIR" -o "$OUT_DIR" "$PROFILE_DIR"; then
error "ISO construction failed"
exit 1
fi
success "ISO construction succeeded"
exit 0