From fb30dccf7aec5794fed98fd6b51d997e91f268e7 Mon Sep 17 00:00:00 2001 From: Aiden McClelland Date: Fri, 15 Nov 2024 11:52:09 -0700 Subject: [PATCH] bail on failure --- build/lib/scripts/chroot-and-upgrade | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build/lib/scripts/chroot-and-upgrade b/build/lib/scripts/chroot-and-upgrade index 9e8b3ce449..8c3da37b43 100755 --- a/build/lib/scripts/chroot-and-upgrade +++ b/build/lib/scripts/chroot-and-upgrade @@ -87,7 +87,12 @@ if [ "$CHROOT_RES" -eq 0 ]; then echo 'Upgrading...' - time mksquashfs /media/startos/next /media/startos/images/next.squashfs -b 4096 -comp gzip + if ! time mksquashfs /media/startos/next /media/startos/images/next.squashfs -b 4096 -comp gzip; then + umount -R /media/startos/next + umount -R /media/startos/upper + rm -rf /media/startos/upper /media/startos/next + exit 1 + fi hash=$(b3sum /media/startos/images/next.squashfs | head -c 32) mv /media/startos/images/next.squashfs /media/startos/images/${hash}.rootfs ln -rsf /media/startos/images/${hash}.rootfs /media/startos/config/current.rootfs