Hi @reinzor ,
The UDEV rules can go into config.json. The process is described here: https://jel.ly.fish/4592e980-3db9-4059-9aa8-dc4324b7f577.
The config.json file can be found on the running device in /mnt/boot or on the boot partition of your SD-card / flash image.
IPTables rules can be added from within an application container with host networking enabled (and possibly privileged mode too). You need be very careful to make sure you do not interfere with the IPtables rules set by docker.
We managed to set-up the udev rules and system-connections properly:
Download image using balena os download
Mount partition and modify config.json + system-connections
Use resulting app_name_<version>.img for flashing our devices
Now the second question arises: how do we manage updates of our config.json file? I can imagine that we would like to add a new udev rule for example. We have the following questions:
Can we get a version / hash of the current config.json of a device?
Can we update the config.json of a device remotely? Is there an interface for this?
Unfortunately at the moment you will have to go through the same process you outlined above and basically reflash the device every time.
Another option is this experimental project: https://github.com/balena-io-playground/configizer. If you decide to go with this, please be aware that it is not tested as extensively as we feel it should be. Which is the reason for it being in the “playground” org.
Make sure you try it in a dev environment first to ensure it fits your usecase.