summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xREADME.md4
-rwxr-xr-xbuild.sh5
2 files changed, 8 insertions, 1 deletions
diff --git a/README.md b/README.md
index c0ff51c..e74aad1 100755
--- a/README.md
+++ b/README.md
@@ -89,6 +89,10 @@ The following environment variables are supported:
Setting to `1` will enable ssh server for remote log in. Note that if you are using a common password such as the defaults there is a high risk of attackers taking over you RaspberryPi.
+ * `STAGE_LIST` (Default: `stage*`)
+
+ 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. An absolute or relative path can be given for stages outside the pi-gen directory.
+
A simple example for building Raspbian:
```bash
diff --git a/build.sh b/build.sh
index c44e6db..c8bca0d 100755
--- a/build.sh
+++ b/build.sh
@@ -195,7 +195,10 @@ dependencies_check "${BASE_DIR}/depends"
mkdir -p "${WORK_DIR}"
log "Begin ${BASE_DIR}"
-for STAGE_DIR in "${BASE_DIR}/stage"*; do
+STAGE_LIST=${STAGE_LIST:-${BASE_DIR}/stage*}
+
+for STAGE_DIR_ in $STAGE_LIST; do
+ STAGE_DIR=`realpath "${STAGE_DIR_}"`
run_stage
done