Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47752
3c298f89-4303-0410-b956-
a3cf2f4a3e73
board_config_update() {
json_init
[ -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() {