Merge "postbuild.sh: add force_version"
diff --git a/support/scripts/postbuild.sh b/support/scripts/postbuild.sh
index 84cc09f..d0a8e94 100755
--- a/support/scripts/postbuild.sh
+++ b/support/scripts/postbuild.sh
@@ -32,8 +32,8 @@
   exit 1;
 fi
 
-version="${PLATFORM_PREFIX}$(support/scripts/version.sh)"
-echo -n "$version" >"$TARGET_DIR/etc/version" 2>/dev/null
+version=$(support/scripts/version.sh "$TARGET_DIR/..")
+echo -n "$PLATFORM_PREFIX$version" >"$TARGET_DIR/etc/version" 2>/dev/null
 echo -n "fiberos" >"$TARGET_DIR/etc/os" 2>/dev/null
 
 if [ "$PROD" != "y" ]; then
diff --git a/support/scripts/version.sh b/support/scripts/version.sh
index 582d638..a28e57e 100755
--- a/support/scripts/version.sh
+++ b/support/scripts/version.sh
@@ -2,6 +2,12 @@
 # Returns current version being built, without leading platform string
 # For ex. "-48-pre1-test-rel-739-gf1d6349"
 
+OUTPUT_DIR="$1"
+if [ -n "$OUTPUT_DIR" -a -r "$OUTPUT_DIR/force_version" ]; then
+  echo -n "-" && cat "$OUTPUT_DIR/force_version"
+  exit
+fi
+
 if support/scripts/is-repo.sh; then
   FORALL="repo forall -c"
 elif support/scripts/is-git.sh; then