Querying bridge dev and hotplug scripting 802.1q management

With a DSA deployed device the 802.1q tag/untag state and related VID/PVID of downstream interfaces (lan and bridge) management is gone from UCI/LuCI and I am trying to figure a way to retain 802.1q management through node reboots.

bridge -b provides a batch option which might be a way to go about in a hotplug script which would have to achieve:

  • deleting VID 1 that is being assigned as default to all bridge and enslaved devices as well as adding designated 802.1q data to each bridge and enslaved device

What would be the most suitable (performant) way to:

  • querying the device names (bridges and slaves)?
  • discover when the devices are generated and are available for 802.1q management (hot plugging) since an init script is probably not the best way considering a fixed start priority?

Is there a library that provides such functionality instead of some userland?