Umbau auf Multi-Domain firmware

This commit is contained in:
Daniel Frank 2018-10-01 21:37:30 +02:00
commit e59d96d6dd
Signed by: tokudan
GPG key ID: 063CCCAD04182D32
17 changed files with 428 additions and 437 deletions

View file

@ -7,13 +7,10 @@ function announce () {
function usage () {
echo "Usage: $0 -g GLUON_PATH" >&2
echo " -g GLUON_PATH Path to a checkout of the gluon repository." >&2
echo " -l SITES Comma separated list of sites to build" >&2
echo " -t TARGETS Comma separated list of gluon targets to build" >&2
echo " -o OUT_PATH Path to the firmware output directory. Default: ${gluon_out}" >&2
echo " -s SIGNATURE Sign firmware with signature" >&2
echo " -u UPLOADSCRIPT Run UPLOADSCRIPT after building. Will be run with one argument: $gluon_out/<GLUON_RELEASE>" >&2
echo " -b BROKEN=1" >&2
echo " -m Do not regenerate the sites" >&2
echo " -v verbose" >&2
echo " -j JOBS Run build with -jJOBS. Default: ${proc}" >&2
}
@ -27,10 +24,6 @@ while [ $# -gt 0 ]; do
gluon_path="$2"
shift
;;
-l)
sites="$2"
shift
;;
-t)
build_targets="$2"
shift
@ -43,16 +36,9 @@ while [ $# -gt 0 ]; do
signature="$2"
shift
;;
-u)
uploadscript="$2"
shift
;;
-b)
export BROKEN=1
;;
-m)
dont_make_sites=1
;;
-j)
proc="$2"
shift
@ -61,6 +47,7 @@ while [ $# -gt 0 ]; do
verbose=V=s
;;
*)
echo ERROR: Failed to parse: "${1}" >&2
usage
exit 1
;;
@ -81,61 +68,42 @@ announce GLUON: $gluon_path >&2
announce FFHH SITE PATH: $site_path >&2
pushd $site_path
if [ "$dont_make_sites" == "" ]; then
# Build the site repo and generate all site configs
announce Building site repo and reading data >&2
make
fi
. ./info
. ./build.conf
export GLUON_RELEASE
export GLUON_BRANCH
# if a list of build targets has been supplied, only build those
targets="$(echo "${build_targets:-$targets}" | sed -e 's_,_ _g')"
# get the available sites...
sites="$(echo "$sites" | sed -e 's_,_ _g')"
if [ "$sites" == "" ]; then
for s in sites/*; do sites="${sites} ${s##*/}"; done
fi
announce Gluon will be built for the following sites:$sites >&2
announce The following targets will be generated: $targets >&2
popd
pushd "${gluon_path}"
announce Starting make update...
for s in $sites; do
export GLUON_SITEDIR="${site_path}/sites/${s}"
export GLUON_OUTPUTDIR="${gluon_out}/${GLUON_RELEASE}/${GLUON_BRANCH}/${s}"
rm -rf "${GLUON_OUTPUTDIR}"
mkdir -p "${GLUON_OUTPUTDIR}"
make update
# Try to install patches. I wasn't able to figure out how patches in gluon/site/patches work.
for p in ${site_path}/patches/*.patch; do
if [ -e "$p" -a ! -f "${gluon_path}/${p##*/}" ]; then
announce Installing patch $p
patch -p1 < $p
touch "${gluon_path}/${p##*/}"
fi
done
for t in $targets; do
announce make clean for $s/$t... >&2
make -j1 clean GLUON_TARGET=$t
announce Starting build for $s/$t... >&2
make -j$(nproc) GLUON_TARGET=$t $verbose
done
announce Building manifest...
make manifest
if [ -n "${signature}" ]; then
if [ "$GLUON_BRANCH" == "experimental" ]; then
announce Signing
"${gluon_path}/contrib/sign.sh" "${signature}" "${GLUON_OUTPUTDIR}/images/sysupgrade/experimental.manifest"
else
echo ERROR: can only sign experimental branch >&2
exit 1
fi
export GLUON_SITEDIR="${site_path}"
export GLUON_OUTPUTDIR="${gluon_out}/${GLUON_RELEASE}/${GLUON_BRANCH}"
rm -rf "${GLUON_OUTPUTDIR}"
mkdir -p "${GLUON_OUTPUTDIR}"
make update
# Try to install patches. I wasn't able to figure out how patches in gluon/site/patches work.
for p in ${site_path}/patches/*.patch; do
if [ -e "$p" -a ! -f "${gluon_path}/${p##*/}" ]; then
announce Installing patch $p
patch -p1 < $p
touch "${gluon_path}/${p##*/}"
fi
done
popd
if [ -n "$uploadscript" ]; then
announce Starting upload. Executing: $uploadscript $gluon_out/$GLUON_RELEASE
"$uploadscript" "$gluon_out/$GLUON_RELEASE"
for t in $targets; do
announce Starting build for $t... >&2
make -j$(nproc) GLUON_TARGET=$t $verbose
done
announce Building manifest...
make manifest
if [ -n "${signature}" ]; then
if [ "$GLUON_BRANCH" == "experimental" ]; then
announce Signing...
"${gluon_path}/contrib/sign.sh" "${signature}" "${GLUON_OUTPUTDIR}/images/sysupgrade/experimental.manifest"
else
echo ERROR: can only sign experimental branch >&2
exit 1
fi
fi
popd