mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 06:08:08 +00:00
base-files: board.d: auto-set model id and name if /tmp/sysinfo is available
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47752
This commit is contained in:
parent
f961a3826e
commit
61a99da4f9
@ -543,6 +543,16 @@ ucidef_set_rssimon() {
|
|||||||
board_config_update() {
|
board_config_update() {
|
||||||
json_init
|
json_init
|
||||||
[ -f ${CFG} ] && json_load "$(cat ${CFG})"
|
[ -f ${CFG} ] && json_load "$(cat ${CFG})"
|
||||||
|
|
||||||
|
# auto-initialize model id and name if applicable
|
||||||
|
if ! json_is_a model object; then
|
||||||
|
json_select_object model
|
||||||
|
[ -f "/tmp/sysinfo/board_name" ] && \
|
||||||
|
json_add_string id "$(cat /tmp/sysinfo/board_name)"
|
||||||
|
[ -f "/tmp/sysinfo/model" ] && \
|
||||||
|
json_add_string name "$(cat /tmp/sysinfo/model)"
|
||||||
|
json_select ..
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
board_config_flush() {
|
board_config_flush() {
|
||||||
|
Loading…
Reference in New Issue
Block a user