summaryrefslogtreecommitdiff
path: root/target/linux/ar71xx/base-files
diff options
context:
space:
mode:
authorDaniel Dickinson <crazycshore@gmail.com>2012-09-17 14:17:12 +0000
committerDaniel Dickinson <crazycshore@gmail.com>2012-09-17 14:17:12 +0000
commit0f254b4b67b400e093b8e8e0e22144dbdddcb7ad (patch)
tree2cfdc98f2b3fb0720049ae3322913756b4bde352 /target/linux/ar71xx/base-files
parente8893fdf7a151854f0edcee6863bd7e81e887705 (diff)
downloadmtk-20170518-0f254b4b67b400e093b8e8e0e22144dbdddcb7ad.zip
mtk-20170518-0f254b4b67b400e093b8e8e0e22144dbdddcb7ad.tar.gz
mtk-20170518-0f254b4b67b400e093b8e8e0e22144dbdddcb7ad.tar.bz2
dir-825-b1: Fix wholeflash images: Attempting to flash a wholeflash (-openwrt) image from the normal image would brick (but recoverable via emergency flash) the router if the wholeflash image was larger than the maximum size for a normal image. First we rename the -openwrt images to -wholeflash since -openwrt is really too generic. We also revert the changes to the regular dir-825-b1 image, which now is the same as before, but add a -towholeflash image which is almost the same as the regular dir-825-b1 image, but copies caldata to new location and allows flashing of images that use the full flash (except u-boot, u-boot-env, and caldata paritition space) (these are the -wholeflash images).
SVN-Revision: 33447
Diffstat (limited to 'target/linux/ar71xx/base-files')
-rwxr-xr-xtarget/linux/ar71xx/base-files/etc/diag.sh3
-rw-r--r--target/linux/ar71xx/base-files/etc/uci-defaults/caldata-migration4
-rwxr-xr-xtarget/linux/ar71xx/base-files/etc/uci-defaults/leds5
-rwxr-xr-xtarget/linux/ar71xx/base-files/etc/uci-defaults/network3
-rwxr-xr-xtarget/linux/ar71xx/base-files/lib/ar71xx.sh7
-rwxr-xr-xtarget/linux/ar71xx/base-files/lib/upgrade/platform.sh3
6 files changed, 18 insertions, 7 deletions
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 570bdcb..52176a8 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -65,7 +65,8 @@ get_status_led() {
status_led="d-link:green:status"
;;
dir-825-b1 |\
- dir-825-b1-openwrt |\
+ dir-825-b1-towholeflash |\
+ dir-825-b1-wholeflash |\
dir-825-b1-stock)
status_led="d-link:orange:power"
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/caldata-migration b/target/linux/ar71xx/base-files/etc/uci-defaults/caldata-migration
index 750ff40..486e4ed 100644
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/caldata-migration
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/caldata-migration
@@ -44,12 +44,13 @@ getifmac() {
}
case "$board" in
-dir-825-b1)
+dir-825-b1-towholeflash)
mac1="$(getcalmac caldata 65440)"
mac1="$(calcmacX "$mac1" 2)"
mac2="$(calcmacX "$mac1" 1)"
if grep -q '"owrt_caldata"' /proc/mtd && [ "$mac1" = "$(getifmac eth0)" ] && [ "$mac2" = "$(getifmac eth1)" ]; then
+ mtd erase owrt_caldata
dd if=/dev/$(findmtd caldata) of=/dev/$(findmtd owrt_caldata) bs=65536 count=1
fi
;;
@@ -58,6 +59,7 @@ dir-825-b1-tostock)
mac1="$(calcmacX "$mac1" 2)"
mac2="$(calcmacX "$mac1" 1)"
if grep -q '"owrt_caldata"' /proc/mtd && [ "$mac1" = "$(getifmac eth0)" ] && [ "$mac2" = "$(getifmac eth1)" ]; then
+ mtd erase caldata
dd if=/dev/$(findmtd owrt_caldata) of=/dev/$(findmtd caldata) bs=65536 count=1
fi
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/leds b/target/linux/ar71xx/base-files/etc/uci-defaults/leds
index 5e2e9ac..e8daba5 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/leds
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/leds
@@ -54,7 +54,10 @@ dir-615-e4)
ucidef_set_led_switch "lan4" "LAN4" "d-link:green:lan4" "switch0" "0x10"
;;
-dir-825-b1)
+dir-825-b1|\
+dir-825-b1-towholeflash|\
+dir-825-b1-wholeflash|\
+dir-825-b1-tostock)
ucidef_set_led_usbdev "usb" "USB" "d-link:blue:usb" "1-1"
;;
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/network b/target/linux/ar71xx/base-files/etc/uci-defaults/network
index f749cc6..0b7c6a2 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/network
@@ -33,7 +33,8 @@ rb-2011uas-2hnd)
;;
dir-825-b1|\
-dir-825-b1-openwrt|\
+dir-825-b1-towholeflash|\
+dir-825-b1-wholeflash|\
dir-825-b1-tostock|\
tew-673gru)
ucidef_set_interfaces_lan_wan "eth0.1" "eth1"
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 8db9830..2b083e1 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -201,8 +201,11 @@ ar71xx_board_detect() {
*"DIR-825 rev. B1")
name="dir-825-b1"
;;
- *"DIR-825 rev. B1 OpenWrt")
- name="dir-825-b1-openwrt"
+ *"DIR-825 rev. B1 WHOLEFLASH")
+ name="dir-825-b1-wholeflash"
+ ;;
+ *"DIR-825 rev. B1 TOWHOLEFLASH")
+ name="dir-825-b1-towholeflash"
;;
*"DIR-825 rev. B1 TOSTOCK")
name="dir-825-b1-tostock"
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 2992aed..9987b24 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -101,7 +101,8 @@ platform_check_image() {
dir-615-c1 | \
dir-615-e4 | \
dir-825-b1 | \
- dir-825-b1-openwrt | \
+ dir-825-b1-towholeflash | \
+ dir-825-b1-wholeflash | \
dir-825-b1-tostock | \
ew-dorin | \
ew-dorin-router | \