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>
This commit is contained in:
parent
e934a129f0
commit
780ccbf9f1
2 changed files with 6 additions and 4 deletions
|
@ -1,10 +1,14 @@
|
||||||
#!/bin/sh
|
#!/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
|
for a in `ls /etc/board.d/*`; do
|
||||||
[ -x $a ] || continue;
|
[ -x $a ] || continue;
|
||||||
$(. $a)
|
$(. $a)
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -f "/etc/board.json" ] || return 1
|
[ -f "$CFG" ] || return 1
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#!/bin/ash
|
#!/bin/ash
|
||||||
|
|
||||||
CFG=/etc/board.json
|
|
||||||
|
|
||||||
. /lib/functions.sh
|
. /lib/functions.sh
|
||||||
. /usr/share/libubox/jshn.sh
|
. /usr/share/libubox/jshn.sh
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue