From 066eb03d52868290661e813738a9a66eda263aa9 Mon Sep 17 00:00:00 2001 From: Ben Pirt Date: Wed, 3 Jan 2018 12:48:31 +0000 Subject: [PATCH] Allow image building to be skipped for stages (#137) --- .gitignore | 1 + README.md | 6 +++--- build.sh | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 9f385f6..a6883c2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ work/* config postrun.sh SKIP +SKIP_IMAGES .pc *-pc apt-cacher-ng/ diff --git a/README.md b/README.md index 7a73c77..1e2453b 100755 --- a/README.md +++ b/README.md @@ -228,14 +228,14 @@ replace with your own contents in the same format. If you're working on a specific stage the recommended development process is as follows: - * Remove the EXPORT_IMAGE and EXPORT_NOOBS files until you're ready to actually - generate an image + * Add a file called SKIP_IMAGES into the directories containing EXPORT_* files + (currently stage2, stage4 and stage5) * Add SKIP files to the stages you don't want to build. For example, if you're basing your image on the lite image you would add these to stages 3, 4 and 5. * Run build.sh to build all stages * Add SKIP files to the earlier successfully built stages * Modify the last stage * Rebuild just the last stage using ```sudo CLEAN=1 ./build.sh``` - * Once you're happy with the image you can add the EXPORT files back in and + * Once you're happy with the image you can remove the SKIP_IMAGES files and export your image to test diff --git a/build.sh b/build.sh index 8b3c82e..d72d4f5 100755 --- a/build.sh +++ b/build.sh @@ -85,8 +85,10 @@ run_stage(){ unmount ${WORK_DIR}/${STAGE} STAGE_WORK_DIR=${WORK_DIR}/${STAGE} ROOTFS_DIR=${STAGE_WORK_DIR}/rootfs - if [ -f ${STAGE_DIR}/EXPORT_IMAGE ]; then - EXPORT_DIRS="${EXPORT_DIRS} ${STAGE_DIR}" + if [ ! -f SKIP_IMAGES ]; then + if [ -f ${STAGE_DIR}/EXPORT_IMAGE ]; then + EXPORT_DIRS="${EXPORT_DIRS} ${STAGE_DIR}" + fi fi if [ ! -f SKIP ]; then if [ "${CLEAN}" = "1" ]; then