lantiq: detect board in preinit state
authorJohn Crispin <john@openwrt.org>
Mon, 14 Jul 2014 07:38:52 +0000 (07:38 +0000)
committerJohn Crispin <john@openwrt.org>
Mon, 14 Jul 2014 07:38:52 +0000 (07:38 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 41638

target/linux/lantiq/base-files/lib/functions/lantiq.sh
target/linux/lantiq/base-files/lib/preinit/03_preinit_board.sh [new file with mode: 0755]

index f02edbcbb101f5be1d906e2b2fc990a546a68a7f..88da794ca9df17f60f75755b5bd2667352ae68bb 100644 (file)
@@ -13,7 +13,6 @@ lantiq_board_detect() {
 lantiq_board_model() {
        local model
 
-       [ -f /tmp/sysinfo/model ] || lantiq_board_detect
        [ -f /tmp/sysinfo/model ] && model=$(cat /tmp/sysinfo/model)
        [ -z "$model" ] && model="unknown"
 
@@ -23,7 +22,6 @@ lantiq_board_model() {
 lantiq_board_name() {
        local name
 
-       [ -f /tmp/sysinfo/board_name ] || lantiq_board_detect
        [ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
        [ -z "$name" ] && name="unknown"
 
diff --git a/target/linux/lantiq/base-files/lib/preinit/03_preinit_board.sh b/target/linux/lantiq/base-files/lib/preinit/03_preinit_board.sh
new file mode 100755 (executable)
index 0000000..6d4bd67
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+do_lantiq() {
+       . /lib/functions/lantiq.sh
+
+       lantiq_board_detect
+}
+
+boot_hook_add preinit_main do_lantiq