ramips/rt305x: Synchronize Makefiles with DTS compatible
[openwrt/staging/lynxis.git] / target / linux / ramips / base-files / lib / ramips.sh
1 #!/bin/sh
2 #
3 # Copyright (C) 2010-2013 OpenWrt.org
4 #
5
6 ramips_board_detect() {
7 local machine
8 local name
9
10 machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
11
12 case "$machine" in
13 *"MT7688 evaluation"*)
14 name="mt7688"
15 ;;
16 esac
17
18 # use generic board detect if no name is set
19 [ -z "$name" ] && return
20
21 [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
22
23 echo "$name" > /tmp/sysinfo/board_name
24 echo "$machine" > /tmp/sysinfo/model
25 }