x86: image: cleanup before creating image
[openwrt/staging/mkresin.git] / target / linux / x86 / image / Makefile
index eb0db417a32aa28192ed9840903b2342a63149fc..2838b3139c139305554242e260cada3205af2482 100644 (file)
@@ -60,6 +60,7 @@ ifneq ($(CONFIG_GRUB_IMAGES),)
 
   define Image/Build/grub2
        # left here because the image builder doesnt need these
+       rm -fR $(KDIR)/root.grub $(KDIR)/grub2
        $(INSTALL_DIR) $(KDIR)/root.grub/boot/grub $(KDIR)/grub2
        $(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz
        grub-mkimage \
@@ -93,6 +94,7 @@ ifneq ($(CONFIG_GRUB_IMAGES),)
 endif
 
 define Image/Build/iso
+       rm -fR $(KDIR)/root.grub $(KDIR)/grub2
        $(INSTALL_DIR) $(KDIR)/root.grub/boot/grub $(KDIR)/grub2
        $(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz
        grub-mkimage \