aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorNikolay Martynov <mar.kolya@gmail.com>2022-12-14 20:26:38 -0500
committerHauke Mehrtens <hauke@hauke-m.de>2023-01-04 23:19:19 +0100
commit665c2154ef122d10dfffeca95538ebdff82653b5 (patch)
tree57737ecd9bcd2983e3667bda5f9b5c25ae10f6b8 /package/base-files
parentc4b806d5c4ccc653968620e6e9aec93bc4e370e5 (diff)
downloadupstream-665c2154ef122d10dfffeca95538ebdff82653b5.tar.gz
upstream-665c2154ef122d10dfffeca95538ebdff82653b5.tar.bz2
upstream-665c2154ef122d10dfffeca95538ebdff82653b5.zip
ramips: add basic support for tp-link er605-v2
This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port. The board has headers to attach console. In order for them to work two solder bridges near those pads need to be made. The defice has the following partition table: ``` 0x000000000000-0x000000080000 : "u-boot" 0x000000080000-0x000000100000 : "u-boot-env" 0x000000100000-0x000000140000 : "factory" 0x000000140000-0x000007e00000 : "firmware" 0x000007e00000-0x000008000000 : "panic-ops" ``` `firmware` partition contains UBI volumes. Unfortunately I accidentally wiped partition and I no longer have access to it. `firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot. It also contains various configuration partitions that include device info and MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes. U-boot has `mtkupgrade` command that just overrides data on firmware partitions. Firmware file provided by TP-Link cannot be used with that command. U-boot also has 'recovery' http server. Unfortunately I was not able to make it work with manufacturer's firmware. Manufacturer's firmware essentially contains multiple UBI volumes along with 'partition table'. Unfortunately I no longer can properly run manufacturer's firmware so I cannot at the moment try to a support for building 'factory' images. This patch adds support for initramfs image as well as sysupgrade image. This seems to be pretty standard MT7621 board otherwise. Things that work: * network * leds * usb * factory MAC detection Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Diffstat (limited to 'package/base-files')
-rw-r--r--package/base-files/files/lib/functions/system.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions/system.sh b/package/base-files/files/lib/functions/system.sh
index 176c10d065..94ccc02bb8 100644
--- a/package/base-files/files/lib/functions/system.sh
+++ b/package/base-files/files/lib/functions/system.sh
@@ -129,6 +129,17 @@ mtd_get_mac_encrypted_deco() {
echo $macaddr
}
+mtd_get_mac_uci_config_ubi() {
+ local volumename="$1"
+
+ . /lib/upgrade/nand.sh
+
+ local ubidev=$(nand_attach_ubi $CI_UBIPART)
+ local part=$(nand_find_volume $ubidev $volumename)
+
+ cat "/dev/$part" | sed -n 's/^\s*option macaddr\s*'"'"'\?\([0-9A-F:]\+\)'"'"'\?/\1/Ip'
+}
+
mtd_get_mac_text() {
local mtdname=$1
local offset=$(($2))