From 3f89fe6df35a64113cd7014442ddbafdd9578820 Mon Sep 17 00:00:00 2001 From: Daniel Frank Date: Sat, 14 Oct 2017 20:06:00 +0200 Subject: [PATCH] bump version to 0.8.5 experimental and some more build system updates --- .gitignore | 6 +---- Makefile | 16 +++++++++--- build.sh | 62 +++++++++++++++++++++++++++++++++++++++++++++ config/defaults.erb | 17 ++++++++++--- template/info.erb | 3 +++ 5 files changed, 92 insertions(+), 12 deletions(-) create mode 100755 build.sh create mode 100644 template/info.erb diff --git a/.gitignore b/.gitignore index e2d3142..5502124 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1 @@ -*~ -/site.conf -/site.mk -/modules -sites/ +info diff --git a/Makefile b/Makefile index 892c020..3d87a6f 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,21 @@ -sites: sites/ffhh sites/ffhh-sued +sites: clean info sites/ffhh sites/ffhh-sued + +info: config/defaults.erb template/info.erb + erb -T- config/defaults.erb template/$@.erb >$@ + +.PHONY: clean +clean: + rm -rf sites + rm -f info sites/%: config/%.erb mkdir -p $@ cd $@ && $(MAKE) -f ../../Makefile site SITE=$(@F) -site: clean site.mk site.conf modules +site: siteclean site.mk site.conf modules -.PHONY: clean -clean: +.PHONY: siteclean +siteclean: rm -f site.mk site.conf modules modules: diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..ae18bbc --- /dev/null +++ b/build.sh @@ -0,0 +1,62 @@ +#!/bin/bash -e + +function announce () { + echo '############################' $* >&2 +} + +proc=$(nproc) + +while getopts g:bj:v opt; do + case "$opt" in + g) gluon_path="$OPTARG" ;; + b) export BROKEN=1 ;; + j) proc="$OPTARG" ;; + v) verbose=V=s ;; + esac +done +if [ -z "${gluon_path}" ]; then + echo "Usage: $0 -g GLUON_PATH" >&2 + echo " GLUON_PATH Path to a checkout of the gluon repository." >&2 + echo " -b BROKEN=1" >&2 + echo " -j JOBS Run build with -jJOBS. Default: ${proc}" >&2 + exit 1 +fi + +gluon_path=$(realpath $gluon_path) +site_path=$(realpath $(dirname $BASH_SOURCE)) + +announce GLUON: $gluon_path >&2 +announce FFHH SITES: $site_path >&2 + +# Build the site repo and generate all site configs +announce Building site repo and reading data >&2 +pushd $site_path > /dev/null +make +. info +export GLUON_RELEASE +export GLUON_BRANCH +# get the available sites... +sites="" +for s in sites/*; do sites="${sites} ${s##*/}"; done +announce Gluon will be built for the following sites:$sites >&2 +announce The following targets will be generated: $targets >&2 +popd >/dev/null + +pushd "${gluon_path}" >/dev/null +announce Starting make update... +for s in $sites; do + export GLUON_SITEDIR="${site_path}/sites/${s}" + export GLUON_OUTPUTDIR="${HOME}/firmware/${s}/${GLUON_BRANCH}/${GLUON_RELEASE}" + export GLUON_IMAGEDIR="${GLUON_OUTPUTDIR}/images" + export GLUON_MODULEDIR="${GLUON_OUTPUTDIR}/modules" + rm -rf "${GLUON_OUTPUTDIR}" + mkdir -p "${GLUON_IMAGEDIR}" "${GLUON_MODULEDIR}" + make update + for t in $targets; do + announce Starting build for $s/$t... >&2 + make -j$(nproc) GLUON_TARGET=$t $verbose + done + announce Building manifest... + make manifest +done +popd >/dev/null diff --git a/config/defaults.erb b/config/defaults.erb index bf7d1f5..6b6bbd0 100644 --- a/config/defaults.erb +++ b/config/defaults.erb @@ -1,7 +1,18 @@ <% -#gluon_release = "0.8.4+exp" + Time.new.strftime("%Y%m%d") -gluon_release = "0.8.4" -gluon_branch = "stable" +#gluon_branch = "stable" +gluon_branch = "experimental" +gluon_release = "0.8.5" + +# Add the +exp and current date if this is an experimental release +gluon_release += "+exp" + Time.new.strftime("%Y%m%d") if gluon_branch == "experimental" + +gluon_targets = %w( + ar71xx-generic + ar71xx-nand + mpc85xx-generic + x86-generic + x86-64 +) gluon_site_packages = %w( gluon-autoupdater diff --git a/template/info.erb b/template/info.erb new file mode 100644 index 0000000..685d4a9 --- /dev/null +++ b/template/info.erb @@ -0,0 +1,3 @@ +GLUON_RELEASE="<%= gluon_release %>" +GLUON_BRANCH="<%= gluon_branch %>" +targets="<%= gluon_targets.join(" ") %>"