Changeset 47752


Ignore:
Timestamp:
2015-12-04T12:06:57+01:00 (2 years ago)
Author:
jow
Message:

base-files: board.d: auto-set model id and name if /tmp/sysinfo is available

Signed-off-by: Jo-Philipp Wich <jow@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/base-files/files/lib/functions/uci-defaults-new.sh

    r47750 r47752  
    544544        json_init 
    545545        [ -f ${CFG} ] && json_load "$(cat ${CFG})" 
     546 
     547        # auto-initialize model id and name if applicable 
     548        if ! json_is_a model object; then 
     549                json_select_object model 
     550                        [ -f "/tmp/sysinfo/board_name" ] && \ 
     551                                json_add_string id "$(cat /tmp/sysinfo/board_name)" 
     552                        [ -f "/tmp/sysinfo/model" ] && \ 
     553                                json_add_string name "$(cat /tmp/sysinfo/model)" 
     554                json_select .. 
     555        fi 
    546556} 
    547557 
Note: See TracChangeset for help on using the changeset viewer.