diff options
| author | Serge Schneider <serge@raspberrypi.com> | 2021-06-22 15:48:09 +0100 |
|---|---|---|
| committer | Serge Schneider <serge@raspberrypi.com> | 2021-06-22 15:48:09 +0100 |
| commit | f9d44edb72e9a153c997266189c79cb1f96b69f3 (patch) | |
| tree | c302d3f9cea4f07084ab0bff863bfaed985ceba0 /scripts | |
| parent | d562f2a35b8917cacab9a461626becbce424b652 (diff) | |
Copy debootstrap.log on failure
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/common | 6 |
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 |
