base-files: let config_generate call board_detect
authorJonas Gorski <jonas.gorski@gmail.com>
Sat, 13 Aug 2016 12:04:23 +0000 (14:04 +0200)
committerJonas Gorski <jonas.gorski@gmail.com>
Sat, 13 Aug 2016 13:49:46 +0000 (15:49 +0200)
Instead of board_detect generating the config as a side effect, let
config_generate call board_detect as needed.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
package/base-files/files/bin/board_detect
package/base-files/files/bin/config_generate
package/base-files/files/etc/init.d/boot

index beb7f4e6596584d0a423a88a168ec264b4b44008..3a23381c2c44d61f02090552cb07097b51bb4fc8 100755 (executable)
@@ -8,5 +8,3 @@
 }
 
 [ -f "/etc/board.json" ] || return 1
-
-/bin/config_generate
index 7f34eec88130afa49e16bb249f9d205e4096406e..80ed61b9e2dabf6f2f99102345be3da60097af3e 100755 (executable)
@@ -4,7 +4,7 @@ CFG=/etc/board.json
 
 . /usr/share/libubox/jshn.sh
 
-[ -f $CFG ] || exit 1
+[ -f $CFG ] || /bin/board_detect || exit 1
 [ -f /etc/config/network -a -f /etc/config/system ] && exit 0
 
 generate_static_network() {
index 4a2010ce8989ddca7ab36bcb19b3c3ca8d678444..904f7db75e90de1d22637e1649ac8305240656cd 100755 (executable)
@@ -47,7 +47,7 @@ boot() {
        }
        rm -f /tmp/wireless.tmp
 
-       /bin/board_detect
+       /bin/config_generate
        uci_apply_defaults
        
        # temporary hack until configd exists