From beda11255b27d2ec089aae4d8248000f213d323b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 29 Jan 2016 23:19:41 +0000 Subject: octeon: get rid of /lib/functions/octeon.sh hackery, use sysinfo directly Fixes sysupgrade Signed-off-by: Felix Fietkau SVN-Revision: 48558 --- .../linux/octeon/base-files/lib/preinit/20_sysinfo | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 target/linux/octeon/base-files/lib/preinit/20_sysinfo (limited to 'target/linux/octeon/base-files/lib/preinit/20_sysinfo') 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 -- cgit v1.2.3