Comment 0 for bug 2044305

Revision history for this message
Ondrej Kubik (ondrak) wrote :

When building preseeded images, auto connections defined by the gadget snap are ignored.

At a closer look, this is caused by the wrong slot side mapping. By default "system" slots are mapped to the "core" snap, and on the systems with snapd snap installed, "system" slots are mapped to the snapd snap.
The correct interface mapper is selected at the interface manager start-up by calling m.selectInterfaceMapper(snaps), this inspects the list of the snaps and if any is "snapd" core-snapd mapper is selected instead of the default one.

This logic relies on the fact that the system state already contains the list of the snaps, but this is not the case when building preseeded images, when we start the interface manager before we load the seed, and the snap list is empty.

This results in all the connections to the system slots being mapped to "core" snap, which is not present on the system, so those auto connections defined by the gadget snap are ultimately ignored.

m.selectInterfaceMapper(snaps):
https://github.com/snapcore/snapd/blob/master/overlord/ifacestate/ifacemgr.go#L152