summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSerge Schneider <serge@raspberrypi.com>2021-06-22 15:48:09 +0100
committerSerge Schneider <serge@raspberrypi.com>2021-06-22 15:48:09 +0100
commitf9d44edb72e9a153c997266189c79cb1f96b69f3 (patch)
treec302d3f9cea4f07084ab0bff863bfaed985ceba0 /scripts
parentd562f2a35b8917cacab9a461626becbce424b652 (diff)
Copy debootstrap.log on failure
Diffstat (limited to 'scripts')
-rw-r--r--scripts/common6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/common b/scripts/common
index e2048d9..300d30b 100644
--- a/scripts/common
+++ b/scripts/common
@@ -21,8 +21,10 @@ bootstrap(){
setarch linux32 capsh --drop=cap_setfcap -- -c "'${BOOTSTRAP_CMD}' $BOOTSTRAP_STR" || true
- if [ -d "$2/debootstrap" ]; then
- rmdir "$2/debootstrap"
+ if [ -d "$2/debootstrap" ] && ! rmdir "$2/debootstrap"; then
+ cp "$2/debootstrap/debootstrap.log" "${STAGE_WORK_DIR}"
+ log "bootstrap failed: please check ${STAGE_WORK_DIR}/debootstrap.log"
+ return 1
fi
}
export -f bootstrap