summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Matthijssen <louis@u5r.nl>2019-01-30 19:09:36 +0100
committerXECDesign <XECDesign@users.noreply.github.com>2019-01-30 19:05:22 +0000
commit61a994c88ceb4a9ded0aca5eeedbe56c801b5acd (patch)
treee709f31bebd0c3389a2189b2dc696389699cc515
parentd945d422d4e26df6fff7185da28874432a974d78 (diff)
Add a DEPLOY_ZIP setting
-rwxr-xr-xREADME.md4
-rwxr-xr-xbuild.sh1
-rwxr-xr-xexport-image/04-finalise/01-run.sh15
3 files changed, 15 insertions, 5 deletions
diff --git a/README.md b/README.md
index da22352..8a4f64a 100755
--- a/README.md
+++ b/README.md
@@ -68,6 +68,10 @@ The following environment variables are supported:
Output directory for target system images and NOOBS bundles.
+ * `DEPLOY_ZIP` (Default: `1`)
+
+ Setting to `0` will deploy the actual image (`.img`) instead of a zipped image (`.zip`).
+
* `USE_QEMU` (Default: `"0"`)
Setting to '1' enables the QEMU mode - creating an image that can be mounted via QEMU for an emulated
diff --git a/build.sh b/build.sh
index 78f2fb5..3e04204 100755
--- a/build.sh
+++ b/build.sh
@@ -151,6 +151,7 @@ BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export SCRIPT_DIR="${BASE_DIR}/scripts"
export WORK_DIR="${WORK_DIR:-"${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}"}"
export DEPLOY_DIR=${DEPLOY_DIR:-"${BASE_DIR}/deploy"}
+export DEPLOY_ZIP="${DEPLOY_ZIP:-1}"
export LOG_FILE="${WORK_DIR}/build.log"
export FIRST_USER_NAME=${FIRST_USER_NAME:-pi}
diff --git a/export-image/04-finalise/01-run.sh b/export-image/04-finalise/01-run.sh
index d4788c7..2a84173 100755
--- a/export-image/04-finalise/01-run.sh
+++ b/export-image/04-finalise/01-run.sh
@@ -75,10 +75,15 @@ unmount_image "${IMG_FILE}"
mkdir -p "${DEPLOY_DIR}"
rm -f "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip"
-
-pushd "${STAGE_WORK_DIR}" > /dev/null
-zip "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip" \
- "$(basename "${IMG_FILE}")"
-popd > /dev/null
+rm -f "${DEPLOY_DIR}/${IMG_FILENAME}${IMG_SUFFIX}.img"
+
+if [ "${DEPLOY_ZIP}" == "1" ]; then
+ pushd "${STAGE_WORK_DIR}" > /dev/null
+ zip "${DEPLOY_DIR}/${ZIP_FILENAME}${IMG_SUFFIX}.zip" \
+ "$(basename "${IMG_FILE}")"
+ popd > /dev/null
+else
+ cp "$IMG_FILE" "$DEPLOY_DIR"
+fi
cp "$INFO_FILE" "$DEPLOY_DIR"