ar71xx: image: keep custom Build/* functions in separate files
[openwrt/openwrt.git] / target / linux / ar71xx / image / tp-link.mk
index 2d64846cc86189a2510e0656b2965f262203ec6b..26ac6dad0b19c6012100c07af892e6d3d6045073 100644 (file)
@@ -1,4 +1,18 @@
-DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION TPLINK_BOARD_NAME
+DEVICE_VARS += LOADER_FLASH_OFFS TPLINK_BOARD_NAME TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION TPLINK_HWID TPLINK_HWREV
+
+define Build/copy-file
+       cat "$(1)" > "$@"
+endef
+
+define Build/loader-okli
+       dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new"
+       cat "$@" >> "$@.new"
+       mv "$@.new" "$@"
+endef
+
+define Build/loader-okli-compile
+       $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0 KERNEL_CMDLINE="$(CMDLINE)")
+endef
 
 # combine kernel and rootfs into one image
 # mktplinkfw <type> <optional extra arguments to mktplinkfw binary>