diff --git a/Makefile b/Makefile index 671ed5bfa5bcac9621e76c90e9587578c226b9a6..52d4a58166315e5b41b63d6e81648381fdd1464f 100644 --- a/Makefile +++ b/Makefile @@ -493,8 +493,10 @@ image_mount_if : $(IMAGE_PART_FILE) [ "$$(findmnt --target "$(IMAGE_DIR)" -f -n --output=target)" = "$(IMAGE_DIR)" ] \ || mount "$(IMAGE_PART_FILE)" "$(IMAGE_DIR)" -image_umount : - umount -d "$(IMAGE_DIR)" +image_umount_if : + #if something is mounted then umount + [ "$$(findmnt --target "$(IMAGE_DIR)" -f -n --output=target)" != "$(IMAGE_DIR)" ] \ + || umount -d "$(IMAGE_DIR)" image : image_content $(GRUB_ASSEMBLE_DIR)/mbr.img