summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorShiji Yang <yangshiji66@qq.com>2024-09-24 18:50:01 +0800
committerHauke Mehrtens <hauke@hauke-m.de>2024-10-06 14:07:37 +0200
commit08eecec3558d9adf351e03b58309e69a77de1a36 (patch)
treed2fd03e939f8f3f32997bb83c269090996c6beec /target
parentac840d74f12ff46e34bb51431f2e8a23b63cc34d (diff)
downloadopenwrt-08eecec3558d9adf351e03b58309e69a77de1a36.tar.gz
openwrt-08eecec3558d9adf351e03b58309e69a77de1a36.tar.bz2
openwrt-08eecec3558d9adf351e03b58309e69a77de1a36.zip
ramips: introduce TP-Link v1 header OKLI image recipe
It can be used to workaround the booting stuck issue caused by the u-boot LZMA decompression error. The new kernel image structure: +------+------------------+------------------+---------------+-----------------+ | name | tplink-v1 header | OKLI lzma-loader | uImage header | lzma kernel+dtb | +------+------------------+------------------+---------------+-----------------+ | size | 0x200 | 0xe00 | 0x40 | dynamic | +------+------------------+------------------+---------------+-----------------+ Signed-off-by: Shiji Yang <yangshiji66@qq.com> Link: https://github.com/openwrt/openwrt/pull/16473 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'target')
-rw-r--r--target/linux/ramips/image/common-tp-link.mk25
1 files changed, 25 insertions, 0 deletions
diff --git a/target/linux/ramips/image/common-tp-link.mk b/target/linux/ramips/image/common-tp-link.mk
index cb26275960..665b8f7971 100644
--- a/target/linux/ramips/image/common-tp-link.mk
+++ b/target/linux/ramips/image/common-tp-link.mk
@@ -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/tplink-v1-okli-image
+ cp $(IMAGE_KERNEL) $(IMAGE_ROOTFS).$(word 2,$(1))
+ cat $(IMAGE_ROOTFS) >> $(IMAGE_ROOTFS).$(word 2,$(1))
+ -$(STAGING_DIR_HOST)/bin/mktplinkfw \
+ -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) \
+ -N "$(VERSION_DIST)" -V $(REVISION) -m $(TPLINK_HEADER_VERSION) \
+ -k "$(KDIR)/loader-$(word 1,$(1)).$(LOADER_TYPE)" -E $(KERNEL_LOADADDR) \
+ -r $(IMAGE_ROOTFS).$(word 2,$(1)) -o $@.new -j -X 0x40000 \
+ -a $(call rootfs_align,$(FILESYSTEM)) $(wordlist 3,$(words $(1)),$(1)) \
+ $(if $(findstring sysupgrade,$(word 2,$(1))),-s) && mv $@.new $@ || rm -f $@
+ rm -f $(IMAGE_ROOTFS).$(word 2,$(1))
+endef
+
define Build/uImage-tplink-c9
mkimage \
-A $(LINUX_KARCH) \
@@ -28,6 +41,18 @@ define Device/tplink-v1
append-metadata
endef
+define Device/tplink-v1-okli
+ $(Device/tplink-v1)
+ LOADER_TYPE := bin
+ LOADER_FLASH_OFFS := 0x21000
+ COMPILE := loader-$(1).bin
+ COMPILE/loader-$(1).bin := loader-okli-compile | pad-to 64k | lzma | pad-to 3584
+ KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49
+ IMAGE/factory.bin := tplink-v1-okli-image $(1) factory -e -O
+ IMAGE/sysupgrade.bin := tplink-v1-okli-image $(1) sysupgrade -e -O | check-size | \
+ append-metadata
+endef
+
define Device/tplink-v2
DEVICE_VENDOR := TP-Link
TPLINK_FLASHLAYOUT :=