← Back to issue list

Support using gadget.yaml volumes as a source for imagecraft.yaml volume definitions

View original Github issue

Metadata

Project
imagecraft
Number
#258
Type
issue
State
open
Author
alderic-coroir
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed

Current evaluation

Enhancement to let imagecraft.yaml import volumes from the gadget snap's meta/gadget.yaml instead of duplicating the layout. Triaged and discussed; a maintainer noted snapd reads the gadget directly, so overrides risk a disconnect. No work planned this cycle.

Suggested action: keep open

Reason: The issue is explicitly triaged (labels 'Status: Triaged', 'Type: Enhancement') and has substantive maintainer engagement: lengau asked for 'a broad variety of opinions on this and its possible pitfalls' and dilyn-corner responded with a concrete design concern that imagecraft 'cannot modify what the gadget states' since snapd reads it directly, suggesting a snapd change might be needed. It is not stale-irrelevant (feature unimplemented, concern unresolved) and not a support request, so it should stay open pending that design decision, though it is deprioritized ('unlikely to work on this this cycle').

Impact: 40 Quick Win: 10.0 Staleness: 65 Complexity: 75 Confidence: 70 Support Request: 0

Issue body

### Check existing issues - [x] I've verified that this request isn't described by any existing issues. ### Request ### What I’d like to see Allow `imagecraft.yaml` to reuse (or import) the `volumes` definition from the gadget snap’s `meta/gadget.yaml`, instead of requiring users to duplicate the same partition/volume layout in `imagecraft.yaml`. ### Proposed UX / configuration A simple mechanism such as one of the following: - A boolean flag: - `volumes: from-gadget: true` - An explicit source: - `volumes: from-gadget: <path-to-gadget.yaml>` (optional override) - Or a special volume entry: - `volumes: gadget` In all cases, the default behavior stays unchanged: if `imagecraft.yaml` defines volumes explicitly, that remains the source of truth. ### Expected behavior - If enabled, Imagecraft should: 1. Locate the gadget snap used for the image build (from the model assertion and/or user-provided gadget override). 2. Read `meta/gadget.yaml` from the gadget snap. 3. Use the `volumes` section to drive disk layout creation (partition table type, partitions, filesystem types, labels, sizes/offsets, boot assets where applicable). - `imagecraft.yaml` should still be able to override specific values (optional, if feasible), but at minimum the gadget should be usable as the canonical definition. ### Notes - The `volumes` data in the gadget is already the authoritative source for the Ubuntu Core disk layout; duplicating it in `imagecraft.yaml` is error-prone. - This is particularly useful for multi-arch and custom gadgets where the volume definition is the most stable, accurate layout description. ### The problem it solves ### Current pain Today, building Ubuntu Core images with Imagecraft requires duplicating volume/partition layout information in `imagecraft.yaml`, even though the exact same information already exists in the gadget snap’s `meta/gadget.yaml` (`volumes` section). This duplication: - introduces drift (changes in gadget.yaml are easy to forget to mirror in imagecraft.yaml), - creates avoidable build errors (wrong partition flags, filesystem type, ESP formatting, missing boot assets), - makes maintenance harder for custom gadgets and multi-architecture builds.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 40
Quick Win: 10.0
Staleness: 65
Complexity: 75
Confidence: 70
Support Request: 0
keep open Enhancement to let imagecraft.yaml import volumes from the gadget snap's meta/gadget.yaml instead of duplicating the layout. Triaged and discussed; a maintainer noted snapd reads the gadget directly, so overrides risk a disconnect. No work planned this cycle.
qwen/qwen3.6-35b-a3b
Staleness: 65
Complexity: 80
Confidence: 75
Support Request: 10
keep open Enhancement request to let imagecraft reuse volume definitions from gadget.yaml, avoiding duplication. Currently under maintainer review but deferred due to architectural concerns regarding snapd integration. Last active ~183 days ago.
qwen3.6-35b-a3b-mtp-q6
Staleness: 55
Complexity: 80
Confidence: 60
Support Request: 0
keep open Enhancement to allow imagecraft.yaml to reuse volume definitions from gadget.yaml, avoiding duplication. Currently under architectural discussion regarding snapd integration and store vs local gadget handling.
qwen3.6-35b-a3b-mtp-q6
Staleness: 60
Complexity: 80
Confidence: 75
Support Request: 0
keep open Enhancement to allow imagecraft.yaml to reuse volume definitions from gadget.yaml, avoiding duplication. Currently triaged, under discussion for architectural feasibility and potential pitfalls.
qwen3.6-35b-a3b-mtp-q6
Staleness: 70
Complexity: 65
Confidence: 75
Support Request: 5
keep open Enhancement to inherit volume layouts from gadget.yaml in imagecraft.yaml, preventing duplication and drift. Triaged and under discussion. Maintainers flag conflicts with snapd's gadget parsing, suggesting snapd changes or local support. Awaiting feedback.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#303 Gadget snap extension imagecraft open Feature request to add a gadget snap extension that reads values from a local gadget snap and applies them to imagecraft.yaml, reducing duplication. Depends on implementing extensions support, which is not yet in the codebase. Open, unlabelled, one maintainer comment.
74%
#4344 Treat the gadget.yaml like other snap meta files snapcraft open Enhancement to move gadget.yaml source location from project root to snap/gadget.yaml for consistency with other snap meta files. Triaged, acknowledged by maintainer who linked it to issue #4892 as a prerequisite. Code still reads from root; not yet implemented.
71%