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

This commit is contained in:
Yi Zhang 2021-02-15 17:56:26 -08:00 committed by Jürgen Buchmüller
parent ae05e37287
commit 649fd9ecc0

View File

@ -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
}