build: image: move IMAGE_SIZE to image.mk
authorSungbo Eo <mans0n@gorani.run>
Mon, 9 Mar 2020 12:14:06 +0000 (21:14 +0900)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 11 Mar 2020 17:25:06 +0000 (18:25 +0100)
IMAGE_SIZE is widely used in many targets. Declare it in the default template to
clean up redundant code. This also prevents deriving IMAGE_SIZE unintentionally
from the previously defined device.

While at it, remove duplicate KERNEL_SIZE declaration.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
include/image.mk
target/linux/apm821xx/image/Makefile
target/linux/ar71xx/image/Makefile
target/linux/ath79/image/Makefile
target/linux/lantiq/image/Makefile
target/linux/ramips/image/Makefile

index fd04d4020bf6ca1d87f9159bf680d0a7d233bccd..2436b94f814e332d782f5b2ed3a32e8dd6cd16f9 100644 (file)
@@ -381,13 +381,13 @@ define Device/Init
   DEVICE_NAME := $(1)
   KERNEL:=
   KERNEL_INITRAMFS = $$(KERNEL)
-  KERNEL_SIZE:=
   CMDLINE:=
 
   IMAGES :=
   ARTIFACTS :=
   IMAGE_PREFIX := $(IMG_PREFIX)-$(1)
   IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2)
+  IMAGE_SIZE :=
   KERNEL_PREFIX = $$(IMAGE_PREFIX)
   KERNEL_SUFFIX := -kernel.bin
   KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX)
@@ -434,8 +434,8 @@ DEFAULT_DEVICE_VARS := \
   CMDLINE UBOOTENV_IN_UBI KERNEL_IN_UBI BLOCKSIZE PAGESIZE SUBPAGESIZE \
   VID_HDR_OFFSET UBINIZE_OPTS UBINIZE_PARTS MKUBIFS_OPTS DEVICE_DTS \
   DEVICE_DTS_CONFIG DEVICE_DTS_DIR SOC BOARD_NAME UIMAGE_NAME SUPPORTED_DEVICES \
-  IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR UBOOT_PATH DEVICE_VENDOR \
-  DEVICE_MODEL DEVICE_VARIANT \
+  IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR UBOOT_PATH IMAGE_SIZE \
+  DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \
   DEVICE_ALT0_VENDOR DEVICE_ALT0_MODEL DEVICE_ALT0_VARIANT \
   DEVICE_ALT1_VENDOR DEVICE_ALT1_MODEL DEVICE_ALT1_VARIANT \
   DEVICE_ALT2_VENDOR DEVICE_ALT2_MODEL DEVICE_ALT2_VARIANT
index 108f63cb7a942aaa314c3b0e01b3ff417d33eb97..1b0bc477a9d41ab4557e396af56bd0a2dd58b84f 100644 (file)
@@ -5,7 +5,7 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
-DEVICE_VARS += IMAGE_SIZE DTB_SIZE
+DEVICE_VARS += DTB_SIZE
 
 define Build/boot-img
        $(RM) -rf $@.bootdir
index 804532b55cb145134acf47accd095bbb24dee059..dea8338dddcc77132fa9f1a64a05fe13e84801bd 100644 (file)
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/image.mk
 
 KERNEL_LOADADDR = 0x80060000
 
-DEVICE_VARS += BOARDNAME CMDLINE CONSOLE IMAGE_SIZE LOADER_TYPE
+DEVICE_VARS += BOARDNAME CMDLINE CONSOLE LOADER_TYPE
 
 ifeq ($(SUBTARGET),generic)
 include ./generic.mk
index a28658ec0bb8bd017d4b280132f119dfee82e3a2..c27db93947fe94edebb4b1047259995ee2318791 100644 (file)
@@ -3,7 +3,7 @@ include $(INCLUDE_DIR)/image.mk
 
 KERNEL_LOADADDR = 0x80060000
 
-DEVICE_VARS += IMAGE_SIZE LOADER_FLASH_OFFS LOADER_TYPE
+DEVICE_VARS += LOADER_FLASH_OFFS LOADER_TYPE
 
 define Build/loader-common
        rm -rf $@.src
index d0dc49730b57909a0062fdbdc36f5f02031639b3..0ec04af6b31fa5d075bf0ad5b5c66e5ce9d1e8a3 100644 (file)
@@ -62,14 +62,12 @@ define Device/Default
   KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
   KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
   FILESYSTEMS := squashfs
-  IMAGE_SIZE :=
   SOC := $(DEFAULT_SOC)
   DEVICE_DTS = $$(SOC)_$(1)
   SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
   IMAGES := sysupgrade.bin
   IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE)
 endef
-DEVICE_VARS += IMAGE_SIZE
 
 define Device/NAND/xway
   BLOCKSIZE := 16k
index 1d865aa5673644371fe051937579bb0a36b21901..e34bf372100688066f5fc5e64acbe91cac0db8ec 100644 (file)
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
-DEVICE_VARS += IMAGE_SIZE NETGEAR_BOARD_ID NETGEAR_HW_ID
+DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
 DEVICE_VARS += BUFFALO_TAG_PLATFORM BUFFALO_TAG_VERSION BUFFALO_TAG_MINOR
 DEVICE_VARS += SEAMA_SIGNATURE SEAMA_MTDBLOCK
 DEVICE_VARS += SERCOMM_HWID SERCOMM_HWVER SERCOMM_SWVER