ramips: fix fixseama call on first boot
[openwrt/openwrt.git] / target / linux / ramips / base-files / etc / uci-defaults / 09_fix-seama-header
index 35167f1adc22ab9370075af103a22fa06a45b80b..7a0a325d4b6b698625c37fbcb139b168362641ee 100644 (file)
@@ -6,9 +6,9 @@
 . /lib/ramips.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)
@@ -17,6 +17,6 @@ case "$board" in
 cy-swr1100 | \
 dir-645 | \
 dir-860l-b1)
-       fix_seama_header kernel
+       fix_seama_header
        ;;
 esac