diff options
| author | Louis Matthijssen <louis@u5r.nl> | 2019-01-30 19:09:36 +0100 |
|---|---|---|
| committer | XECDesign <XECDesign@users.noreply.github.com> | 2019-01-30 19:05:22 +0000 |
| commit | 61a994c88ceb4a9ded0aca5eeedbe56c801b5acd (patch) | |
| tree | e709f31bebd0c3389a2189b2dc696389699cc515 | |
| parent | d945d422d4e26df6fff7185da28874432a974d78 (diff) | |
Add a DEPLOY_ZIP setting
| -rwxr-xr-x | README.md | 4 | ||||
| -rwxr-xr-x | build.sh | 1 | ||||
| -rwxr-xr-x | export-image/04-finalise/01-run.sh | 15 |
3 files changed, 15 insertions, 5 deletions
@@ -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 @@ -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" |
