Skip to content

Commit

Permalink
v2016.2.7: New modules ffffm-button-bind and ssid-changer
Browse files Browse the repository at this point in the history
This is all merged from nightly, including:

- quickfix: enhanced
- make-release.sh
  • Loading branch information
rubo77 committed Aug 30, 2017
1 parent aee3ddb commit 9dfed4a
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 77 deletions.
148 changes: 77 additions & 71 deletions make-release.sh
Original file line number Diff line number Diff line change
@@ -1,50 +1,67 @@
#!/bin/bash

## This script will compile Gluon for all architectures, create the
## manifest and sign it. For that, you must have clone gluon and have a
## manifest and sign it. For that, you must have cloned gluon and have a
## valid site config. Additionally, the signing key must be present in
## ../../ecdsa-key-secret or defined as first argument.
## The second argument defines the branch (stable, beta, experimental).
## The second argument defines the branch (stable, rc, nightly).
## The third argument defines the version.
## Call from site directory with the version and branch variables
## properly configured in this script.

# if version is unset, will use the default experimental version from site.mk
VERSION=${3:-"2016.2.6.2"}
# on experimentals add ~exp$(date '+%y%m%d%H%M')
# branch must be set to either experimental, beta or stable
# report the usage of uninitialized variables, etc
set -u
# stop on first error (not working in if clauses)
set -e

# if version is unset, will use the default version from site.mk
VERSION=${3:-"2016.2.7"}
# branch must be set to either rc, nightly or stable
BRANCH=${2:-"stable"}
# must point to valid ecdsa signing key created by ecdsakeygen, relative to Gluon base directory
SIGNING_KEY=${1:-"../ecdsa-key-secret"}
#BROKEN must be set to "" or "BROKEN=1"
BROKEN=""
#set num cores
CORES="-j1"

# BROKEN must be set to "" or "BROKEN=1"
BROKEN="BROKEN=1"

# set num cores +1
CORES=$(($(lscpu|grep -e '^CPU(s):'|xargs|cut -d" " -f2)+1))
CORES="-j$CORES"

# set this to "0" if you don't want to use make clean before make
MAKE_CLEAN="1"

# set this to "V=s" to get more output
VERBOSE=""

#ONLY_TARGET must be set to "" or i.e. "ar71xx-generic"
#ONLY_TARGET=""
ONLY_TARGET="ar71xx-generic"
#to build only one device set DEVICES list (only if $ONLY_TARGET!="")
DEVICES=""
#not supported in 2016.x:
#DEVICES="DEVICES=tp-link-tl-wr842n-nd-v3"

cd ../
if [ ! -d "site" ]; then
echo "This script must be called from within the site directory"
exit
echo "This script must be called from within the site directory"
exit
fi

if [ "$(whoami)" == "root" ]; then
echo "Make may not be run as root"
return
echo "Make may not be run as root"
return
fi

if [ -d ../lede/ ]; then
echo lede was checked out, this will break, if you build master now
echo openwrt was checked out, this will break, if you build master now
fi

echo "############## starting build process #################" >> build.log
date >> build.log
echo "if you want to start over empty the folder ../output/"
echo "see debug output with"
echo "tail -f ../build.log &"
echo "tail -F ../build.log &"
sleep 3

#rm -r output
Expand All @@ -54,88 +71,77 @@ sleep 3

WRT1200AC="mvebu" # Linksys WRT1200AC BROKEN: No AP+IBSS+mesh support

ONLY_11S="ramips-rt305x ramips-mt7621" # BROKEN only
ONLY_11S="ramips-rt305x ramips-mt7621" # BROKEN only

ONLY_LEDE="ar71xx-tiny" # Support for for 841 on lede, needs less packages, so the 4MB will suffice!
ONLY_LEDE+=" x86-geode ipq806x ramips-mt7628"
NOT_LEDE="x86-kvm_guest" # The x86-kvm_guest target has been dropped from LEDE; x86-64 should be used

BANANAPI="sunxi" # BROKEN: Untested, no sysupgrade support
MICROTIK="ar71xx-mikrotik" # BROKEN: no sysupgrade support
BANANAPI="sunxi" # BROKEN: Untested, no sysupgrade support
MICROTIK="ar71xx-mikrotik" # BROKEN: no sysupgrade support

RASPBPI="brcm2708-bcm2708 brcm2708-bcm2709"
X86="x86-64 x86-generic x86-xen_domu"
WDR4900="mpc85xx-generic"

TARGETS="ar71xx-generic ar71xx-nand $WDR4900 $RASPBPI $X86 $NOT_LEDE"
TARGETS="ar71xx-generic $NOT_LEDE ar71xx-nand $WDR4900 $RASPBPI $X86"
if [ "$BROKEN" != "" ]; then
TARGETS+=" $BANANAPI $MICROTIK $WRT1200AC"
TARGETS+=" $BANANAPI $MICROTIK $WRT1200AC"
fi

if [ $ONLY_TARGET != "" ]; then
TARGETS="$ONLY_TARGET"
if [ "$ONLY_TARGET" != "" ]; then
TARGETS="$ONLY_TARGET"
fi

for TARGET in $TARGETS
do
date >> build.log
if [ -z "$VERSION" ]
then
echo "Starting work on target $TARGET" | tee -a build.log
echo -e "\n\n\nmake GLUON_TARGET=$TARGET GLUON_BRANCH=stable update" >> build.log
make GLUON_TARGET=$TARGET GLUON_BRANCH=stable update >> build.log 2>&1
echo -e "\n\n\nmake GLUON_TARGET=$TARGET GLUON_BRANCH=stable clean" >> build.log
make GLUON_TARGET=$TARGET GLUON_BRANCH=stable clean >> build.log 2>&1
echo -e "\n\n\nmake GLUON_TARGET=$TARGET GLUON_BRANCH=stable V=s $BROKEN $CORES" >> build.log
make GLUON_TARGET=$TARGET GLUON_BRANCH=stable V=s $BROKEN $CORES >> build.log 2>&1
echo -e "\n\n\n============================================================\n\n" >> build.log
else
echo "Starting work on target $TARGET" | tee -a build.log
echo -e "\n\n\nmake GLUON_TARGET=$TARGET GLUON_BRANCH=stable GLUON_RELEASE=$VERSION update" >> build.log
make GLUON_TARGET=$TARGET GLUON_BRANCH=stable GLUON_RELEASE=$VERSION update >> build.log 2>&1
echo -e "\n\n\nmake GLUON_TARGET=$TARGET GLUON_BRANCH=stable GLUON_RELEASE=$VERSION clean" >> build.log
make GLUON_TARGET=$TARGET GLUON_BRANCH=stable GLUON_RELEASE=$VERSION clean >> build.log 2>&1
echo -e "\n\n\nmake GLUON_TARGET=$TARGET GLUON_BRANCH=stable GLUON_RELEASE=$VERSION V=s $BROKEN $CORES" >> build.log
make GLUON_TARGET=$TARGET GLUON_BRANCH=stable GLUON_RELEASE=$VERSION V=s $BROKEN $CORES >> build.log 2>&1
echo -e "\n\n\n============================================================\n\n" >> build.log
fi
for TARGET in $TARGETS; do
date >> build.log
echo "Starting work on target $TARGET $DEVICES" | tee -a build.log
OPTIONS="GLUON_TARGET=$TARGET $BROKEN $CORES GLUON_BRANCH=$BRANCH GLUON_RELEASE=$VERSION"
echo -e "\n===========\n\n\n\n\nmake $OPTIONS update" >> build.log
time make $OPTIONS update >> build.log 2>&1
if [ $MAKE_CLEAN = 1 ]; then
echo -e "\n===========\n\n\n\n\nmake $OPTIONS clean" >> build.log
time make $OPTIONS clean >> build.log 2>&1
fi
echo -e "\n===========\n\n\n\n\nmake $OPTIONS $DEVICES $VERBOSE" >> build.log
time make $OPTIONS $DEVICES $VERBOSE >> build.log 2>&1
echo -e "\n\n\n============================================================\n\n" >> build.log
done
date >> build.log

echo "Compilation complete, creating manifest(s)" | tee -a build.log

echo -e "make GLUON_BRANCH=experimental manifest" >> build.log
make GLUON_BRANCH=experimental manifest >> build.log 2>&1
echo -e "\n\n\n============================================================\n\n" >> build.log

if [[ "$BRANCH" == "beta" ]] || [[ "$BRANCH" == "stable" ]]
then
echo -e "make GLUON_BRANCH=beta manifest" >> build.log
make GLUON_BRANCH=beta manifest >> build.log 2>&1
echo -e "\n\n\n============================================================\n\n" >> build.log
set +e
#lede: MANIFEST_OPTINS="GLUON_RELEASE=$VERSION $BROKEN $CORES"
MANIFEST_OPTINS="$BROKEN $CORES"
if [[ true ]]; then
B="nightly"
echo -e "make $MANIFEST_OPTINS GLUON_BRANCH=$B manifest" >> build.log
make $MANIFEST_OPTINS GLUON_BRANCH=$B manifest >> build.log 2>&1
echo -e "\n\n\n============================================================\n\n" >> build.log
fi

if [[ "$BRANCH" == "stable" ]]
then
echo -e "make GLUON_BRANCH=stable manifest" >> build.log
make GLUON_BRANCH=stable manifest >> build.log 2>&1
echo -e "\n\n\n============================================================\n\n" >> build.log
if [[ "$BRANCH" == "stable" ]]; then
B="stable"
echo -e "make $MANIFEST_OPTINS GLUON_BRANCH=$B manifest" >> build.log
make $MANIFEST_OPTINS GLUON_BRANCH=$B manifest >> build.log 2>&1
echo -e "\n\n\n============================================================\n\n" >> build.log
fi

echo "Manifest creation complete, signing manifest"

echo -e "contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/experimental.manifest" >> build.log
contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/experimental.manifest >> build.log 2>&1
echo -e "contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/nightly.manifest" >> build.log
contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/nightly.manifest >> build.log 2>&1

if [[ "$BRANCH" == "beta" ]] || [[ "$BRANCH" == "stable" ]]
then
echo -e "contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/beta.manifest" >> build.log
contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/beta.manifest >> build.log 2>&1
if [[ "$BRANCH" == "nightly" ]] || [[ "$BRANCH" == "stable" ]]; then
echo -e "contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/nightly.manifest" >> build.log
contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/nightly.manifest >> build.log 2>&1
# set date to before 04:00
sed -e 's/DATE=.*/DATE='$(date '+%y-%m-%d')' 00:00:00+02:00/g' output/images/sysupgrade/nightly.manifest
fi

if [[ "$BRANCH" == "stable" ]]
then
echo -e "contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/stable.manifest" >> build.log
contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/stable.manifest >> build.log 2>&1
if [[ "$BRANCH" == "stable" ]]; then
echo -e "contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/stable.manifest" >> build.log
contrib/sign.sh $SIGNING_KEY output/images/sysupgrade/stable.manifest >> build.log 2>&1
fi
cd site
date >> ../build.log
Expand Down
14 changes: 10 additions & 4 deletions modules
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,28 @@
# when building gluon.

# for each feed name given, add the corresponding PACKAGES_* lines
GLUON_SITE_FEEDS='ffki ffhh roamguide eulenfunk'
GLUON_SITE_FEEDS='ffki ffhh roamguide eulenfunk ssidchanger button'

# the git repository from where to clone the package feed
PACKAGES_FFKI_REPO=git://github.com/freifunk-kiel/ffki-packages.git
PACKAGES_FFHH_REPO=git://github.com/freifunkhamburg/ffhh-packages.git
PACKAGES_ROAMGUIDE_REPO=https://github.com/sargon/roamguide.git
PACKAGES_EULENFUNK_REPO=https://github.com/Freifunk-Nord/eulenfunk-packages
PACKAGES_SSIDCHANGER_REPO=https://github.com/freifunk-nord/gluon-ssid-changer.git
PACKAGES_BUTTON_REPO=https://github.com/rubo77/ffm-packages

# the version/commit of the git repository to clone
PACKAGES_FFKI_COMMIT=5ba5aaf73aab4937978ad98150518e0d1f32d611
PACKAGES_FFKI_COMMIT=187e200c25fa1497269a3d4daa8d7b4bf6d34c47
PACKAGES_FFHH_COMMIT=c9d083f52384c2a52c303924de3960705c7c945b
PACKAGES_ROAMGUIDE_COMMIT=859cf67417c14ae37e3e8201f438df315651adf9
PACKAGES_EULENFUNK_COMMIT=4feafee7953b37baade82628b75f369ebc28150c
PACKAGES_EULENFUNK_COMMIT=7d8ed92ca9501410d14f8036e7bbd9f56e638fca
PACKAGES_SSIDCHANGER_COMMIT=a555c5730ceaf4ba6f86123f9cbc34e4007be23f
PACKAGES_BUTTON_COMMIT=dc6c431b4e015791517f50d7f3eeaeb0778455b4

# the branch to check out
PACKAGES_FFKI_BRANCH=master
PACKAGES_FFHH_BRANCH=master
PACKAGES_ROAMGUIDE_BRANCH=master
PACKAGES_EULENFUNK_BRANCH=v2016.2
PACKAGES_EULENFUNK_BRANCH=v2016.2.x
PACKAGES_SSIDCHANGER_BRANCH=master
PACKAGES_BUTTON_BRANCH=master
16 changes: 16 additions & 0 deletions site.conf
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,20 @@
},
},
},

ssid_changer = {
enabled = true,
switch_timeframe = 1440, -- only once every timeframe (in minutes) the SSID will change to OFFLINE
-- set to 1440 to change once a day
-- set to 1 minute to change every time the router gets offline
first = 5, -- the first few minutes directly after reboot within which an Offline-SSID always may be activated (must be <= switch_timeframe)
prefix = 'FF_Offline_', -- use something short to leave space for the nodename (no '~' allowed!)
suffix = 'nodename', -- generate the SSID with either 'nodename', 'mac' or to use only the prefix: 'none'

tq_limit_enabled = false, -- if false, the offline SSID will only be set if there is no gateway reacheable
-- upper and lower limit to turn the offline_ssid on and off
-- in-between these two values the SSID will never be changed to prevent it from toggeling every minute.
tq_limit_max = 45, -- upper limit, above that the online SSID will be used
tq_limit_min = 35 -- lower limit, below that the offline SSID will be used
},
}
20 changes: 18 additions & 2 deletions site.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,23 @@ GLUON_SITE_PACKAGES += \
# from eulenfunk-packages (branch aus Nord):
GLUON_SITE_PACKAGES += \
gluon-quickfix
# from https://github.com/Freifunk-Nord/gluon-ssid-changer:
GLUON_SITE_PACKAGES += \
gluon-ssid-changer
# from ffki-packages:
GLUON_SITE_PACKAGES += \
gluon-config-mode-hostname-no-pretty \
gluon-config-mode-contact-info-anonymous-hint \
gluon-config-mode-ppa
# from ffm-packages
#GLUON_SITE_PACKAGES += \
# ffffm-button-bind
# better at the bottom for only some models

# Always call `make` from the command line with the desired release version!
# otherwise this is generated:
DEFAULT_GLUON_RELEASE := 2016.2.6.2
#DEFAULT_GLUON_RELEASE := 2016.2.6.1~rc$(shell date '+%y%m%d%H%M')
DEFAULT_GLUON_RELEASE := 2016.2.7
#DEFAULT_GLUON_RELEASE := 2016.2.7~ngly$(shell date '+%y%m%d%H%M')


# Allow overriding the release number from the command line
Expand Down Expand Up @@ -167,3 +174,12 @@ endif
ifeq ($(GLUON_TARGET),mpc85xx-generic)
GLUON_TLWDR4900_SITE_PACKAGES := $(USB_PACKAGES_BASIC) $(USB_PACKAGES_STORAGE)
endif

# from ffm-packages
ifeq ($(GLUON_TARGET),ar71xx-generic)
GLUON_TLWR1043_SITE_PACKAGES += ffffm-button-bind
GLUON_TLWR740_SITE_PACKAGES += ffffm-button-bind
GLUON_TLWR741_SITE_PACKAGES += ffffm-button-bind
GLUON_TLWR841_SITE_PACKAGES += ffffm-button-bind
GLUON_TLWR842_SITE_PACKAGES += ffffm-button-bind
endif

0 comments on commit 9dfed4a

Please sign in to comment.