base-files: allow setting device and bridge macs
Add code for setting mac addresses inside board.json and rendering them out to uci. On switches we want to have a unique MAC on each port. With 48 port switches that would require 48 device sections in /etc/config/network. Doing so via board.json is easier. Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -91,7 +91,23 @@ ucidef_set_interfaces_lan_wan() {
|
||||
}
|
||||
|
||||
ucidef_set_bridge_device() {
|
||||
json_add_string bridge "${1:switch0}"
|
||||
json_select_object bridge
|
||||
json_add_string name "${1:switch0}"
|
||||
json_select ..
|
||||
}
|
||||
|
||||
ucidef_set_bridge_mac() {
|
||||
json_select_object bridge
|
||||
json_add_string macaddr "${1}"
|
||||
json_select ..
|
||||
}
|
||||
|
||||
ucidef_set_network_device_mac() {
|
||||
json_select_object "network-device"
|
||||
json_select_object "${1}"
|
||||
json_add_string macaddr "${2}"
|
||||
json_select ..
|
||||
json_select ..
|
||||
}
|
||||
|
||||
_ucidef_add_switch_port() {
|
||||
|
||||
Reference in New Issue
Block a user