← Back to issue list

Support `kernel.yaml` similar to `gadget.yaml`

View original Github issue

Metadata

Project
snapcraft
Number
#4982
Type
issue
State
open
Author
dilyn-corner
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed
—

Current evaluation

Enhancement to handle kernel.yaml as a first-class metadata file (looked up alongside snap/snapcraft.yaml). Core support already exists (copied from project root to meta/ for core22 and mediated for core24+), but snap/kernel.yaml placement is unimplemented; design agreed with maintainer, tracked as CRAFT-3263.

Suggested action: keep open

Reason: The issue is labelled 'Status: Triaged, Type: Enhancement' and maintainer @mr-cal explicitly endorsed the design ('We can start with the same design as a snapcraft.yaml file where snapcraft first looks for snapcraft.yaml then looks for snap/snapcraft.yaml'), with the reporter agreeing to allow both locations plus a notice. The feature is only partially in place: snapcraft/parts/setup_assets.py:104 still reads only `project_dir / "kernel.yaml"` and snapcraft/services/package.py:123 (`_read_project_metadata_file`, package.py:539) likewise only looks in the project root, never `snap/` or `build-aux/snap/`, so the remaining ask (snap/kernel.yaml support) is still unimplemented and remains valid. The reporter's last comment states 'this issue is now basically identical to #4344', which is why the design is well-scoped but slightly ambiguous in ownership.

Evaluated by: mr-cal-bot

Impact: 30 Quick Win: 18 Complexity: 22 Confidence: 85 Actionability: 75

Issue body

### What needs to get done The `kernel.yaml` file in kernel snaps should be a supported metadata file similar to `snapcraft.yaml`, `hooks/*`, etc. It should be moved by Snapcraft to the `meta/` directory. ### Why it needs to get done The `kernel.yaml` file integrates the kernel snap with the gadget snap, allowing kernel assets to be leveraged by the gadget snap during image creation time. A primary use-case for this is sharing things like DTB files. For instance, see [the pi-gadget](https://github.com/snapcore/pi-gadget/blob/8067a8e903f534f22dc428cc26c940b6b4fe8914/gadget.yaml#L14). Supporting `kernel.yaml` will make supporting `assumes: [kernel-assets]` more meaningful, as that is a stated purpose of the `assumes`. `kernel-assets` has been an existent feature for three years and is not marked as experimental. https://github.com/canonical/snapd/blame/d1ab1252636424044a97e596659c296441fdcfb4/overlord/snapstate/check_snap.go#L53 Tangentially related to this request is supporting the `gadget.yaml` similar to other metadata files (see https://github.com/canonical/snapcraft/issues/4344), and I think that if this feature request is accepted both the `gadget.yaml` and `kernel.yaml` should be supported in similar ways.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 30
Quick Win: 18
Complexity: 22
Confidence: 85
Actionability: 75
keep open Enhancement to handle kernel.yaml as a first-class metadata file (looked up alongside snap/snapcraft.yaml). Core support already exists (copied from project root to meta/ for core22 and mediated for core24+), but snap/kernel.yaml placement is unimplemented; design agreed with maintainer, tracked as CRAFT-3263.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 17
Complexity: 30
Confidence: 80
Actionability: 80
keep open Enhancement to support kernel.yaml in snap/ directory for consistency with snapcraft.yaml. Triaged, acknowledged by maintainer, still needs implementation.
qwen/qwen3.8-27b
Impact: 30
Quick Win: 22
Staleness: 75
Complexity: 25
Confidence: 88
Support Request: 10
close stale Request to support kernel.yaml as a snap metadata file moved to meta/ by Snapcraft. Core feature implemented via PR #3464 and #6369; remaining gadget.yaml location work tracked in #4344. Inactive 461 days.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 45
Confidence: 70
Support Request: 10
keep open Enhancement to support kernel.yaml as a metadata file in kernel snaps. Triaged and scoped, with maintainer design feedback provided. Currently awaiting implementation or further tracking.
qwen3.6-35b-a3b-mtp-q6
Staleness: 75
Complexity: 40
Confidence: 80
Support Request: 5
keep open Enhancement to support kernel.yaml as a metadata file in kernel snaps, mirroring gadget.yaml handling. Triaged, with maintainer design feedback and backward compatibility discussion. Currently inactive but tracked alongside related issue 4344.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#4344 (confidence 85%)

    Both files are handled by the same code paths (setup_assets.py:99-106 and package.py:89-123), so any fix must change both gadget.yaml and kernel.yaml lookup symmetrically.

  • Duplicate Of: canonical/snapcraft#4344 (confidence 60%)

    The author wrote 'Either way, this issue is now basically identical to #4344' and #4344 ('Treat the gadget.yaml like other snap meta files') is still open with the same unimplemented snap/-directory placement; both should be handled together, but neither has a merged fix so this one must stay open.

Related issues

No related issues found above the similarity threshold.