ath79: move D-Link DIR-859 and DIR-869 series to tiny sub-target
[openwrt/openwrt.git] / target / linux / ath79 / tiny / base-files / etc / uci-defaults / 09_fix-checksum
diff --git a/target/linux/ath79/tiny/base-files/etc/uci-defaults/09_fix-checksum b/target/linux/ath79/tiny/base-files/etc/uci-defaults/09_fix-checksum
new file mode 100644 (file)
index 0000000..4febde5
--- /dev/null
@@ -0,0 +1,16 @@
+. /lib/functions.sh
+
+fix_seama_header() {
+       local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"kernel".*/\1/p' /proc/mtd)
+       [ "$kernel_size" ] && mtd -c 0x$kernel_size fixseama firmware
+}
+
+board=$(board_name)
+
+case "$board" in
+dlink,dir-859-a1|\
+dlink,dir-859-a3|\
+dlink,dir-869-a1)
+       fix_seama_header
+       ;;
+esac