Building custom image fails - cannot find "dtbs" in kernel info

I tried to build an updated image, from a model assertion that used to work.

While building, i get the error:

error: invalid layout of volume "pi": cannot resolve content for structure #0 at index 0: cannot find "dtbs" in kernel info from "/tmp/tmpja9b7g29/unpack/kernel"
COMMAND FAILED: snap prepare-image --snap=core20 --snap=core --snap=bluez --snap=crownstone-hub-manager --snap=crownstone-mongo --snap=crownstone-hub --snap=crownstone-hub-extension hub-model.model /tmp/tmpja9b7g29/unpack

The model:

{
  "type": "model",
  "series": "16",
  "model": "ubuntu-core-18-pi-arm64",
  "display-name":"Ubuntu Core 18 (pi generic arm64)",
  "architecture": "arm64",
  "kernel": "pi-kernel=18-pi",
  "gadget": "pi=18-pi",
  "base": "core18",
  "required-snaps": [],
  "authority-id": "W5K2fnuLutqC48vO5w9i35VCLofhFYA6",
  "brand-id": "W5K2fnuLutqC48vO5w9i35VCLofhFYA6",
  "timestamp": "2020-09-02T14:25:58+00:00"
}

Any idea what changed that it fails to build now?

I have the same problem with building an image with the model assert that worked previously.

error: invalid layout of volume "pi": cannot resolve content for structure #0 at index 0: cannot find     "dtbs" in kernel info from "/tmp/tmpldy5e63i/unpack/kernel"
ERROR:ubuntu-image:COMMAND FAILED: snap prepare-image --customize=/tmp/tmpldy5e63i  /customization ./model/composer-rpi.model /tmp/tmpldy5e63i/unpack

Here is the model:

{
"type": "model",
"series": "16",
"model": "composer-net-18-rpi",
"display-name":"Composer Network Bridge (Ubuntu Core 18)",
"architecture": "armhf",
"base": "core18",
"kernel": "pi-kernel=18-pi",
"gadget": "pi=18-pi",
"required-snaps": ["network-manager", "composer-net-bridge"],
"authority-id": "IKgX8ngp5Y0I26iGBNOdRgHjsllPiwSZ",
"brand-id": "IKgX8ngp5Y0I26iGBNOdRgHjsllPiwSZ",
"timestamp": "2020-11-05T14:45:09+00:00"
}

Is anything changed? What is the correct way to build the UC18 image now?

please see:

2 Likes

Thank you!
I’ve checked the pi gadget Github repo, and all required changes are already there. However, it seems that these changes are not on the stable channel yet.
And as far as I know, there is no way to switch to the edge channel for gadget snap in the UC18 model assertion.
Is there any info on when will it be available in stable, and how to build the image now?

You can download the snap from edge via UBUNTU_STORE_ARCH=arm64 snap download pi --channel=18-pi/edge --basename=pi-from-edge and then when building the image with ubuntu-image do ubuntu-image snap model --snap pi-from-edge.snap. That won’t set the tracking channel IIRC, but it will at least allow you to create the image

2 Likes

Thank you! However, setting the tracking channel is also needed in our particular case… Is there any timeline for moving these changes to stable?

Maybe @juergh or @waveform could comment on that

Hello, it seems like building Core18 image with a custom kernel and gadget, it fails.

kernel kernel.yaml --> kernel/meta/kernel.yaml:

assets:
  dtbs:
    update: true
    content:
      - dtbs/

kernel snapcraft.yaml -> kernel/snap/snapcraft.yaml:

architectures:
  - build-on: amd64
    run-on: arm64

assumes:
  - kernel-assets

gadget.yaml --> gadget/gadget.yaml:

device-tree: bcm2711-rpi-cm4
volumes:
  pi:
    schema: mbr
    bootloader: u-boot
    structure:
      - type: 0C
        filesystem: vfat
        filesystem-label: system-boot
        size: 256M
        update:
          edition: 1
        content:
          - source: $kernel:dtbs/dtbs/broadcom/
            target: /
          - source: $kernel:dtbs/dtbs/overlays/
            target: /overlays
          - source: boot-assets/
            target: /

gadget snapcraft.yaml --> gadget/snapcraft.yaml:

type: gadget
base: core18
assumes: [kernel-assets]

Can someone tell me what am I doing wrong?

The ubuntu-image command fails with:

error: invalid layout of volume "pi": cannot resolve content for structure #0 at index 0: cannot find "dtbs" in kernel info from "/tmp/tmphe_t2rbj/unpack/kernel"

Are the names of your custom kernel / gadget snaps matching between what you put in the snapcraft.yaml/snap.yaml for the gadget and the model and same for the kernel?

Hello, apologies for the late reply. Yes, they are matching in the model file (blade-kernel and blade-gadget, ‘blade’ is the board’s nickname)

Funny enough, if I remove the $kernel:$dtbs:/dtbs/overlays/ and $kernel:dtbs/dtbs/broadcom/ references, it seems to compile a image?

Not sure how that works. On another topic, it seems like that u-boot is not booting the image that comes out of this.

(I manually copied the files like where it should be, dtbs on the root folder, overlays folder also on the root folder)

EDIT: For anyone encountering this, can be solved with Changes in pi/pi-kernel DTB handling

I’m having the same issue on my device rpi with core18 based on pi-gadget, albeit when installing it on an existing device.

I can’t update the pi-kernel due to

Update assets from kernel "pi-kernel" (357)
2021-10-28T16:55:59+02:00 ERROR gadget does not consume any of the kernel assets needing synced update "dtbs"

And I can’t update the gadget due to

error: cannot perform the following tasks:
- Update assets from gadget "my-gadget" (unset) (cannot resolve content for structure #0 at index 0: cannot find "dtbs" in kernel info from "/snap/pi-kernel/326")

$ ls /snap/pi-kernel/current/dtbs/
bcm2708-rpi-b-plus.dtb  bcm2708-rpi-zero-w.dtb  bcm2710-rpi-2-b.dtb       bcm2710-rpi-cm3.dtb   ...