commit 63b52c3765411fb6bbe2f919f8ccd4cff6f1b9fa parent 7fb0d92b4964c915e5d90bb8007ce5e3cd23bec6 Author: parazyd <parazyd@dyne.org> Date: Sat, 21 Nov 2020 19:51:41 +0100 Use subshell for cleanup, and exit 1 properly. Diffstat:
M | Makefile | | | 10 | +++++----- |
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile @@ -39,11 +39,11 @@ $(IMAGE): $(BINS) $(BOOT_BINS) $(ALPINE_BINS) ch chmod 755 ./ch/qemu-wrapper chmod 755 ./ch/install.sh sudo mount --types proc /proc ./ch/proc - sudo mount --rbind /sys ./ch/sys || sudo umount -R ./ch/proc - sudo mount --make-rslave ./ch/sys || sudo umount -R ./ch/proc ./ch/sys - sudo mount --rbind /dev ./ch/dev || sudo umount -R ./ch/proc ./ch/sys - sudo mount --make-rslave ./ch/dev || sudo umount -R ./ch/proc ./ch/sys ./ch/dev - sudo chroot ./ch /install.sh || sudo umount -R ./ch/proc ./ch/sys ./ch/dev + sudo mount --rbind /sys ./ch/sys || ( sudo umount -R ./ch/proc ; exit 1 ) + sudo mount --make-rslave ./ch/sys || ( sudo umount -R ./ch/proc ./ch/sys ; exit 1 ) + sudo mount --rbind /dev ./ch/dev || ( sudo umount -R ./ch/proc ./ch/sys ; exit 1 ) + sudo mount --make-rslave ./ch/dev || ( sudo umount -R ./ch/proc ./ch/sys ./ch/dev ; exit 1 ) + sudo chroot ./ch /install.sh || ( sudo umount -R ./ch/proc ./ch/sys ./ch/dev ; exit 1 ) sudo umount -R ./ch/proc ./ch/sys ./ch/dev sudo rm -f ./ch/install.sh ./ch/qemu-wrapper ./ch/$(QEMU_ARM) sudo mkdir -p ./ch/boot