aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/image/common-tp-link.mk
diff options
context:
space:
mode:
authorMathias Kresin <dev@kresin.me>2018-07-05 22:34:14 +0200
committerMathias Kresin <dev@kresin.me>2018-07-07 21:07:40 +0200
commita28d686fb679e473cdae1366e7591a97d57ea8af (patch)
treefb1243913be03e424404949280014b54eb899942 /target/linux/ar71xx/image/common-tp-link.mk
parentb908c82f49c5049274f36345cfedbd21c0e5c938 (diff)
downloadupstream-a28d686fb679e473cdae1366e7591a97d57ea8af.tar.gz
upstream-a28d686fb679e473cdae1366e7591a97d57ea8af.tar.bz2
upstream-a28d686fb679e473cdae1366e7591a97d57ea8af.zip
ar71xx: factor out safe loader image build code
Add a template for safeloader images and include it instead of overwriting variables defined in the common tp-link build commands. Split the existing tp-link templates to proper implement the safeloader template. Signed-off-by: Mathias Kresin <dev@kresin.me>
Diffstat (limited to 'target/linux/ar71xx/image/common-tp-link.mk')
-rw-r--r--target/linux/ar71xx/image/common-tp-link.mk24
1 files changed, 19 insertions, 5 deletions
diff --git a/target/linux/ar71xx/image/common-tp-link.mk b/target/linux/ar71xx/image/common-tp-link.mk
index 317d5bb2f4..99acd7e584 100644
--- a/target/linux/ar71xx/image/common-tp-link.mk
+++ b/target/linux/ar71xx/image/common-tp-link.mk
@@ -44,16 +44,20 @@ endef
define Device/tplink
TPLINK_HWREV := 0x1
TPLINK_HEADER_VERSION := 1
- LOADER_TYPE := gz
+ IMAGES := sysupgrade.bin factory.bin
+endef
+
+define Device/tplink-lzma
+ $(Device/tplink)
KERNEL := kernel-bin | patch-cmdline | lzma
KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | tplink-v1-header
- IMAGES := sysupgrade.bin factory.bin
IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade
IMAGE/factory.bin := append-rootfs | mktplinkfw factory
endef
define Device/tplink-nolzma
$(Device/tplink)
+ LOADER_TYPE := gz
LOADER_FLASH_OFFS := 0x22000
COMPILE := loader-$(1).gz
COMPILE/loader-$(1).gz := loader-okli-compile
@@ -61,6 +65,16 @@ define Device/tplink-nolzma
KERNEL := kernel-bin | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 7680
KERNEL_INITRAMFS_NAME := vmlinux-initramfs.bin.lzma
KERNEL_INITRAMFS := kernel-bin | loader-kernel-cmdline | tplink-v1-header
+ IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade
+ IMAGE/factory.bin := append-rootfs | mktplinkfw factory
+endef
+
+define Device/tplink-safeloader
+ $(Device/tplink)
+ KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header
+ IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \
+ append-metadata | check-size $$$$(IMAGE_SIZE)
+ IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
endef
define Device/tplink-4m
@@ -76,19 +90,19 @@ define Device/tplink-8m
endef
define Device/tplink-4mlzma
- $(Device/tplink)
+ $(Device/tplink-lzma)
TPLINK_FLASHLAYOUT := 4Mlzma
IMAGE_SIZE := 3904k
endef
define Device/tplink-8mlzma
- $(Device/tplink)
+ $(Device/tplink-lzma)
TPLINK_FLASHLAYOUT := 8Mlzma
IMAGE_SIZE := 7936k
endef
define Device/tplink-16mlzma
- $(Device/tplink)
+ $(Device/tplink-lzma)
TPLINK_FLASHLAYOUT := 16Mlzma
IMAGE_SIZE := 15872k
endef