From ac3e05c5d757334944fbf1f14583164cd1d69172 Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Fri, 7 Apr 2017 18:09:08 +0200 Subject: treewide: populate boardname and model earlier For targets using the generic board detection and board specific settings in diag.sh, the board name is still unset at the time the set_state() provided by diag.sh is called by 10_indicate_preinit. Change the execution order to ensure the boardname is populated before required the first time. Do the target specific board detection as early as possible, directly followed by the generic one to allow a seamless switch to the generic function for populating /tmp/sysinfo/. Signed-off-by: Mathias Kresin --- .../linux/octeon/base-files/lib/preinit/01_sysinfo | 31 ++++++++++++++++++++++ .../linux/octeon/base-files/lib/preinit/20_sysinfo | 31 ---------------------- 2 files changed, 31 insertions(+), 31 deletions(-) create mode 100644 target/linux/octeon/base-files/lib/preinit/01_sysinfo delete mode 100644 target/linux/octeon/base-files/lib/preinit/20_sysinfo (limited to 'target/linux/octeon/base-files/lib') diff --git a/target/linux/octeon/base-files/lib/preinit/01_sysinfo b/target/linux/octeon/base-files/lib/preinit/01_sysinfo new file mode 100644 index 0000000000..d8f467ed27 --- /dev/null +++ b/target/linux/octeon/base-files/lib/preinit/01_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/20_sysinfo b/target/linux/octeon/base-files/lib/preinit/20_sysinfo deleted file mode 100644 index d8f467ed27..0000000000 --- a/target/linux/octeon/base-files/lib/preinit/20_sysinfo +++ /dev/null @@ -1,31 +0,0 @@ -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