summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorSerge Schneider <serge@raspberrypi.org>2016-05-05 19:39:43 +0100
committerSerge Schneider <serge@raspberrypi.org>2016-05-05 19:39:43 +0100
commit19a1b94d2a34b795e570f25708fa0ae45bcbbf38 (patch)
tree58e3a6a8728e6ee072f45a7cfa9a27138a81a33c /build.sh
parentace01f2fc7c89cb07b1b642d359a7642f2f44f56 (diff)
parentde878cc21718bade5d7dbd19d8cdfebc0176c155 (diff)
Merge branch 'base' into dev
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh33
1 files changed, 23 insertions, 10 deletions
diff --git a/build.sh b/build.sh
index e3f7a6e..9a889f2 100755
--- a/build.sh
+++ b/build.sh
@@ -43,11 +43,12 @@ EOF
fi
QUILT_PATCHES=${SUB_STAGE_DIR}/${i}-patches
mkdir -p ${i}-pc
- ln -sf .pc ${i}-pc
+ ln -sf ${i}-pc .pc
if [ -e ${SUB_STAGE_DIR}/${i}-patches/EDIT ]; then
echo "Dropping into bash to edit patches..."
bash
fi
+ quilt upgrade
RC=0
quilt push -a || RC=$?
case "$RC" in
@@ -77,10 +78,14 @@ EOF
run_stage(){
log "Begin ${STAGE_DIR}"
+ STAGE=$(basename ${STAGE_DIR})
pushd ${STAGE_DIR} > /dev/null
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}"
+ fi
if [ ! -f SKIP ]; then
if [ "${CLEAN}" = "1" ]; then
if [ -d ${ROOTFS_DIR} ]; then
@@ -93,7 +98,8 @@ run_stage(){
log "End ${STAGE_DIR}/prerun.sh"
fi
for SUB_STAGE_DIR in ${STAGE_DIR}/*; do
- if [ -d ${SUB_STAGE_DIR} ]; then
+ if [ -d ${SUB_STAGE_DIR} ] &&
+ [ ! -f ${SUB_STAGE_DIR}/SKIP ]; then
run_sub_stage
fi
done
@@ -125,6 +131,7 @@ export IMG_DATE=${IMG_DATE:-"$(date -u +%Y-%m-%d)"}
export BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export SCRIPT_DIR="${BASE_DIR}/scripts"
export WORK_DIR="${BASE_DIR}/work/${IMG_DATE}-${IMG_NAME}"
+export DEPLOY_DIR="${BASE_DIR}/deploy"
export LOG_FILE="${WORK_DIR}/build.log"
export CLEAN
@@ -132,11 +139,15 @@ export IMG_NAME
export APT_PROXY
export STAGE
-export PREV_STAGE
export STAGE_DIR
+export STAGE_WORK_DIR
+export PREV_STAGE
export PREV_STAGE_DIR
export ROOTFS_DIR
export PREV_ROOTFS_DIR
+export IMG_SUFFIX
+export EXPORT_DIR
+export EXPORT_ROOTFS_DIR
export QUILT_PATCHES
export QUILT_NO_DIFF_INDEX=1
@@ -144,18 +155,20 @@ export QUILT_NO_DIFF_TIMESTAMPS=1
export QUILT_REFRESH_ARGS="-p ab"
source ${SCRIPT_DIR}/common
-export -f log
-export -f bootstrap
-export -f unmount
-export -f on_chroot
-export -f copy_previous
-export -f update_issue
mkdir -p ${WORK_DIR}
log "Begin ${BASE_DIR}"
for STAGE_DIR in ${BASE_DIR}/stage*; do
- STAGE=$(basename ${STAGE_DIR})
+ run_stage
+done
+
+STAGE_DIR=${BASE_DIR}/export-image
+
+CLEAN=1
+for EXPORT_DIR in ${EXPORT_DIRS}; do
+ IMG_SUFFIX=$(cat ${EXPORT_DIR}/EXPORT_IMAGE)
+ EXPORT_ROOTFS_DIR=${WORK_DIR}/$(basename ${EXPORT_DIR})/rootfs
run_stage
done