Browse Source

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

Yi Zhang 4 years ago
parent
commit
649fd9ecc0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib.sh.in

+ 1 - 1
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
 }