[LEDE-DEV] About /etc/board.json

Jo-Philipp Wich jo at mein.io
Fri Aug 4 02:05:28 PDT 2017


Hi Gio,

> - Should we consider this stable?

Yes.

> - Is there some specification on how to write a board.json file for 
> new hardware?

Right now the specification is the code in
package/base-files/files/lib/functions/uci-defaults.sh

> - From what I saw on devices I have under my hands the board.json 
> file doesn't come in the source code, but is generated by the old 
> scripts with all the hardware model big switch/case, is this to be 
> considered final or it is just a transition to shipping the 
> board.json file without the big switch/case?

Consider this a transitional mechanism, eventually the per-device rootfs
feature will allow to embed static board.json files directly into the
image, however this is not the case yet.

> - About switch ports in a TP-Link tl-wdr4310 I can see that port 0 
> has different properties that other ports, like +"device": "eth0"+ 
> can we consider this equivalent to "the switch is connected to the 
> CPU via port 0 and it is seen as eth0" in all cases?

Yes. Ports with a "device" attribute are "CPU ports". Keep in mind that
there might be multiple like 0 @ eth0 and 8 @ eth1.

> - How would board.json look like in case two switch chips are 
> present, can each switch have a port connected to the other switch 
> beside the one connected to the CPU?

Not sure if I understand the question correctly but the few supported
multi-switch devices I know do not have interconnected ports, they're
simply two distinct switches with distinct CPU ports hooked to distinct
netdevs. In order to join these switches, you'd have to software-bridge
their CPU port vlan devices.

> How would board.json look like if the other switch is connected only
>  to the other switch and not to the CPU?

There exists no such case iirc and there likely never will be one in the
future as the upcoming DSA architecture does not really support
"unconnected" switches.

> How would board.json look like if the other switch is connected to 
> the CPU only (this last seems simple to answhere)?

See attached example.json

> - In the TP-Link tl-wdr3500 there is a separate ethernet port eth1
> that is used as wan, in the board.json the only reference that i find
> to that port is as network.wan.ifname

That would be the authoritative source for "which netdev is expected to
serve as wan port".

> but there is not something like an "hardware description" like we 
> have for the switch section, is there any plan to inlude those extra
>  info like if it is gigabit, or the max MTU supported in board.json

There are no such plans

> or we have to guess the existence of ethernet ports iterating trought
> the childs of network ?

Yes.

> - There is no information about wifi devices, also in cases they are
>  soldered in the device, is there a plan to include that information
>  in board.json too or there is another place where one can get in 
> wifi devices information in an equivalent format (JSON)?

Either via "ubus call network.wireless status" or the iwinfo library
bindings.

> - There is already a JSON parsing/generation Lua library of choice
> in LEDE? (I suppose there is at least in Luci)

Package "luci-lib-jsonc" - despite its name it is mostly standalone,
only depending on liblua and libjson-c.

API docs at
http://htmlpreview.github.io/?http://raw.githubusercontent.com/openwrt/luci/master/documentation/api/modules/luci.jsonc.html



Regards,
Jo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: example.json
Type: application/json
Size: 1795 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/lede-dev/attachments/20170804/9bf64e32/attachment.json>


More information about the Lede-dev mailing list