aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/base-files/lib
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-07-02 16:33:11 +0000
committerJohn Crispin <john@openwrt.org>2014-07-02 16:33:11 +0000
commite2915c6981a4ba141d8ce4dc3f39e187890fb9f6 (patch)
tree419a813da3c6c4c4e9a0e4746ebeab8db763aafb /target/linux/lantiq/base-files/lib
parent80e3282739dcffd1847b20093bb7757bc1ba6757 (diff)
downloadupstream-e2915c6981a4ba141d8ce4dc3f39e187890fb9f6.tar.gz
upstream-e2915c6981a4ba141d8ce4dc3f39e187890fb9f6.tar.bz2
upstream-e2915c6981a4ba141d8ce4dc3f39e187890fb9f6.zip
lantiq: add support for /tmp/sysinfo
Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 41472
Diffstat (limited to 'target/linux/lantiq/base-files/lib')
-rw-r--r--target/linux/lantiq/base-files/lib/functions/lantiq.sh26
1 files changed, 23 insertions, 3 deletions
diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq.sh b/target/linux/lantiq/base-files/lib/functions/lantiq.sh
index ed76cd8014..88da794ca9 100644
--- a/target/linux/lantiq/base-files/lib/functions/lantiq.sh
+++ b/target/linux/lantiq/base-files/lib/functions/lantiq.sh
@@ -1,9 +1,29 @@
#!/bin/sh
-lantiq_board_id() {
- grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g"
+lantiq_board_detect() {
+ name=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g"`
+ model=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g"`
+ [ -z "$name" ] && name="unknown"
+ [ -z "$model" ] && model="unknown"
+ [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
+ echo $name > /tmp/sysinfo/board_name
+ echo $model > /tmp/sysinfo/model
+}
+
+lantiq_board_model() {
+ local model
+
+ [ -f /tmp/sysinfo/model ] && model=$(cat /tmp/sysinfo/model)
+ [ -z "$model" ] && model="unknown"
+
+ echo "$model"
}
lantiq_board_name() {
- grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g"
+ local name
+
+ [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
+ [ -z "$name" ] && name="unknown"
+
+ echo "$name"
}