aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/base-files/lib/upgrade
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2014-01-24 17:15:02 +0000
committerGabor Juhos <juhosg@openwrt.org>2014-01-24 17:15:02 +0000
commit9cf7b253957c0602e451496e45815b6e82c60dbb (patch)
tree399095b360edafc6a953208e5c4edea23eac5c66 /target/linux/ar71xx/base-files/lib/upgrade
parent62ba78a061f1c8b5c96d19c2f0bbe689b4707e13 (diff)
downloadmaster-187ad058-9cf7b253957c0602e451496e45815b6e82c60dbb.tar.gz
master-187ad058-9cf7b253957c0602e451496e45815b6e82c60dbb.tar.bz2
master-187ad058-9cf7b253957c0602e451496e45815b6e82c60dbb.zip
ar71xx: add sysupgrade support for the Compex boards
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39390 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/base-files/lib/upgrade')
-rwxr-xr-xtarget/linux/ar71xx/base-files/lib/upgrade/platform.sh25
1 files changed, 24 insertions, 1 deletions
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index a51cbded79..9d44f343b9 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -89,6 +89,23 @@ cybertan_check_image() {
return 0
}
+platform_do_upgrade_compex() {
+ local fw_file=$1
+ local fw_part=$PART_NAME
+ local fw_mtd=$(find_mtd_part $fw_part)
+ local fw_length=0x$(dd if="$fw_file" bs=2 skip=1 count=4 2>/dev/null)
+ local fw_blocks=$(($fw_length / 65536))
+
+ if [ -n "$fw_mtd" ] && [ ${fw_blocks:-0} -gt 0 ]; then
+ local append=""
+ [ -f "$CONF_TAR" -a "$SAVE_CONFIG" -eq 1 ] && append="-j $CONF_TAR"
+
+ sync
+ dd if="$fw_file" bs=64k skip=1 count=$fw_blocks 2>/dev/null | \
+ mtd $append write - "$fw_part"
+ fi
+}
+
platform_check_image() {
local board=$(ar71xx_board_name)
local magic="$(get_magic_word "$1")"
@@ -288,7 +305,9 @@ platform_check_image() {
eap7660d | \
ja76pf | \
ja76pf2 | \
- jwap003)
+ jwap003 | \
+ wp543 | \
+ wpe72)
[ "$magic" != "4349" ] && {
echo "Invalid image. Use *-sysupgrade.bin files on this board"
return 1
@@ -327,6 +346,10 @@ platform_do_upgrade() {
jwap003)
platform_do_upgrade_combined "$ARGV"
;;
+ wp543|\
+ wpe72)
+ platform_do_upgrade_compex "$ARGV"
+ ;;
all0258n )
platform_do_upgrade_allnet "0x9f050000" "$ARGV"
;;