From 649fd9ecc0bbf1ea75cdc0b5e6b1a14146bf0dc9 Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Mon, 15 Feb 2021 17:56:26 -0800 Subject: [PATCH] Check QEMU_BIN is not empty for cleanup_chroot, when building for same arch, QEMU_BIN would not be set, the condition fallsback to /usr/bin, which is executable --- lib.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.sh.in b/lib.sh.in index 636d22c..e165d52 100644 --- a/lib.sh.in +++ b/lib.sh.in @@ -136,7 +136,7 @@ cleanup_chroot() { umount_pseudofs # If a QEMU binary was copied in, remove that as well - if [ -x "$ROOTFS/usr/bin/$QEMU_BIN" ] ; then + if [ -n "$QEMU_BIN" ] && [ -x "$ROOTFS/usr/bin/$QEMU_BIN" ] ; then rm "$ROOTFS/usr/bin/$QEMU_BIN" fi }