2015-11-02 10:18:50 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2016-03-21 20:42:51 +00:00
|
|
|
# Copyright (C) 2016 OpenWrt.org
|
2015-11-02 10:18:50 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
mediatek_board_detect() {
|
|
|
|
local machine
|
|
|
|
local name
|
|
|
|
|
|
|
|
machine=$(cat /proc/device-tree/model)
|
|
|
|
|
|
|
|
case "$machine" in
|
2016-04-29 11:34:31 +00:00
|
|
|
"MediaTek MT7623 evaluation board")
|
|
|
|
name="mt7623_evb"
|
|
|
|
;;
|
2016-04-27 08:58:15 +00:00
|
|
|
"MediaTek MT7623 eMMC evaluation board")
|
|
|
|
name="eMMC"
|
|
|
|
;;
|
|
|
|
"MediaTek MT7623 NAND evaluation board")
|
|
|
|
name="NAND"
|
2015-11-02 10:18:50 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
[ -z "$name" ] && name="unknown"
|
|
|
|
|
|
|
|
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
|
|
|
|
|
|
|
|
echo "$name" > /tmp/sysinfo/board_name
|
|
|
|
echo "$machine" > /tmp/sysinfo/model
|
|
|
|
}
|
|
|
|
|
|
|
|
mediatek_board_name() {
|
|
|
|
local name
|
|
|
|
|
|
|
|
[ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
|
|
|
|
[ -z "$name" ] && name="unknown"
|
|
|
|
|
|
|
|
echo "$name"
|
|
|
|
}
|