image: use check-size from new image build code
authorMathias Kresin <dev@kresin.me>
Tue, 13 Sep 2016 05:18:10 +0000 (07:18 +0200)
committerMathias Kresin <dev@kresin.me>
Tue, 13 Sep 2016 17:36:41 +0000 (19:36 +0200)
Use the new image build code and deduplicate the code.

Signed-off-by: Mathias Kresin <dev@kresin.me>
include/image.mk

index 324582a5d4a5d710d833201f6a187cc91b6cc1fe..261f0f8aeaa1e88d8e5c9aad6a8f673ff1d6a79f 100644 (file)
@@ -422,13 +422,6 @@ define Device/Build/initramfs
 endef
 endif
 
-define Device/Build/check_size
-       @[ $$(($(subst k,* 1024,$(subst m, * 1024k,$(1))))) -ge "$$(stat -c%s $@)" ] || { \
-               echo "WARNING: Image file $@ is too big" >&2; \
-               rm -f $@; \
-       }
-endef
-
 define Device/Build/compile
   $$(_COMPILE_TARGET): $(KDIR)/$(1)
   $(eval $(call Device/Export,$(KDIR)/$(1)))
@@ -450,7 +443,7 @@ define Device/Build/kernel
     $$(KDIR_KERNEL_IMAGE): $(KDIR)/$$(KERNEL_NAME) $(CURDIR)/Makefile $$(KERNEL_DEPENDS)
        @rm -f $$@
        $$(call concat_cmd,$$(KERNEL))
-       $$(if $$(KERNEL_SIZE),$$(call Device/Build/check_size,$$(KERNEL_SIZE)))
+       $$(if $$(KERNEL_SIZE),$$(call Build/check-size,$$(KERNEL_SIZE)))
   endif
 endef