aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/image/mt7621.mk
diff options
context:
space:
mode:
authorSungbo Eo <mans0n@gorani.run>2020-02-07 20:26:05 +0900
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-02-21 14:12:30 +0100
commit2d3a93335ae4ea9ca63e4bae798738b5befca440 (patch)
treea905d6d93df1b72606750c0b8b6e5c19f807fefa /target/linux/ramips/image/mt7621.mk
parent8fa6107aee1d876f187da1afdfc6a82f17f2b0e6 (diff)
downloadupstream-2d3a93335ae4ea9ca63e4bae798738b5befca440.tar.gz
upstream-2d3a93335ae4ea9ca63e4bae798738b5befca440.tar.bz2
upstream-2d3a93335ae4ea9ca63e4bae798738b5befca440.zip
ramips: append tail to WF2881 initramfs image
Stock firmware has a vendor-defined tail at the end of uImage for image validation. This patch enables OpenWrt installation from stock firmware without having to access the UART console. Installation via web interface: 1. Flash **initramfs** image through the stock web interface. 2. Boot into OpenWrt and perform sysupgrade with sysupgrade image. Signed-off-by: Sungbo Eo <mans0n@gorani.run> (cherry picked from commit be3e98ce26da5e737744427e1d59dd1c0508edef)
Diffstat (limited to 'target/linux/ramips/image/mt7621.mk')
-rw-r--r--target/linux/ramips/image/mt7621.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 9c16705e2f..28ae0d451f 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -60,6 +60,12 @@ define Build/wr1201-factory-header
mv $@.new $@
endef
+define Build/netis-tail
+ echo -n $(1) >> $@
+ echo -n $(UIMAGE_NAME)-yun | $(STAGING_DIR_HOST)/bin/mkhash md5 | \
+ sed 's/../\\\\x&/g' | xargs echo -ne >> $@
+endef
+
define Build/ubnt-erx-factory-image
if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \
echo '21001:6' > $(1).compat; \
@@ -544,6 +550,8 @@ define Device/wf-2881
IMAGE_SIZE := 129280k
KERNEL := $(KERNEL_DTB) | pad-offset $$(BLOCKSIZE) 64 | uImage lzma
UBINIZE_OPTS := -E 5
+ UIMAGE_NAME := WF2881_0.0.00
+ KERNEL_INITRAMFS := $(KERNEL_DTB) | netis-tail WF2881 | uImage lzma
IMAGE/sysupgrade.bin := append-kernel | append-ubi | append-metadata | check-size $$$$(IMAGE_SIZE)
DEVICE_TITLE := NETIS WF-2881
DEVICE_PACKAGES := kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-basic