aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/octeon/base-files/lib/preinit
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/octeon/base-files/lib/preinit')
-rw-r--r--target/linux/octeon/base-files/lib/preinit/20_sysinfo31
-rw-r--r--target/linux/octeon/base-files/lib/preinit/79_move_config6
2 files changed, 32 insertions, 5 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
diff --git a/target/linux/octeon/base-files/lib/preinit/79_move_config b/target/linux/octeon/base-files/lib/preinit/79_move_config
index 39cefd53db..669999e2e3 100644
--- a/target/linux/octeon/base-files/lib/preinit/79_move_config
+++ b/target/linux/octeon/base-files/lib/preinit/79_move_config
@@ -2,11 +2,7 @@
# Copyright (C) 2014 OpenWrt.org
move_config() {
- . /lib/functions/octeon.sh
-
- local board="$(octeon_board_name)"
-
- case "$board" in
+ case "$(cat /tmp/sysinfo/board_name)" in
erlite)
mount -t vfat /dev/sda1 /mnt
mv -f /mnt/sysupgrade.tgz /