|
@@ -13,16 +13,16 @@
|
|
|
# BROKEN = 0 (default) or 1, build the untested hardware model firmwares, too
|
|
|
# BUILD_TS = build timestamp (format: %Y-%m-%d %H:%M:%S)
|
|
|
# DIRCLEAN = 1 perform "make dirclean" before build (BRANCH==stable/testing) or 0 perform "make clean" (BRANCH==experimental)
|
|
|
+# FAKETIME_LIB = path to libfaketime.so.1 if it is not in the standard location
|
|
|
+# KEY_DIR = specify directory for gluon-opkg-key
|
|
|
# MAKEJOBS = number of compiler processes running in parallel (default: number of CPUs/Cores)
|
|
|
+# NO_FAKETIME = 0 (default) or 1, disables the use of Faketime
|
|
|
# PRIORITY = determines the number of day a rollout phase should last at most
|
|
|
# SITE_ID = specific site repository commit-id (leave blank to use HEAD)
|
|
|
# SITE_REPO_FETCH_METHOD = http, everything except "git" will use the HTTP method for fetchting site repo
|
|
|
# TARGETS = a space separated list of target platforms (if unset, all platforms will be build)
|
|
|
# VERBOSE = 0 (default) or 1, call the make commands with 'V=s' to see actual errors better
|
|
|
#
|
|
|
-# expert/special usecase only (optional):
|
|
|
-# FAKETIME_LIB = path to libfaketime.so.1 if it is not in the standard location
|
|
|
-# NO_FAKETIME = 0 (default) or 1, disables the use of Faketime
|
|
|
|
|
|
|
|
|
### includes
|
|
@@ -31,7 +31,9 @@
|
|
|
### static variables
|
|
|
MY_DIR=$(dirname $0)
|
|
|
MY_DIR=$(readlink -f "${MY_DIR}")
|
|
|
+DEFAULT_KEY_DIR="${MY_DIR}/opkg-keys"
|
|
|
CODE_DIR="${MY_DIR}/src"
|
|
|
+GLUON_BUILD_DIR="${CODE_DIR}/build"
|
|
|
SITE_DIR="${CODE_DIR}/site"
|
|
|
PATCH_DIR="${SITE_DIR}/patches"
|
|
|
OUTPUT_DIR="${MY_DIR}/output"
|
|
@@ -72,6 +74,14 @@ if [ -z "${DIRCLEAN}" ]; then
|
|
|
fi
|
|
|
fi
|
|
|
|
|
|
+if [ -n "${KEY_DIR}" ]; then
|
|
|
+ KEY_DIR=$(readlink -f "${KEY_DIR}")
|
|
|
+else
|
|
|
+ KEY_DIR="${DEFAULT_KEY_DIR}"
|
|
|
+fi
|
|
|
+[ -e "${KEY_DIR}" ] || mkdir -p ${KEY_DIR}
|
|
|
+[ "$?" -eq "0" ] || abort "Unable to create output directory: ${KEY_DIR}"
|
|
|
+
|
|
|
[ -n "${MAKEJOBS}" ] || MAKEJOBS=$(grep -c "^processor" /proc/cpuinfo)
|
|
|
[ -n "${NO_FAKETIME}" ] || NO_FAKETIME=0
|
|
|
[ -n "${PRIORITY}" ] || PRIORITY=0
|
|
@@ -189,6 +199,15 @@ if [ "${NO_FAKETIME}" -eq "0" ]; then
|
|
|
export FAKETIME="${BUILD_TS}"
|
|
|
fi
|
|
|
|
|
|
+### restore gluon-opkg-key, if already exists
|
|
|
+if [ -e "${KEY_DIR}/gluon-opkg-key" -a -e "${KEY_DIR}/gluon-opkg-key.pub" ]; then
|
|
|
+ info "gluon-opkg-key already exists, restoring it."
|
|
|
+ mkdir -p ${GLUON_BUILD_DIR}/
|
|
|
+ [ "$?" -eq "0" ] || abort "Unable to create directory: ${GLUON_BUILD_DIR}/"
|
|
|
+ cp -f ${KEY_DIR}/gluon-opkg-key* ${GLUON_BUILD_DIR}/
|
|
|
+ [ "$?" -eq "0" ] || abort "Unable to copy gluon-opkg-key."
|
|
|
+fi
|
|
|
+
|
|
|
### BUILD FIRMWARE
|
|
|
progress "Building the firmware - please stand by!"
|
|
|
pushd ${CODE_DIR} > /dev/null
|
|
@@ -258,6 +277,10 @@ popd > /dev/null #${CODE_DIR}
|
|
|
progress "Building a greater and brighter firmware finished successfully. Saving build information at: ${VERSIONS_INFO_DIR}/${VERSION}"
|
|
|
cp -p "${build_info_path}" "${VERSIONS_INFO_DIR}/${VERSION}"
|
|
|
|
|
|
+# Saving a copy of gluon-opkg-key
|
|
|
+[ -e "${KEY_DIR}/gluon-opkg-key" -a -e "${KEY_DIR}/gluon-opkg-key.pub" ] || cp ${GLUON_BUILD_DIR}/gluon-opkg-key* ${KEY_DIR}/
|
|
|
+[ "$?" -eq "0" ] || abort "Failed to save gluon-opkg-key, try to execute 'cp ${GLUON_BUILD_DIR}/gluon-opkg-key* ${KEY_DIR}/' manually"
|
|
|
+
|
|
|
# The end. Finally.
|
|
|
success "We're done, go and enjoy your new firmware in ${OUTPUT_DIR}/${BRANCH}!"
|
|
|
popd > /dev/null #${MY_DIR}
|