mpc85xx: fix TL-WDR4900 v1 compatible string
[openwrt/openwrt.git] / target / linux / mpc85xx / base-files / lib / mpc85xx.sh
1 #!/bin/sh
2 #
3 # Copyright (C) 2013 OpenWrt.org
4 #
5
6 MPC85XX_BOARD_NAME=
7 MPC85XX_MODEL=
8
9 mpc85xx_board_detect() {
10 local model
11 local name
12
13 model=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /model/ {print $2}' /proc/cpuinfo)
14
15 case "$model" in
16 *"HiveAP-330")
17 name="hiveap-330"
18 ;;
19 *"TL-WDR4900 v1")
20 name="tl-wdr4900-v1"
21 ;;
22 esac
23
24 [ -z "$name" ] && name="unknown"
25
26 [ -z "$MPC85XX_BOARD_NAME" ] && MPC85XX_BOARD_NAME="$name"
27 [ -z "$MPC85XX_MODEL" ] && MPC85XX_MODEL="$model"
28
29 [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
30
31 echo "$MPC85XX_BOARD_NAME" > /tmp/sysinfo/board_name
32 echo "$MPC85XX_MODEL" > /tmp/sysinfo/model
33 }