2014-08-30 09:32:58 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2014 The Linux Foundation. All rights reserved.
|
|
|
|
# Copyright (C) 2011 OpenWrt.org
|
|
|
|
#
|
|
|
|
|
|
|
|
IPQ806X_BOARD_NAME=
|
|
|
|
IPQ806X_MODEL=
|
|
|
|
|
|
|
|
ipq806x_board_detect() {
|
|
|
|
local machine
|
|
|
|
local name
|
|
|
|
|
|
|
|
machine=$(cat /proc/device-tree/model)
|
|
|
|
|
|
|
|
case "$machine" in
|
|
|
|
*"AP148")
|
|
|
|
name="ap148"
|
|
|
|
;;
|
2016-05-27 14:26:42 +00:00
|
|
|
*"C2600")
|
|
|
|
name="c2600"
|
|
|
|
;;
|
2016-01-19 10:16:36 +00:00
|
|
|
*"D7800")
|
|
|
|
name="d7800"
|
|
|
|
;;
|
2015-04-21 07:15:47 +00:00
|
|
|
*"DB149")
|
|
|
|
name="db149"
|
|
|
|
;;
|
2015-09-04 14:46:06 +00:00
|
|
|
*"R7500")
|
|
|
|
name="r7500"
|
|
|
|
;;
|
2016-08-19 20:56:24 +00:00
|
|
|
*"R7500v2")
|
|
|
|
name="r7500v2"
|
|
|
|
;;
|
2016-05-13 06:13:15 +00:00
|
|
|
*"Linksys EA8500"*)
|
|
|
|
name="ea8500"
|
|
|
|
;;
|
2016-06-21 09:55:00 +00:00
|
|
|
*"R7800")
|
|
|
|
name="r7800"
|
|
|
|
;;
|
2014-08-30 09:32:58 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
[ -z "$name" ] && name="unknown"
|
|
|
|
|
|
|
|
[ -z "$IPQ806X_BOARD_NAME" ] && IPQ806X_BOARD_NAME="$name"
|
|
|
|
[ -z "$IPQ806X_MODEL" ] && IPQ806X_MODEL="$machine"
|
|
|
|
|
|
|
|
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
|
|
|
|
|
|
|
|
echo "$IPQ806X_BOARD_NAME" > /tmp/sysinfo/board_name
|
|
|
|
echo "$IPQ806X_MODEL" > /tmp/sysinfo/model
|
|
|
|
}
|
|
|
|
|
|
|
|
ipq806x_board_name() {
|
|
|
|
local name
|
|
|
|
|
|
|
|
[ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
|
|
|
|
[ -z "$name" ] && name="unknown"
|
|
|
|
|
|
|
|
echo "$name"
|
|
|
|
}
|