aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/image-commands.mk6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/image-commands.mk b/include/image-commands.mk
index 9281b91990..8ed705a7f4 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -269,8 +269,10 @@ define Build/xor-image
endef
define Build/check-size
- @[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(if $(1),$(1),$(IMAGE_SIZE)))))) -ge "$$(stat -c%s $@)" ] || { \
- echo "WARNING: Image file $@ is too big" >&2; \
+ @imagesize="$$(stat -c%s $@)"; \
+ limitsize="$$(($(subst k,* 1024,$(subst m, * 1024k,$(if $(1),$(1),$(IMAGE_SIZE))))))"; \
+ [ $$limitsize -ge $$imagesize ] || { \
+ echo "WARNING: Image file $@ is too big: $$imagesize > $$limitsize" >&2; \
rm -f $@; \
}
endef