Commit 7e9cc2b9 authored by fuzzle's avatar fuzzle

autosync fffrmaker from stable

parent 7e153ed6
......@@ -9,9 +9,11 @@ noone=no
[ -f noone ] && noone=yes
[ -f noone ] && touch gluon-opkg-key
[ -f noone ] && [ -f ./gluon/build/gluon-opkg-key ] && cp ./gluon/build/gluon-opkg-key .
# you may copy gluon/lede/*key to ./.
branch=$1
release=$2
target=$3
# location of fffr firmware
basedir=/media/freifunk/firmware
......@@ -31,6 +33,7 @@ MAKEFLAGS=" V=99 -j1"
# if $1 and/or $2 is empty use this (shouldnt happen)
: ${branch:=experimental}
: ${release:=v2017.1.2}
: ${target:=ar71xx-tiny}
# this will run all fffrmaker with standart release and exit in favour of next if while $# != 2
if [ $1 = reset ] ; then
......@@ -49,17 +52,23 @@ if [ $1 = reset ] ; then
done
echo "cp $basedir/gluon/output/* $wwwdir/ -r"
fi
if [ $# != 2 ]; then
echo "usage $0 branch release"
echo " example: $0 $branch $release"
echo " normal branches: $(echo -n $(cat branchlist))"
if [ $# < 2 ]; then
echo "usage $0 branch release target"
echo " example: $0 $branch $release $target"
echo " in branchlist file: $(echo -n $(cat branchlist))"
echo " building all use: $0 reset"
echo " (which makes the actual build for all, with fallback release - nice for mass upgrade if gluon change)"
echo " you may want to have a file called branchlist, with each branch per line"
echo " you may want to have an empty file "noone" to signal script not to sign and prevent errors"
exit 1
fi
# be sure to be on desired branch
git checkout $branch
if [ $noone == "no" ] ; then
git checkout $branch
else echo "###### no git checkout - because we are noone ######"
fi
# update gluon to latest master - this may be dangerous, because even with caution by gluon, there may be unforseen bugs
# and also push this into actual repo
......@@ -68,14 +77,14 @@ if [ $noone == "no" ] ; then
git add gluon
git commit -m "update gluon"
git push
else echo "###### no signing - because we are noone ######"
else echo "###### no git add gluon and commit gluon submodule - because we are noone ######"
fi
# make a tag and autocommit this
if [ $noone == "no" ] ; then
git tag -f -a $release -m "autotag build $branch $release"
git push --tags -f
else echo "###### no signing - because we are noone ######"
else echo "###### not making tag - because we are noone ######"
fi
# defaults - but not used, we use complete path given in first lines with $basedir
......@@ -85,7 +94,7 @@ GLUON_MODULEDIR=$GLUON_OUTPUTDIR/modules
echo "###### make FW $branch $release"
time make $MAKEFLAGS \
GLUON_TARGET=ar71xx-tiny \
GLUON_TARGET=$target \
GLUON_BRANCH=$branch \
GLUON_RELEASE=$release \
GLUON_OPKG_KEY=$basedir/gluon-opkg-key \
......@@ -102,10 +111,10 @@ fi
echo "###### make modules, manifest and sign"
# this is already part of Makefile, but fails often because of && and minor main-build errors
echo "###### modules $branch $release"
echo "###### modules $branch $release $target"
cd gluon
time make $MAKEFLAGS \
GLUON_TARGET=ar71xx-tiny \
GLUON_TARGET=$target \
GLUON_BRANCH=$branch \
GLUON_RELEASE=$release \
GLUON_OPKG_KEY=$basedir/gluon-opkg-key \
......@@ -114,10 +123,10 @@ time make $MAKEFLAGS \
GLUON_MODULEDIR=$basedir/gluon/output/modules modules 2>&1 | tee ../logs/make_modules_$(date +%y%m%d_%H%M).log
cd ..
echo "###### manifest $branch $release"
echo "###### manifest $branch $release $target"
cd gluon
time make $MAKEFLAGS \
GLUON_TARGET=ar71xx-tiny \
GLUON_TARGET=$target \
GLUON_BRANCH=$branch \
GLUON_RELEASE=$release \
GLUON_OPKG_KEY=$basedir/gluon-opkg-key \
......@@ -133,7 +142,7 @@ sed -i s/'gluon-fffr'/'sysupgrade\/gluon-fffr'/g gluon/output/$branch/$branch.ma
# hack gluon/contrib/sign.sh and sign both manifests (basedir,sysupgrade_dir)
sed -i s/"ecdsasign"/"ecdsautil sign"/g gluon/contrib/sign.sh
echo "###### sign FW $branch $release"
echo "###### sign FW $branch $release $target"
if [ $noone == "no" ] ; then
for linesigns in $signs; do
echo "###### sign with $linesigns"
......@@ -154,4 +163,4 @@ echo "cp $basedir/gluon/output/* $wwwdir/ -r"
echo "ls -la $wwwdir/$branch"
echo "######################################"
echo "happily finished branch=$branch release=$release on git branch $(echo -n $(git status |head -n1)) at $(date) and make a auto-tag"
echo "happily finished branch=$branch release=$release target=$target on git branch $(echo -n $(git status |head -n1)) at $(date) and make a auto-tag"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment