gemini: Fix up firmware checksum on DIR-685
[openwrt/staging/wigyori.git] / target / linux / gemini / base-files / etc / uci-defaults / 09_fix-checksum
1 #!/bin/sh
2 #
3 # Copyright (C) 2019 OpenWrt.org
4 #
5
6 . /lib/functions.sh
7
8 board=$(board_name)
9
10 fixwrgg() {
11 local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"kernel".*/\1/p' /proc/mtd)
12
13 [ "$kernel_size" ] && mtd -c 0x$kernel_size fixwrgg firmware
14 }
15
16 case "$board" in
17 dlink,dir-685)
18 fixwrgg
19 ;;
20 esac