diff options
author | Jonas Gorski <jonas.gorski@gmail.com> | 2016-08-13 14:04:23 +0200 |
---|---|---|
committer | Jonas Gorski <jonas.gorski@gmail.com> | 2016-08-13 15:49:51 +0200 |
commit | 780ccbf9f1ca60ecb6f125fb6d6d3a0652446685 (patch) | |
tree | fea929a86e99f5b060fe2a38896bbe01bfa835f7 /package/base-files/files/bin | |
parent | e934a129f086435a39c663375d41367a54783b39 (diff) | |
download | mtk-20170518-780ccbf9f1ca60ecb6f125fb6d6d3a0652446685.zip mtk-20170518-780ccbf9f1ca60ecb6f125fb6d6d3a0652446685.tar.gz mtk-20170518-780ccbf9f1ca60ecb6f125fb6d6d3a0652446685.tar.bz2 |
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 <jonas.gorski@gmail.com>
Diffstat (limited to 'package/base-files/files/bin')
-rwxr-xr-x | package/base-files/files/bin/board_detect | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/package/base-files/files/bin/board_detect b/package/base-files/files/bin/board_detect index 3a23381..f9640f0 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 |