← 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

Importing gadget.yaml volume layouts into imagecraft.yaml remains open under design discussion, with gadget/snapd consistency and import semantics unresolved.

Suggested action: keep open

Reason: The Triaged enhancement remains valid: current documentation still requires users to copy gadget volumes and manually remove unsupported fields. A maintainer welcomed broader review, but another raised a substantive consistency risk because Imagecraft cannot update a store gadget and imported layouts could diverge from what snapd uses.

Evaluated by: mr-cal-bot

Impact: 58 Quick Win: 5 Complexity: 84 Confidence: 92 Actionability: 55

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
stealth/space-bunny-alpha
Impact: 58
Quick Win: 5
Complexity: 84
Confidence: 92
Actionability: 55
keep open Importing gadget.yaml volume layouts into imagecraft.yaml remains open under design discussion, with gadget/snapd consistency and import semantics unresolved.
qwen/qwen3.6-35b-a3b
Impact: 70
Quick Win: 28
Complexity: 50
Confidence: 80
Actionability: 80
keep open Enhancement to allow imagecraft.yaml to reuse volume definitions from gadget.yaml instead of duplicating partition layouts.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 10
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.

Update history

No update history recorded yet.

Related work

  • Related To: imagecraft#304 (confidence 84%)

    Multiple-volume support is also open, and the current model documents a single explicit volume; this may constrain imports of arbitrary gadget volume layouts.

Related issues

No related issues found above the similarity threshold.