aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-07-20 09:26:57 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-07-20 09:26:57 +0000
commitb595892f73cba40a7598067a9b01dc4bf2e88de7 (patch)
tree4ee0ded2bf5e7b043088f9548aa448359fe852c8
parentc475e599b47c83b875adbf4d8011e00f5da6a4ff (diff)
downloadupstream-b595892f73cba40a7598067a9b01dc4bf2e88de7.tar.gz
upstream-b595892f73cba40a7598067a9b01dc4bf2e88de7.tar.bz2
upstream-b595892f73cba40a7598067a9b01dc4bf2e88de7.zip
ar71xx: use mtd_get_part_size helper
Drop the local get_mtd_part_size implementation and use the equivalent function provided by lib/functions.sh. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37476 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/ar71xx/base-files/lib/upgrade/dir825.sh14
1 files changed, 1 insertions, 13 deletions
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/dir825.sh b/target/linux/ar71xx/base-files/lib/upgrade/dir825.sh
index e16128a9c5..7ad3dd8e1f 100644
--- a/target/linux/ar71xx/base-files/lib/upgrade/dir825.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/dir825.sh
@@ -6,18 +6,6 @@
. /lib/functions.sh
. /lib/ar71xx.sh
-get_mtd_part_size() {
- local part_name=$1
- local first dev size erasesize name
- while read dev size erasesize name; do
- name=${name#'"'}; name=${name%'"'}
- if [ "$name" = "$part_name" ]; then
- echo $((0x$size))
- break
- fi
- done < /proc/mtd
-}
-
get_magic_at() {
local mtddev=$1
local pos=$2
@@ -106,7 +94,7 @@ dir825b_check_image() {
local md5_img=$(dd if="$1" bs=2 skip=9 count=16 2>/dev/null)
local md5_chk=$(dd if="$1" bs=64k skip=1 2>/dev/null | md5sum -); md5_chk="${md5_chk%% *}"
local fw_len=$(dd if="$1" bs=2 skip=1 count=4 2>/dev/null)
- local fw_part_len=$(get_mtd_part_size "firmware")
+ local fw_part_len=$(mtd_get_part_size "firmware")
if [ -z "$fw_mtd" ]; then
ask_bool 0 "Do you have a backup of the caldata partition?" || {