diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-01-19 15:13:09 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-01-19 15:13:09 +0000 |
commit | 49515a30482c623708f73ed7abe1ed7bf35d7bca (patch) | |
tree | ebe80a775134d53a93da08e17f2b673c7bdd8298 | |
parent | 399ae5da1438e59fa0685a4688330a2ca503fa51 (diff) | |
download | morph-49515a30482c623708f73ed7abe1ed7bf35d7bca.tar.gz |
Improve error recovery and cleanup the chroot dir at startup
-rwxr-xr-x | baserock-bootstrap | 1 | ||||
-rwxr-xr-x | run-bootstrap-in-chroot | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/baserock-bootstrap b/baserock-bootstrap index 73566c2c..3f76a934 100755 --- a/baserock-bootstrap +++ b/baserock-bootstrap @@ -835,6 +835,7 @@ pass2_build_devel_system_outside_chroot() $HOST_SUDO mkfs -t ext4 "$part" mp="$(mktemp -d)" $HOST_SUDO mount "$part" "$mp" + trap "$HOST_SUDO umount $part; $HOST_SUDO kpartx -dv $img" EXIT for stratum in "$LFS"/baserock/cache/*.stratum.{foundation,linux-stratum,devel} do diff --git a/run-bootstrap-in-chroot b/run-bootstrap-in-chroot index c8fad487..cdef9588 100755 --- a/run-bootstrap-in-chroot +++ b/run-bootstrap-in-chroot @@ -12,6 +12,9 @@ else fi mirror="http://192.168.1.185/debian" +umount "$dir/proc" || true +umount "$dir/sys" || true +rm -rf "$dir" mkdir "$dir" debootstrap \ |