treewide: use the generic board_name function
[openwrt/staging/mkresin.git] / target / linux / ramips / base-files / etc / uci-defaults / 09_fix-seama-header
index 35167f1adc22ab9370075af103a22fa06a45b80b..9533aed475a14c9280c3984d530ff8c7c43a9eaf 100644 (file)
@@ -3,20 +3,21 @@
 # Copyright (C) 2012 OpenWrt.org
 #
 
-. /lib/ramips.sh
+. /lib/functions.sh
 
 fix_seama_header() {
-       local part=$1
+       local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"kernel".*/\1/p' /proc/mtd)
 
-       mtd fixseama $part
+       [ "$kernel_size" ] && mtd -c 0x$kernel_size fixseama firmware
 }
 
-board=$(ramips_board_name)
+board=$(board_name)
 
 case "$board" in
 cy-swr1100 | \
+dch-m225 | \
 dir-645 | \
 dir-860l-b1)
-       fix_seama_header kernel
+       fix_seama_header
        ;;
 esac