3
Random notes
Stijn Tintel edited this page 2022年12月07日 16:35:48 +00:00
Table of Contents
config_generate
- check if /etc/board.json exists
- run /bin/board_detect if it doesn't
- if that fails, exit
Run steps manually:
source /usr/share/libubox/jshn.sh
json_init
json_load "$(cat /etc/board.json)"
json_get_keys keys network
for key in $keys; do echo $key; done
So for each element under network in the json, generate_network is called. (削除) In generate_network, the variable ipaddr is used for any network with static IP, so if we seed that ipaddr variable somewhere, devices with multiple networks using static configs will have the same IP on all of them. Sigh. (削除ここまで)
The ipaddr variable is local to the generate_network function, so it cannot be seeded by exporting it in a uci-defaults file or so. It is read from /etc/board.json.
board_detect
- tests if /etc/board.json exists
- if not, and /etc/board.d/ is a directory, it sources all files in that directory
- those files call board_config_update and board_config_flush, which writes /etc/board.json