Shipping custom files in host system

I need to ship a file in /etc/udev/rules.d/78-mm-custom.rules in the host balena OS, including some custom ModemManager rules.

How can I do that so that it gets automatically included when building the images via balena-cli push?

Looks like what I need to achieve can be done via udevrules configuration in config.json, as per GitHub - balena-os/meta-balena: A collection of Yocto layers used to build balenaOS images.

Not sure how to get that config.json update included automatically in by builds though. Do I really need to download and modify the system image manually to include the changes in the boot partition? or is there some other way to do that?

Hello @aleksander0m if i understood properly, for new images you can configure the OS image running this balena CLI Documentation - Balena Documentation

However what I understand is that you need to update on runtime the hostOS of your fleet devices, is that correct?

Bon dia @mpous!

What I need to have is custom udev rules installed.

I originally assumed I could ship a custom udev rules file in the host system somehow, hence the title of the post, but it looks like the way to do this in balena is to provide (correct me if wrong!) a os/udevRules entry in the config.json shipped in the boot partition, as per Configuration - Balena Documentation.

Now, I was wondering how to have my own config.json modifications shipped in the images generated via by default, and so far I found no way to cleanly do that. Is that really not possible?

What I can do is to use the balena configizer to publish new udev rules easily once the device is in the cloud, but that forces me to do that for every new device added to the fleet.

Am I missing something? Can I provide my own os/udevRules entries somehow so that they get added automatically in the generated images?

@aleksander0m once you use balena os config then you can use that OS image to flash the next devices that will join the fleet. You can’t modify the balenaOS image that you download from the balenaCloud dashboard i think.

Is that not possible on your workflow? did you test?

Didn’t test, but it probably also fits what we need to do, yes. Thanks!

1 Like

Let us know if that works @aleksander0m and let us know how we can help you more :slight_smile: