aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-12-19 11:28:36 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-12-19 11:28:36 +0000
commitdda0dc3943c67133a9dd9ae7044520a8c37c9961 (patch)
treef3979c909a21e9b8b30d1e3f57c193378b739d48 /package
parent2a7cbe0a69236c97ac0f9d370a48795944dcc341 (diff)
downloadmaster-187ad058-dda0dc3943c67133a9dd9ae7044520a8c37c9961.tar.gz
master-187ad058-dda0dc3943c67133a9dd9ae7044520a8c37c9961.tar.bz2
master-187ad058-dda0dc3943c67133a9dd9ae7044520a8c37c9961.zip
ar71xx: scan nand ubi partition for ath9k eeprom files
The MR18 stores the ath9k eeprom values on the NAND. This patch makes it possible to retrieve the images from there. Signed-off-by: Chris R Blake <chrisrblake93@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47948 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/base-files/files/lib/functions/system.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions/system.sh b/package/base-files/files/lib/functions/system.sh
index 8d75a5a8ce..03d71277b0 100644
--- a/package/base-files/files/lib/functions/system.sh
+++ b/package/base-files/files/lib/functions/system.sh
@@ -41,6 +41,23 @@ mtd_get_mac_binary() {
dd bs=1 skip=$offset count=6 if=$part 2>/dev/null | hexdump -v -n 6 -e '5/1 "%02x:" 1/1 "%02x"'
}
+mtd_get_mac_binary_ubi() {
+ local mtdname="$1"
+ local offset="$2"
+
+ . /lib/upgrade/nand.sh
+
+ local ubidev=$(nand_find_ubi $CI_UBIPART)
+ local part=$(nand_find_volume $ubidev $1)
+
+ if [ -z "$part" ]; then
+ echo "mtd_get_mac_binary: ubi volume $mtdname not found!" >&2
+ return
+ fi
+
+ hexdump -v -n 6 -s $offset -e '5/1 "%02x:" 1/1 "%02x"' /dev/$part 2>/dev/null
+}
+
mtd_get_part_size() {
local part_name=$1
local first dev size erasesize name