summaryrefslogtreecommitdiffstats
path: root/include/image-commands.mk
diff options
context:
space:
mode:
Diffstat (limited to 'include/image-commands.mk')
-rw-r--r--include/image-commands.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 7d9f93fed7..41a5e1198a 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -133,6 +133,8 @@ define Build/append-md5sum-ascii-salted
rm $@.salted
endef
+UBI_NAND_SIZE_LIMIT = $(IMAGE_SIZE) - ($(NAND_SIZE)*20/1024 + 4*$(BLOCKSIZE))
+
define Build/append-ubi
sh $(TOPDIR)/scripts/ubinize-image.sh \
$(if $(UBOOTENV_IN_UBI),--uboot-env) \
@@ -146,6 +148,8 @@ define Build/append-ubi
$(UBINIZE_OPTS)
cat $@.tmp >> $@
rm $@.tmp
+ $(if $(and $(IMAGE_SIZE),$(NAND_SIZE)),\
+ $(call Build/check-size,$(UBI_NAND_SIZE_LIMIT)))
endef
define Build/ubinize-kernel