From: Jonas Gorski Date: Sat, 13 Aug 2016 12:04:23 +0000 (+0200) Subject: base-files: board_detect: allow specifying the generated file X-Git-Tag: v17.01.0-rc1~1741 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=780ccbf9f1ca60ecb6f125fb6d6d3a0652446685;p=oweals%2Fopenwrt.git base-files: board_detect: allow specifying the generated file Allow passing a filename to change the location of the generated board.json. Signed-off-by: Jonas Gorski --- diff --git a/package/base-files/files/bin/board_detect b/package/base-files/files/bin/board_detect index 3a23381c2c..f9640f0388 100755 --- a/package/base-files/files/bin/board_detect +++ b/package/base-files/files/bin/board_detect @@ -1,10 +1,14 @@ #!/bin/sh -[ -d "/etc/board.d/" -a ! -f "/etc/board.json" ] && { +CFG=$1 + +[ -n "$CFG" ] || CFG=/etc/board.json + +[ -d "/etc/board.d/" -a ! -f "$CFG" ] && { for a in `ls /etc/board.d/*`; do [ -x $a ] || continue; $(. $a) done } -[ -f "/etc/board.json" ] || return 1 +[ -f "$CFG" ] || return 1 diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index 8c954374a9..a88308bbd0 100755 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -1,7 +1,5 @@ #!/bin/ash -CFG=/etc/board.json - . /lib/functions.sh . /usr/share/libubox/jshn.sh