diff mbox

[OpenWrt-Devel,1/2] image.mk: make ubinize.cfg optional

Message ID 20141225191146.GA16090@makrotopia.org
State Accepted
Delegated to: John Crispin
Headers show

Commit Message

Daniel Golle Dec. 25, 2014, 7:11 p.m. UTC
When using UbinizeImage with ubifs rootfs, ubinize.cfg is no longer
needed. Yet, the absance of ubinize.cfg would make the build process
abort with an error.
Fix that by checking if ubinize.cfg is present and do no not call the
"classic" ubinize image generation if it isn't.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
[missing new-line before UbinizeImage added itentionally]
---
 include/image.mk | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/include/image.mk b/include/image.mk
index 12322bd..5456839 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -147,6 +147,7 @@  ifneq ($(CONFIG_NAND_SUPPORT),)
 	(cd "$(KDIR_TMP)"; $(TAR) cvf \
 		"$(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2)-sysupgrade.tar" sysupgrade-$(1))
    endef
+
 # $(1) board name
 # $(2) ubinize-image options (e.g. --uboot-env and/or --kernel kernelimage)
 # $(3) rootfstype (e.g. squashfs or ubifs)
@@ -194,10 +195,10 @@  ifneq ($(CONFIG_TARGET_ROOTFS_UBIFS),)
 	$(call Image/Build,ubifs)
 
         ifneq ($($(PROFILE)_UBI_OPTS)$(UBI_OPTS),)
-		$(call Image/mkfs/ubifs/generate,)
+		$(if $(wildcard ./ubinize.cfg),$(call Image/mkfs/ubifs/generate,))
 		$(if $(wildcard ./ubinize-overlay.cfg),$(call Image/mkfs/ubifs/generate,-overlay))
         endif
-	$(call Image/Build,ubi)
+	$(if $(wildcard ./ubinize.cfg),$(call Image/Build,ubi))
     endef
 endif