2012-10-07 23:24:02 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2017-04-07 16:01:17 +00:00
|
|
|
CNS3XXX_BOARD_NAME=
|
|
|
|
CNS3XXX_MODEL=
|
|
|
|
|
|
|
|
cns3xxx_board_detect() {
|
2012-11-07 23:12:06 +00:00
|
|
|
local machine
|
|
|
|
local name
|
2012-10-07 23:24:02 +00:00
|
|
|
|
2012-11-07 23:12:06 +00:00
|
|
|
machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /Hardware/ {print $2}' /proc/cpuinfo)
|
2012-10-07 23:24:02 +00:00
|
|
|
|
2012-11-07 23:12:06 +00:00
|
|
|
case "$machine" in
|
2012-10-07 23:24:02 +00:00
|
|
|
"Gateworks Corporation Laguna"*)
|
|
|
|
name="laguna"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
name="generic";
|
|
|
|
;;
|
|
|
|
esac
|
2017-04-07 16:01:17 +00:00
|
|
|
|
|
|
|
[ -z "$CNS3XXX_BOARD_NAME" ] && CNS3XXX_BOARD_NAME="$name"
|
|
|
|
[ -z "$CNS3XXX_MODEL" ] && CNS3XXX_MODEL="$machine"
|
|
|
|
|
|
|
|
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
|
|
|
|
|
|
|
|
echo "$CNS3XXX_BOARD_NAME" > /tmp/sysinfo/board_name
|
|
|
|
echo "$CNS3XXX_MODEL" > /tmp/sysinfo/model
|
|
|
|
}
|