2015-08-08 15:26:36 +02:00
|
|
|
#! /usr/bin/env sh
|
2015-07-02 17:16:59 +02:00
|
|
|
|
2017-02-22 19:33:54 +01:00
|
|
|
# environmental and build settings
|
|
|
|
KEYFILE="${KEYFILE:-"$HOME/.ecdsakey"}"
|
|
|
|
GLUON_PRIORITY="${GLUON_PRIORITY:-7}"
|
2019-09-13 00:38:06 +02:00
|
|
|
JOBS=${JOBS:-"$(grep -c '^processor' /proc/cpuinfo)"}
|
2015-07-02 17:16:59 +02:00
|
|
|
|
2017-02-22 19:33:54 +01:00
|
|
|
# start of script
|
2015-07-02 17:16:59 +02:00
|
|
|
set -eu
|
|
|
|
|
2017-02-22 19:33:54 +01:00
|
|
|
# determine absolute path of site repository
|
2015-11-07 20:55:30 +01:00
|
|
|
if which realpath > /dev/null; then
|
2019-12-16 21:39:08 +01:00
|
|
|
GLUON_SITEDIR="$(dirname "$(realpath "$0")")"
|
2015-11-07 20:55:30 +01:00
|
|
|
else
|
2019-12-16 21:39:08 +01:00
|
|
|
GLUON_SITEDIR="$(dirname "$(readlink -f "$0")")"
|
2015-11-07 20:55:30 +01:00
|
|
|
fi
|
2019-12-16 21:39:08 +01:00
|
|
|
export GLUON_SITEDIR
|
2017-02-22 19:33:54 +01:00
|
|
|
GLUON_DIR="${GLUON_SITEDIR}/gluon/"
|
2015-07-02 17:16:59 +02:00
|
|
|
|
2017-02-22 19:33:54 +01:00
|
|
|
# start building
|
|
|
|
cd "${GLUON_DIR}"
|
|
|
|
make update V=s
|
2015-07-02 17:16:59 +02:00
|
|
|
|
2020-08-09 18:35:44 +02:00
|
|
|
GLUON_TARGETS=${GLUON_TARGETS:-"$(make list-targets)"}
|
2017-10-15 17:29:06 +02:00
|
|
|
|
2017-02-22 19:33:54 +01:00
|
|
|
for target in $GLUON_TARGETS; do
|
|
|
|
echo "Building target ${target}"
|
|
|
|
schedtool -B -e \
|
2019-12-16 21:39:08 +01:00
|
|
|
make --jobs="$JOBS" --output-sync=recurse \
|
2017-02-22 19:33:54 +01:00
|
|
|
GLUON_TARGET="$target" V=s
|
|
|
|
done
|
2015-08-26 21:54:01 +02:00
|
|
|
|
2017-02-22 19:33:54 +01:00
|
|
|
# generate manifests
|
|
|
|
make manifest
|
2015-08-04 10:04:42 +02:00
|
|
|
|
2017-02-22 19:33:54 +01:00
|
|
|
if [ -z "${GLUON_BRANCH:-}" ]; then
|
|
|
|
make manifest GLUON_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"
|
2018-02-02 20:16:41 +01:00
|
|
|
ln -sf testing.manifest "${GLUON_DIR}/output/images/sysupgrade/nightly.manifest"
|
|
|
|
ln -sf testing.manifest "${GLUON_DIR}/output/images/sysupgrade/manifest"
|
2015-08-30 16:44:44 +02:00
|
|
|
fi
|
|
|
|
|
2017-02-22 19:33:54 +01:00
|
|
|
# sign testing/nightly manifest if key is present
|
2019-12-16 21:39:08 +01:00
|
|
|
if [ -n "$KEYFILE" ] && [ -r "$KEYFILE" ]; then
|
2017-02-22 19:33:54 +01:00
|
|
|
"${GLUON_DIR}/contrib/sign.sh" "$KEYFILE" \
|
|
|
|
"${GLUON_DIR}/output/images/sysupgrade/testing.manifest"
|
2015-07-02 17:16:59 +02:00
|
|
|
fi
|