linux-atm: fix build with GCC 14
[openwrt/openwrt.git] / target / linux / ramips / image / common-tp-link.mk
index 587ef89fc103022df135769cd396ac892e6a4a7a..cb26275960537cb3a3c234a38e07bb6e63d79b24 100644 (file)
@@ -1,6 +1,19 @@
 DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD
 DEVICE_VARS += TPLINK_HVERSION TPLINK_BOARD_ID TPLINK_HEADER_VERSION
 
+define Build/uImage-tplink-c9
+       mkimage \
+               -A $(LINUX_KARCH) \
+               -O linux \
+               -T $(word 1,$(1)) \
+               -C none \
+               -a $(KERNEL_LOADADDR) \
+               -e $(KERNEL_LOADADDR) \
+               -n $(wordlist 2,$(words $(1)),$(1)) \
+               -d $@ $@.new
+       mv $@.new $@
+endef
+
 define Device/tplink-v1
   DEVICE_VENDOR := TP-Link
   TPLINK_FLASHLAYOUT :=
@@ -11,8 +24,8 @@ define Device/tplink-v1
   KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v1-header -e -O
   IMAGES += factory.bin
   IMAGE/factory.bin := tplink-v1-image factory -e -O
-  IMAGE/sysupgrade.bin := tplink-v1-image sysupgrade -e -O | append-metadata | \
-       check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin := tplink-v1-image sysupgrade -e -O | check-size | \
+       append-metadata
 endef
 
 define Device/tplink-v2
@@ -26,8 +39,8 @@ define Device/tplink-v2
   KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e
   IMAGES += factory.bin
   IMAGE/factory.bin := tplink-v2-image -e
-  IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \
-       check-size $$$$(IMAGE_SIZE)
+  IMAGE/sysupgrade.bin := tplink-v2-image -s -e | check-size | \
+       append-metadata
 endef
 
 define Device/tplink-safeloader
@@ -39,6 +52,6 @@ define Device/tplink-safeloader
   KERNEL := $(KERNEL_DTB) | tplink-v1-header -e -O
   IMAGES += factory.bin
   IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \
-       append-metadata | check-size $$$$(IMAGE_SIZE)
+       check-size | append-metadata
   IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
 endef