Building Custom Image for Pi CM3

I’m looking at using Ubuntu Core for an upcoming project and I’m just getting started with building a custom image so I can override the default device tree. To keep things simple, I’m just trying to build a default image using these instructions.

I’ve created a model assertion as follows:

{
  "type": "model",
  "authority-id": "xxxxx",
  "brand-id": "xxxxx",
  "series": "16",
  "model": "test-core-16",
  "architecture": "armhf",
  "base": "core",
  "gadget": "cm3",
  "kernel": "pi2-kernel",
  "timestamp": "2019-01-16T18:43:13+00:00"
}

After I sign this and try to build I get:

$ sudo ubuntu-image -c stable -O test-core-16 test-core-16.model
Warning: for backwards compatibility, `ubuntu-image` falls back to `ubuntu-image snap` if no subcommand is given
Fetching snapd
Fetching core
Fetching pi2-kernel
Fetching cm3
error: cannot use gadget snap because its base "" is different from model base "core"
COMMAND FAILED: snap prepare-image --channel=stable explore-m-16.model /tmp/tmp36omeagx/unpack

Also, if I try to specify a custom gadget snap like this:

{
  "type": "model",
  "authority-id": "xxxxx",
  "brand-id": "xxxxx",
  "series": "16",
  "model": "test-core-16",
  "architecture": "armhf",
  "base": "core",
  "gadget": "cm3_16.04-0.6_armhf.snap",
  "kernel": "pi2-kernel",
  "timestamp": "2019-01-16T18:43:13+00:00"
}

I end up with:

$ sudo ubuntu-image --extra-snaps cm3_16.04-0.6_armhf.snap -c stable -O test-core-16 test-core-16.model
Warning: for backwards compatibility, `ubuntu-image` falls back to `ubuntu-image snap` if no subcommand is given
error: cannot use snap "cm3_16.04-0.6_armhf.snap", parallel snap instances are unsupported
COMMAND FAILED: snap prepare-image --channel=stable explore-m-16.model /tmp/tmpgujm15xl/unpack

I’ve been digging around the documentation and understand what a parallel snap is, but I can’t figure out how to build this snap just for the CM3.

Any suggestions would be greatly appreciated.

Thanks,
Brent

your first model with using just the snap name (instead of the filename) for the gadget was correct, just try to drop the base: core line completely …