-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild
executable file
·55 lines (39 loc) · 1.21 KB
/
build
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
#!/bin/bash
set -Eeux
source vars.sh
BASE_DIR="$PWD"
# check for root permissions
if [[ "$(id -u)" != 0 ]]; then
echo "E: Requires root permissions" > /dev/stderr
exit 1
fi
apt-get update
apt-get install -y live-build patch ubuntu-keyring
# Fix isohybrid having moved from syslinux to syslinux-utils
sed -i 's/isohybrid\ syslinux$/isohybrid\ syslinux-utils/g' /usr/lib/live/build/lb_binary_iso
build () {
local BUILD_ARCH
local TMP_DIR
BUILD_ARCH="${1}"
TMP_DIR="${BASE_DIR}/tmp/${BUILD_ARCH}"
mkdir -p "${TMP_DIR}"
cp -r auto config vars.sh "${TMP_DIR}"/
cd "${TMP_DIR}" || exit
echo "live-build clean..."
lb clean
echo "live-build config..."
lb config
echo "live-build build..."
lb build
echo "Consolidating output..."
YYYYMMDD="$(date +%Y%m%d)"
OUTPUT_DIR="$BASE_DIR/builds/$BUILD_ARCH"
mkdir -p "$OUTPUT_DIR"
FNAME="regolith-$VERSION-$CHANNEL.$YYYYMMDD$OUTPUT_SUFFIX"
mv "$BASE_DIR/tmp/$BUILD_ARCH/binary.hybrid.iso" "$OUTPUT_DIR/${FNAME}.iso"
md5sum "$OUTPUT_DIR/${FNAME}.iso" > "$OUTPUT_DIR/${FNAME}.md5.txt"
sha256sum "$OUTPUT_DIR/${FNAME}.iso" > "$OUTPUT_DIR/${FNAME}.sha256.txt"
}
# remove old builds before creating new ones
rm -rf "$BASE_DIR"/builds
build amd64