What is the right snap to update system-level configuration?

We are using Ubuntu Core in an embedded device (no display, no keyboard) and have a need to add new kernel options to /etc/sysctl.d to restart the kernel on a panic. What snap is appropriate for applying these kinds of changes in install and post-refresh hooks? When we first did our Smart Start way back in 2021 for one of our devices, the guidance was to have a “device model” snap where system-level configuration changes should go rather than using the gadget snap. It feels like the gadget snap would be the right place to do these kinds of things because it is device model-specific. What is the current best practice?

Also note that we might have been recommended to use a device model snap for this because we were also using refresh control to lock down third-party snaps. However, for the new device we are building, we switched to validation sets that doesn’t need a gating snap. Our device model snap doesn’t do anything right now and wonder if we even need it anymore.

You should indeed be able to simply use a system-files interface from the gadget …

Though the advice to split config into a separate snap is sane since this will not force you to update the gadget when you do changes (which might trigger a reboot) …

Also note that the install hook is actually only run when the snap gets installed but never again during its lifetime so better use either the post-refresh hook (as you already noted above) or even the configure hook …

That is a really good point on gadget snap refreshing require a reboot. That was the kind of information I was looking for. Thanks!