2014-06-24 18:18:51 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (C) 2014 OpenWrt.org
|
|
|
|
#
|
|
|
|
|
|
|
|
KIRKWOOD_BOARD_NAME=
|
|
|
|
KIRKWOOD_MODEL=
|
|
|
|
|
|
|
|
kirkwood_board_detect() {
|
|
|
|
local machine
|
|
|
|
local name
|
|
|
|
|
|
|
|
machine=$(cat /proc/device-tree/model)
|
|
|
|
|
|
|
|
case "$machine" in
|
|
|
|
"Seagate FreeAgent Dockstar")
|
|
|
|
name="dockstar"
|
|
|
|
;;
|
|
|
|
|
2015-05-08 20:12:39 +00:00
|
|
|
"Seagate GoFlex Home")
|
|
|
|
name="goflexhome"
|
|
|
|
;;
|
|
|
|
|
2015-02-12 14:39:26 +00:00
|
|
|
"Seagate GoFlex Net")
|
|
|
|
name="goflexnet"
|
|
|
|
;;
|
|
|
|
|
2014-06-24 18:18:51 +00:00
|
|
|
"Iomega Iconnect")
|
|
|
|
name="iconnect"
|
|
|
|
;;
|
|
|
|
|
|
|
|
"RaidSonic ICY BOX IB-NAS62x0 (Rev B)")
|
|
|
|
name="ib62x0"
|
|
|
|
;;
|
|
|
|
|
|
|
|
"Cloud Engines Pogoplug E02")
|
|
|
|
name="pogo_e02"
|
|
|
|
;;
|
|
|
|
|
2014-11-10 23:55:10 +00:00
|
|
|
"Linksys EA3500")
|
|
|
|
name="ea3500"
|
|
|
|
;;
|
|
|
|
|
2014-06-24 18:18:51 +00:00
|
|
|
"Linksys EA4500")
|
|
|
|
name="ea4500"
|
|
|
|
;;
|
|
|
|
|
2014-12-18 18:38:43 +00:00
|
|
|
"Globalscale Technologies Guruplug Server Plus")
|
|
|
|
name="guruplug-server-plus"
|
|
|
|
;;
|
|
|
|
|
|
|
|
"Globalscale Technologies SheevaPlug")
|
|
|
|
name="sheevaplug"
|
|
|
|
;;
|
|
|
|
|
|
|
|
"Globalscale Technologies eSATA SheevaPlug")
|
|
|
|
name="sheevaplug-esata"
|
|
|
|
;;
|
|
|
|
|
2014-06-24 18:18:51 +00:00
|
|
|
*)
|
|
|
|
name="generic"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
[ -z "$KIRKWOOD_BOARD_NAME" ] && KIRKWOOD_BOARD_NAME="$name"
|
|
|
|
[ -z "$KIRKWOOD_MODEL" ] && KIRKWOOD_MODEL="$machine"
|
|
|
|
|
|
|
|
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
|
|
|
|
|
|
|
|
echo "$KIRKWOOD_BOARD_NAME" > /tmp/sysinfo/board_name
|
|
|
|
echo "$KIRKWOOD_MODEL" > /tmp/sysinfo/model
|
|
|
|
}
|
|
|
|
|
|
|
|
kirkwood_board_name() {
|
|
|
|
local name
|
|
|
|
|
|
|
|
[ -f /tmp/sysinfo/board_name ] || kirkwood_board_detect
|
|
|
|
[ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
|
|
|
|
[ -z "$name" ] && name="unknown"
|
|
|
|
|
|
|
|
echo "$name"
|
|
|
|
}
|