aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/octeon/base-files/lib/preinit/20_sysinfo
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-01-29 23:19:41 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-01-29 23:19:41 +0000
commitbeda11255b27d2ec089aae4d8248000f213d323b (patch)
tree0104bf6230cdda52838c7b268f0eb5f1eeba5e0e /target/linux/octeon/base-files/lib/preinit/20_sysinfo
parentf32de94e0a46e06586dfd4066465a9425fa64304 (diff)
downloadupstream-beda11255b27d2ec089aae4d8248000f213d323b.tar.gz
upstream-beda11255b27d2ec089aae4d8248000f213d323b.tar.bz2
upstream-beda11255b27d2ec089aae4d8248000f213d323b.zip
octeon: get rid of /lib/functions/octeon.sh hackery, use sysinfo directly
Fixes sysupgrade Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48558
Diffstat (limited to 'target/linux/octeon/base-files/lib/preinit/20_sysinfo')
-rw-r--r--target/linux/octeon/base-files/lib/preinit/20_sysinfo31
1 files changed, 31 insertions, 0 deletions
diff --git a/target/linux/octeon/base-files/lib/preinit/20_sysinfo b/target/linux/octeon/base-files/lib/preinit/20_sysinfo
new file mode 100644
index 0000000000..d8f467ed27
--- /dev/null
+++ b/target/linux/octeon/base-files/lib/preinit/20_sysinfo
@@ -0,0 +1,31 @@
+do_sysinfo_octeon() {
+ local machine
+ local name
+
+ machine=$(grep "^system type" /proc/cpuinfo | sed "s/system type.*: \(.*\)/\1/g")
+
+ case "$machine" in
+ "UBNT_E100"*)
+ name="erlite"
+ ;;
+
+ "UBNT_E200"*)
+ name="er"
+ ;;
+
+ "UBNT_E220"*)
+ name="erpro"
+ ;;
+
+ *)
+ name="generic"
+ ;;
+ esac
+
+ [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
+
+ echo "$name" > /tmp/sysinfo/board_name
+ echo "$machine" > /tmp/sysinfo/model
+}
+
+boot_hook_add preinit_main do_sysinfo_octeon