Преглед изворни кода

Adds handling of an PRIORITY environment variable in the build process.

Signed-off-by: Stefan Laudemann <thisco@webcake.de>
Stefan Laudemann пре 9 година
родитељ
комит
f9f551c971
2 измењених фајлова са 4 додато и 1 уклоњено
  1. 1 0
      ReadMe.md
  2. 3 1
      build.sh

+ 1 - 0
ReadMe.md

@@ -20,6 +20,7 @@ Rufe `build.sh` auf und übergebe folgende Umgebungsvariablen:
 * **BROKEN** falls "1", erzeuge ebenfalls Firmware-Images für ungetestete Plattformen (default: "0")
 * **MAKEJOBS** spezifiziert die Anzahl der parallel laufenden Compiler-Prozesse (falls nicht angegeben, wird ein Prozess pro CPU/Kern gestartet)
 * **TARGET** ein Liste durch Leerzeichen separierter Hardware-Zielplattformen (falls nicht angegeben, werden Images für alle bekannten Plattformen erzeugt)
+* **PRIORITY** spezifiziert die maximale Anzahl an Tagen, die ein Knoten das Einspielen des Updates verzögern darf
 
 ```bash
 # Baut eine testing-Firmware auf Basis von Gluon 2014.4

+ 3 - 1
build.sh

@@ -12,6 +12,7 @@
 # BROKEN    = 0 (default) or 1, build the untested hardware model firmwares, too
 # MAKEJOBS  = number of compiler processes running in parallel (default: number of CPUs/Cores)
 # TARGETS   = a space separated list of target platforms (if unset, all platforms will be build)
+# PRIORITY  = determines the number of day a rollout phase should last at most
 #
 
 function get_all_supported_platforms()
@@ -126,6 +127,7 @@ progress "Building the firmware - please stand by!"
 [ -n "${BROKEN}" ] || BROKEN=0
 [ -n "${MAKEJOBS}" ] || MAKEJOBS=$(grep -c "^processor" /proc/cpuinfo)
 [ -n "${TARGETS}" ] || TARGETS=$(get_all_supported_platforms "./targets")
+[ -n "${PRIORITY}" ] || PRIORITY=0
 
 if [ "${BRANCH}" == "experimental" -a -z "${VERSION}" ] ; then
     default_release_pattern=$( awk -F" := " '/^DEFAULT_GLUON_RELEASE/ { gsub("shell ", "", $2); print $2; }' ./site/site.mk )
@@ -176,7 +178,7 @@ done
 frankenmerge_manifest_file="./images/sysupgrade/${BRANCH}.manifest"
 echo "BRANCH=${BRANCH}" > ${frankenmerge_manifest_file}
 echo "DATE=${BUILD_TS}$(date +%:z)" >> ${frankenmerge_manifest_file}
-echo "PRIORITY=0" >> ${frankenmerge_manifest_file}
+echo "PRIORITY=${PRIORITY}" >> ${frankenmerge_manifest_file}
 echo "" >> ${frankenmerge_manifest_file}
 grep -hE "*.bin$" ./images/sysupgrade/*.${BRANCH}.manifest | sort >> ${frankenmerge_manifest_file}
 popd