[OpenWrt-Devel,v2,1/3] x86: image: cleanup before creating image
diff mbox series

Message ID 20190718133135.6474-2-tomek_n@o2.pl
State New
Headers show
Series
  • x86: upgrade bootloader on sysupgrade
Related show

Commit Message

Tomasz Maciej Nowak July 18, 2019, 1:31 p.m. UTC
There can be some leftovers from other image recipes, if the same
directory names are used and multiply image types are selected.
Therefore remove directories used in the recipe, before contents for the
image are prepared.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
---
 target/linux/x86/image/Makefile | 2 ++
 1 file changed, 2 insertions(+)

Patch
diff mbox series

diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
index 24825f2ba2..9648f8c61e 100644
--- a/target/linux/x86/image/Makefile
+++ b/target/linux/x86/image/Makefile
@@ -61,6 +61,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 \
@@ -94,6 +95,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 \