Best place to add udev rules to a core image

When building a core image for devices that require custom udev rules to function properly, where is the ideal place to put these rules and have them installed? To me, the most intuitive place would be the Prepare-Device Hook of the gadget snap. Another alternative would be to use the Custom-Device Interface. However, the custom-device interface seems to be designed more for snaps that need access to a particular device, not for simply adding rules to /etc/udev/rules.d.

I’m curious what the best practices are here.

Hi joshuamoler,

Would you please explain what you want to achieve with the rules you want to add/why you need them, and perhaps even an small example of what you have in mind?