openwrtv3/package/base-files/files/bin/board_detect
John Crispin 562d9f9582 base-files: add a hardware detection layer
this allows targets to use the new uci-default helper which will generate
a file called /etc/board.json. a tool called /bin/config_generate can then
be used to generate the default uci settings.

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42185
2014-08-18 13:09:17 +00:00

14 lines
265 B
Bash
Executable file

#!/bin/sh
[ -d "/etc/board.d/" -a ! -f "/etc/board.json" ] || {
for a in `ls /etc/board.d/*`; do
[ -x $a ] || continue;
$(. $a)
done
}
[ -f "/etc/board.json" ] || return 1
[ -f "/etc/config/network" ] || {
touch /etc/config/network
/bin/config_generate
}