treewide: drop shebang from non-executable target files
[openwrt/openwrt.git] / target / linux / cns3xxx / base-files / lib / cns3xxx.sh
1 CNS3XXX_BOARD_NAME=
2 CNS3XXX_MODEL=
3
4 cns3xxx_board_detect() {
5 local machine
6 local name
7
8 machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /Hardware/ {print $2}' /proc/cpuinfo)
9
10 case "$machine" in
11 "Gateworks Corporation Laguna"*)
12 name="laguna"
13 ;;
14 *)
15 name="generic";
16 ;;
17 esac
18
19 [ -z "$CNS3XXX_BOARD_NAME" ] && CNS3XXX_BOARD_NAME="$name"
20 [ -z "$CNS3XXX_MODEL" ] && CNS3XXX_MODEL="$machine"
21
22 [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
23
24 echo "$CNS3XXX_BOARD_NAME" > /tmp/sysinfo/board_name
25 echo "$CNS3XXX_MODEL" > /tmp/sysinfo/model
26 }