-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.sh
executable file
·49 lines (40 loc) · 1.43 KB
/
build.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
44
45
46
47
48
49
#! /usr/bin/env sh
# environmental and build settings
KEYFILE="${KEYFILE:-"$HOME/.ecdsakey"}"
GLUON_PRIORITY="${GLUON_PRIORITY:-7}"
JOBS=${JOBS:-"$(grep -c '^processor' /proc/cpuinfo)"}
# start of script
set -eu
# determine absolute path of site repository
if which realpath > /dev/null; then
GLUON_SITEDIR="$(dirname "$(realpath "$0")")"
else
GLUON_SITEDIR="$(dirname "$(readlink -f "$0")")"
fi
export GLUON_SITEDIR
GLUON_DIR="${GLUON_SITEDIR}/gluon/"
# start building
cd "${GLUON_DIR}"
make update V=s
GLUON_TARGETS=${GLUON_TARGETS:-"$(make list-targets)"}
for target in $GLUON_TARGETS; do
echo "Building target ${target}"
schedtool -B -e \
make --jobs="$JOBS" --output-sync=recurse \
GLUON_TARGET="$target" V=s
done
# generate manifests
make manifest
if [ -z "${GLUON_AUTOUPDATER_BRANCH:-}" ]; then
make manifest GLUON_AUTOUPDATER_BRANCH=testing GLUON_PRIORITY=0
# add BRANCH=nightly line below BRANCH=testing line
sed -i -e "/^BRANCH=testing/ a BRANCH=nightly" \
"${GLUON_DIR}/output/images/sysupgrade/testing.manifest"
ln -sf testing.manifest "${GLUON_DIR}/output/images/sysupgrade/nightly.manifest"
ln -sf testing.manifest "${GLUON_DIR}/output/images/sysupgrade/manifest"
fi
# sign testing/nightly manifest if key is present
if [ -n "$KEYFILE" ] && [ -r "$KEYFILE" ]; then
"${GLUON_DIR}/contrib/sign.sh" "$KEYFILE" \
"${GLUON_DIR}/output/images/sysupgrade/testing.manifest"
fi