can't use a gadget with a base when building a classic image with snap prepare-image

Bug #1834064 reported by Ian Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Released
Medium
Samuele Pedroni

Bug Description

When trying to seed a classic image with `snap prepare-image`, if the gadget that is being included has a base, snapd refuses to seed the gadget snap unless a base is specified for the model:

```
$ sudo snap prepare-image --classic server-model.assert /tmp/img --snap edgex-pi-gadget/edgex-pi_18-1_armhf.snap
Fetching core
Copying "edgex-pi-gadget/edgex-pi_18-1_armhf.snap" (edgex-pi)
error: cannot use gadget snap because its base "core18" is different from model base ""
```

However adding a base to the model is not allowed by snap sign:

```
$ cat server-model.json | snap sign -k edgex-testing
error: cannot assemble assertion model: cannot specify a base with a classic model
```

Example server-model.json:

```
{
  "type": "model",
  "authority-id": "some-id",
  "brand-id": "some-id",
  "series": "16",
  "model": "edgex-rpi-delhi",
  "architecture": "arm64",
  "classic": "true",
  "base": "core18",
  "gadget": "edgex-pi",
  "required-snaps": [
    "edgexfoundry",
    "node-red",
    "edgex-device-grove"
  ],
  "timestamp": "2019-06-18T17:03:50+00:00"
}
```

This is problematic when trying to use the same gadget snap for both a classic image and a core image for the same physical hardware setup (to provide users both a ubuntu server image using these snaps and a ubuntu core image using these snaps). The gadget snap is necessary on a classic device so that there is slots for device access to use with strictly confined snaps.

Zygmunt Krynicki (zyga)
Changed in snapd:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Samuele Pedroni (pedronis) wrote :

this should have been fixed here:

https://github.com/snapcore/snapd/pull/7135

Changed in snapd:
assignee: nobody → Samuele Pedroni (pedronis)
status: Triaged → Fix Committed
Revision history for this message
Samuele Pedroni (pedronis) wrote :

fix should be in snapd 2.42

Changed in snapd:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.