Skip to content

Commit

Permalink
image-commands.mk: Use ERROR_MESSAGE for imagesize fails
Browse files Browse the repository at this point in the history
If a image is bigger than the device can handle, an error message is
printed. This is usually silenced and silently ignored, making it harder
to debug. While it's possible to run the build in verbose mode (via
`make V=s`) and grep for *is too big*, it's more intuitive to print the
error message directly. For that use the newly unlocked `$(call
ERROR_MESSAGE,...)` definition which now also print in non-verbose mode.

Fixes: FS#50 (aka openwrt#7604)

Signed-off-by: Paul Spooren <mail@aparcar.org>
  • Loading branch information
aparcar committed Feb 28, 2022
1 parent 5ba7383 commit f928c44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/image-commands.mk
Expand Up @@ -191,7 +191,7 @@ define Build/check-size
@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; \
$(call ERROR_MESSAGE, WARNING: Image file $@ is too big: $$imagesize > $$limitsize); \
rm -f $@; \
}
endef
Expand Down

0 comments on commit f928c44

Please sign in to comment.