|
@@ -43,6 +43,10 @@ fi
|
|
|
MY_DIR=$(dirname $0)
|
|
|
MY_DIR=$(readlink -f "$MY_DIR")
|
|
|
CODE_DIR="src"
|
|
|
+OUTPUT_DIR="${MY_DIR}/output"
|
|
|
+BUILD_INFO_FILENAME="build-info.txt"
|
|
|
+VERSIONS_INFO_DIR="versions"
|
|
|
+
|
|
|
pushd $MY_DIR > /dev/null
|
|
|
[ "_$BUILD_TS" == "_" ] && export BUILD_TS=$(date +"%Y-%m-%d %H:%M:%S")
|
|
|
|
|
@@ -98,6 +102,19 @@ progress "Preparing the build environment (make update) ..."
|
|
|
make update
|
|
|
[ "$?" -eq "0" ] || abort "Failed to update the build environment, mimimi."
|
|
|
|
|
|
+# we are now ready to produke the firmware images, so let's "save" our state
|
|
|
+build_info_path="${OUTPUT_DIR}/${BRANCH}/${BUILD_INFO_FILENAME}"
|
|
|
+progress "Saving build information to: ${build_info_path}"
|
|
|
+mkdir -p $(dirname ${build_info_path})
|
|
|
+[ "$?" -eq "0" ] || abort "Unable to create output directory: $(dirname ${build_info_path})"
|
|
|
+touch $(dirname ${build_info_path})
|
|
|
+[ "$?" -eq "0" ] || abort "Cannot create build information file: ${build_info_path}"
|
|
|
+echo "VERSION=${VERSION}" >> ${build_info_path}
|
|
|
+echo "GLUON=${GLUON_COMMIT} # ${BASE}" >> ${build_info_path}
|
|
|
+echo "BRANCH=${BRANCH}" >> ${build_info_path}
|
|
|
+echo "SITE=${SITE_COMMIT} # ${VERSION}" >> ${build_info_path}
|
|
|
+echo "TS=${BUILD_TS}" >> ${build_info_path}
|
|
|
+
|
|
|
### BUILD FIRMWARE
|
|
|
progress "Building the firmware - please stand by!"
|
|
|
[ -n "${BROKEN}" ] || BROKEN=0
|
|
@@ -138,16 +155,6 @@ done
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
-# write build info
|
|
|
-progress "Writing build info ..."
|
|
|
-mkdir -p "output/${BRANCH}"
|
|
|
-echo -en "" > "output/${BRANCH}/build_info.txt"
|
|
|
-echo "VERSION=${VERSION}" >> "output/${BRANCH}/build_info.txt"
|
|
|
-echo "GLUON=${GLUON_COMMIT} # ${BASE}" >> "output/${BRANCH}/build_info.txt"
|
|
|
-echo "BRANCH=${BRANCH}" >> "output/${BRANCH}/build_info.txt"
|
|
|
-echo "SITE=${SITE_COMMIT} # ${VERSION}" >> "output/${BRANCH}/build_info.txt"
|
|
|
-echo "TS=${BUILD_TS}" >> "output/${BRANCH}/build_info.txt"
|
|
|
-
|
|
|
# compress all binaries into 7z archive
|
|
|
progress "Assembling images.7z ..."
|
|
|
[ -e "output/${BRANCH}/images.7z" ] && rm "output/${BRANCH}/images.7z"
|
|
@@ -169,10 +176,11 @@ grep -hE "*.bin$" ./images/sysupgrade/*.${BRANCH}.manifest | sort >> ${frankenme
|
|
|
popd
|
|
|
cp "${CODE_DIR}/images/sysupgrade/${BRANCH}.manifest" "output/${BRANCH}/"
|
|
|
|
|
|
-# write (copy) version file
|
|
|
-cp "output/${BRANCH}/build_info.txt" "versions/${VERSION}"
|
|
|
+# Saving a copy of the build info file as reference
|
|
|
+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}"
|
|
|
|
|
|
# The end. Finally.
|
|
|
-success "We're done, go and checkout your new firmware in output/${BRANCH}!"
|
|
|
+success "We're done, go and enjoy your new firmware in ${OUTPUT_DIR}/${BRANCH}!"
|
|
|
popd > /dev/null
|
|
|
|