summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge Schneider <serge@raspberrypi.com>2024-10-29 10:16:06 +0000
committerSerge Schneider <serge@raspberrypi.com>2024-10-29 10:16:06 +0000
commit19fd60cef735784267b2a48ff358291d09909854 (patch)
treee2a97d610ffba7389065b1f07464c7861669040d
parent6453828ccef85f72962fe0baa557b79009da966e (diff)
parentb8e497cf217402283b712af5be91c1384946429d (diff)
Merge branch 'master' into arm64
-rw-r--r--README.md4
-rwxr-xr-xbuild.sh9
2 files changed, 12 insertions, 1 deletions
diff --git a/README.md b/README.md
index 1b87494..8b0e56d 100644
--- a/README.md
+++ b/README.md
@@ -205,6 +205,10 @@ The following environment variables are supported:
If set, then instead of working through the numeric stages in order, this list will be followed. For example setting to `"stage0 stage1 mystage stage2"` will run the contents of `mystage` before stage2. Note that quotes are needed around the list. An absolute or relative path can be given for stages outside the pi-gen directory.
+ * `EXPORT_CONFIG_DIR` (Default: `$BASE_DIR/export-image`)
+
+ If set, use this directory path as the location of scripts to run when generating images. An absolute or relative path can be given for a location outside the pi-gen directory.
+
A simple example for building Raspberry Pi OS:
```bash
diff --git a/build.sh b/build.sh
index 78effd0..dc2697c 100755
--- a/build.sh
+++ b/build.sh
@@ -301,6 +301,13 @@ log "Begin ${BASE_DIR}"
STAGE_LIST=${STAGE_LIST:-${BASE_DIR}/stage*}
export STAGE_LIST
+EXPORT_CONFIG_DIR=$(realpath "${EXPORT_CONFIG_DIR:-"${BASE_DIR}/export-image"}")
+if [ ! -d "${EXPORT_CONFIG_DIR}" ]; then
+ echo "EXPORT_CONFIG_DIR invalid: ${EXPORT_CONFIG_DIR} does not exist"
+ exit 1
+fi
+export EXPORT_CONFIG_DIR
+
for STAGE_DIR in $STAGE_LIST; do
STAGE_DIR=$(realpath "${STAGE_DIR}")
run_stage
@@ -308,7 +315,7 @@ done
CLEAN=1
for EXPORT_DIR in ${EXPORT_DIRS}; do
- STAGE_DIR=${BASE_DIR}/export-image
+ STAGE_DIR=${EXPORT_CONFIG_DIR}
# shellcheck source=/dev/null
source "${EXPORT_DIR}/EXPORT_IMAGE"
EXPORT_ROOTFS_DIR=${WORK_DIR}/$(basename "${EXPORT_DIR}")/rootfs