feat: use fusefile virtual partition devices instead of loop devices
Metadata
Current evaluation
Merged PR replacing loop-device attachment with fusefile virtual partition files per volume slice; removes losetup and udev partition-node waits.
Resolution: closed resolved
Reason: PR #458 was merged after approval by two reviewers. It adds VirtualDeviceManager and gptutil.get_partition_slices, and removes all loop-device machinery.
Evaluated by: mr-cal-bot
No scores available.
Issue body
## Summary
Imagecraft no longer attaches disk images as loop devices. Each partition of a
volume is exposed as a `fusefile` virtual file mapped to a byte range of that
volume's image, so image builds need no `losetup`, no loop devices, and no
udev partition-node waits.
- `gptutil.get_partition_slices()` maps structure items to their
`(start_bytes, size_bytes)` via `sfdisk --json`; MBR volumes with >4
partitions number logicals from slot 5 (slot 4 is the extended container).
- `mount.VirtualDeviceManager` creates one virtual partition file per slice
under `<project>/.devices`, rolls back on failure, and retries failed
unmounts on teardown.
- `ImageService.attach_images()` mounts a manager per volume;
`get_device_paths()` maps volumes to image files and partitions to virtual
devices. `CRAFT_VOLUME_<VOLUME>[_<PARTITION>]` env vars are unchanged, now
pointing at those. All loop-device machinery removed.
## Testing
- `make lint` passes; `make test`: 378 passed, 23 skipped, 6 failed — all 6
are the pre-existing fakeroot FUSE tests, failing identically on base.
- Spread on ubuntu-24.04-64: 17 successful, 0 failed across `commons`, `pack`,
`plugins` (incl. `sector-write`, `grub`, `grub-boot-partition`, `mbr-grub`,
`overlay`). Logs show `fusefile` mounts, no `losetup`, `mke2fs`/`mkfs.vfat`
formatting virtual devices in place.
- Root-requiring integration tests keep the `requires_root` marker.
## Notes
- `fusefile` doesn't implement truncate: partition devices must be opened
`r+b`, not `O_TRUNC` (`EIO`). `mke2fs`/`mkfs.vfat` unaffected.
- `grub`/`grub-boot-partition`/`mbr-grub`/`overlay` spread tests still use
`losetup` in their own verification steps; harness-side, follow-up.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| ~deepseek/deepseek-pro-latest | — | closed resolved | Merged PR replacing loop-device attachment with fusefile virtual partition files per volume slice; removes losetup and udev partition-node waits. | |
| ~deepseek/deepseek-pro-latest |
Impact:
65
Quick Win:
14
Complexity:
75
Confidence:
80
Actionability:
85
|
needs review | Replaces loop-device attachment with fusefile virtual partition files per volume slice; removes losetup and udev partition-node waits. Approved by 2 reviewers, no unresolved comments, CI passing with slow tests pending. | |
| ~deepseek/deepseek-pro-latest |
Impact:
70
Quick Win:
10
Complexity:
80
Confidence:
75
Actionability:
75
|
needs review | Replaces loop-device image attachment with fusefile virtual partition devices; removes losetup/udev waits, adds VirtualDeviceManager and sfdisk slice mapping. Approved by 2 reviewers, 1 unresolved comment, CI passing with pending checks. | |
| ~deepseek/deepseek-pro-latest |
Impact:
62
Quick Win:
11
Complexity:
78
Confidence:
75
Actionability:
80
|
needs review | Replaces loop-device image attachment with fusefile virtual partition files per volume slice; removes losetup and udev waits. Approved by 2 reviewers, CI green, one unresolved review comment. | |
| ~deepseek/deepseek-pro-latest |
Impact:
70
Quick Win:
10
Complexity:
80
Confidence:
75
Actionability:
75
|
needs review | Replaces loop-device image attachment with fusefile virtual partition files per volume slice; removes losetup and udev waits. Approved, CI green, one unresolved review comment. | |
| ~deepseek/deepseek-pro-latest |
Impact:
68
Quick Win:
8
Complexity:
78
Confidence:
72
Actionability:
55
|
keep open | Replaces loop-device image attachment with fusefile virtual partition files per volume slice; removes losetup and udev waits. Approved but lint/files failing and one review comment unresolved. | |
| ~deepseek/deepseek-pro-latest |
Impact:
68
Quick Win:
10
Complexity:
75
Confidence:
68
Actionability:
58
|
needs review | Replaces loop-device image attachment with fusefile virtual partition files per volume slice; removes losetup and udev waits. Approved by one reviewer, but lint/files is failing and one review comment remains unresolved. | |
| ~deepseek/deepseek-pro-latest |
Impact:
70
Quick Win:
18
Complexity:
72
Confidence:
85
Actionability:
90
|
needs review | Replaces loop-device image attachment with fusefile virtual partition files per volume slice; removes losetup/udev waits. Approved, CI green, no unresolved comments. | |
| ~deepseek/deepseek-pro-latest |
Impact:
60
Quick Win:
17
Complexity:
68
Confidence:
72
Actionability:
88
|
needs review | Replaces loop-device image attachment with fusefile virtual partition files per volume slice; removes losetup/udev waits. Approved, CI green, pending snap builds. | |
| ~deepseek/deepseek-pro-latest |
Impact:
70
Quick Win:
14
Complexity:
75
Confidence:
78
Actionability:
80
|
needs review | Replaces loop-device image attachment with fusefile virtual partition files per volume slice; removes losetup/udev waits. Approved with one unresolved review comment; CI green except pending builds. | |
| ~deepseek/deepseek-pro-latest |
Impact:
75
Quick Win:
17
Complexity:
72
Confidence:
78
Actionability:
82
|
needs review | Replaces loop devices with fusefile virtual partition files via sfdisk slicing and managed teardown; approved, CI green, one unresolved review comment. | |
| ~deepseek/deepseek-pro-latest |
Impact:
70
Quick Win:
12
Complexity:
78
Confidence:
78
Actionability:
80
|
needs review | Replaces loop devices with fusefile virtual partition files, adds sfdisk-based partition slicing and managed teardown; approved, CI green, no unresolved comments. | |
| ~deepseek/deepseek-pro-latest |
Impact:
75
Quick Win:
14
Complexity:
80
Confidence:
80
Actionability:
95
|
needs review | Replaces loop devices with fusefile virtual partition files per volume slice; adds sfdisk-based partition slicing and managed teardown. Approved, CI green, no unresolved comments. | |
| ~deepseek/deepseek-pro-latest |
Impact:
70
Quick Win:
16
Complexity:
75
Confidence:
82
Actionability:
90
|
needs review | Replaces loop devices with fusefile virtual partition files, adds sfdisk-based partition slicing and managed teardown; approved, CI green, no unresolved comments. | |
| ~deepseek/deepseek-pro-latest |
Impact:
70
Quick Win:
12
Complexity:
75
Confidence:
75
Actionability:
70
|
needs review | Replaces loop devices with fusefile virtual partition files, adds sfdisk-based partition slicing and managed teardown; approved with green CI, 4 unresolved review comments addressed per author. | |
| stealth/space-bunny-alpha |
Impact:
66
Quick Win:
23
Complexity:
58
Confidence:
94
Actionability:
84
|
needs review | Replaces loop-mounted image partitions with fusefile-backed virtual devices, adds sfdisk-based slicing and managed teardown, and removes loop-device machinery. Approved with green CI; the author reports all review feedback addressed. | |
| qwen/qwen3.8-27b |
Impact:
72
Quick Win:
12
Complexity:
78
Confidence:
82
Actionability:
78
|
needs review | Replaces loop-device attachment in image builds with fusefile virtual partition devices (gptutil sfdisk slicing, VirtualDeviceManager with rollback/retry); all loop-device machinery removed. CI green, Copilot threads addressed, awaiting maintainer review. | |
| qwen/qwen3.8-27b |
Impact:
65
Quick Win:
9
Complexity:
80
Confidence:
78
Actionability:
72
|
needs review | Replaces loop-device attachment with fusefile virtual partition devices in the build pipeline: adds get_partition_slices() and VirtualDeviceManager, rewrites ImageService.attach_images, removes losetup code. +1049/-527, 21 files; CI green, in review. | |
| qwen/qwen3.8-27b |
Impact:
62
Quick Win:
8
Complexity:
78
Confidence:
70
Actionability:
58
|
needs review | Replaces loop-device attachment with fusefile virtual partition devices: adds gptutil.get_partition_slices() and a VirtualDeviceManager, rewires ImageService.attach_images, removes all losetup machinery. OSV-scanner failing, build checks pending. | |
| qwen/qwen3.8-27b |
Impact:
70
Quick Win:
10
Complexity:
75
Confidence:
80
Actionability:
55
|
needs review | Replaces loop device attachment with fusefile virtual partition devices (one per slice under .devices), removes losetup and node waiting logic, keeps CRAFT_VOLUME_* env vars. Under review: 0 reviewers, 1 unresolved comment, CI pending. | |
| qwen/qwen3.8-27b |
Impact:
65
Quick Win:
7
Complexity:
80
Confidence:
75
Actionability:
55
|
needs review | Refactors imagecraft to expose volume partitions as fusefile virtual devices instead of loop devices, adding get_partition_slices() and VirtualDeviceManager, rewiring Image/Lifecycle/Pack services. Builds on merged #437; in review, OSV-scanner failing. | |
| qwen/qwen3.8-27b |
Impact:
70
Quick Win:
10
Complexity:
75
Confidence:
75
Actionability:
55
|
needs review | Replaces loop-device attachment with fusefile virtual partition devices (new gptutil.get_partition_slices, VirtualDeviceManager, service rewiring). Blocker #437 merged; CI mostly green, OSV-scanner failing, builds pending; 1 unresolved review comment. | |
| qwen/qwen3.8-27b |
Impact:
70
Quick Win:
10
Complexity:
75
Confidence:
80
Actionability:
55
|
needs review | Replaces loop-device attachment with fusefile virtual partition devices: new gptutil.get_partition_slices() and mount.VirtualDeviceManager, ImageService mounts per-volume managers into .devices, PackService formats virtual devices in place. Under review, CI mostly pending, no failures. | |
| qwen/qwen3.8-27b |
Impact:
72
Quick Win:
7
Complexity:
80
Confidence:
76
Actionability:
52
|
needs review | Replaces loop-device attachment with fusefile virtual partition devices for image building; removes losetup/udev machinery. Large architectural change (+4384/-1757, 46 files). Open, 0 reviewers, 4 unresolved comments, CI mostly green (OSV-scanner failing, 2 spread pending). | |
| qwen/qwen3.8-27b |
Impact:
65
Quick Win:
5
Complexity:
75
Confidence:
82
Actionability:
30
|
keep open | Replaces loop devices with fusefile virtual partition devices for image building: gptutil partition slicing, VirtualDeviceManager, reworked attach/pack paths. 4 unresolved review comments, OSV-scanner failing, spread pending; blocked behind open PR #437. | |
| qwen/qwen3.8-27b |
Impact:
65
Quick Win:
6
Complexity:
80
Confidence:
80
Actionability:
45
|
keep open | Replace loop-device attachment with fusefile virtual partition devices for all volume partitions; removes losetup/udev polling. Blocked behind open PR #437; tests/lint green, OSV-scanner failing, builds pending, 4 unresolved review comments. | |
| qwen/qwen3.8-27b |
Impact:
70
Quick Win:
6
Complexity:
80
Confidence:
82
Actionability:
40
|
keep open | Replaces loop-device attachment (losetup, udev partition-node polling) with fusefile virtual partition devices for all volume partitions. Blocked by open PR #437; tests/lint green but OSV-scanner failing, builds pending, 4 review comments unresolved. | |
| qwen/qwen3.8-27b |
Impact:
75
Quick Win:
7
Complexity:
78
Confidence:
80
Actionability:
45
|
keep open | Replaces loop-device attachment with fusefile virtual partition devices: new gptutil.get_partition_slices() and mount.VirtualDeviceManager, rewiring ImageService/LifecycleService/PackService. Well-tested, but blocked behind #437 and OSV-scanner CI failing. | |
| qwen/qwen3.8-27b |
Impact:
55
Quick Win:
6
Complexity:
75
Confidence:
85
Actionability:
40
|
keep open | Replaces loop-device image attachment with fusefile virtual partition devices (gptutil slices, VirtualDeviceManager, service rewiring). Open, 0 reviewers, CI mostly green (OSV-scanner failing, builds pending); blocked behind #437. | |
| qwen/qwen3.8-27b |
Impact:
75
Quick Win:
4
Complexity:
80
Confidence:
80
Actionability:
30
|
keep open | Replaces loop-device attachment with fusefile virtual partition devices (new VirtualDeviceManager, gptutil.get_partition_slices). 1 day old, 0 reviews; blocked behind open PR #437; CI failing on lint/files, slow tests, and OSV-scanner. | |
| qwen/qwen3.8-27b |
Impact:
70
Quick Win:
5
Complexity:
78
Confidence:
82
Actionability:
35
|
keep open | Replaces loop-device image attachment with fusefile virtual partition devices via new gptutil.get_partition_slices() and mount.VirtualDeviceManager; rewires ImageService, LifecycleService, PackService. Blocked behind #437; CI partially pending, OSV-scanner failing. | |
| qwen/qwen3.8-27b |
Impact:
65
Quick Win:
6
Complexity:
75
Confidence:
85
Actionability:
35
|
keep open | Replaces loop-device image attachment with fusefile virtual partition devices (gptutil.get_partition_slices, mount.VirtualDeviceManager); removes losetup and udev node waiting. Blocked on #437; CI slow test-requires-root failing on all arches. | |
| qwen/qwen3.8-27b |
Impact:
70
Quick Win:
4
Complexity:
75
Confidence:
85
Actionability:
25
|
keep open | Replaces loop-device image attachment with fusefile virtual partition devices: new gptutil partition slicing, mount.VirtualDeviceManager, rewritten PackService/LifecycleService device env vars, loop-device machinery removed. Maintainer PR, 1 day old, review pending, blocked behind open PR #437; spread and root slow-test CI jobs failing. | |
| stealth/space-bunny-alpha |
Impact:
65
Quick Win:
2
Complexity:
88
Confidence:
62
Actionability:
25
|
keep open | Replaces loop-device image attachment with fusefile virtual partition devices: new gptutil partition slicing, mount.VirtualDeviceManager, rewritten PackService/LifecycleService device env vars, partition-node polling removed. Fresh maintainer PR blocked behind #437, root slow-test suites failing. |
Update history
| Date | Change |
|---|---|
| merged | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| created |
Related work
-
Related To:
canonical/imagecraft#428
(confidence 70%)
Added FUSE partition and volume mounting utilities that this PR builds upon.
-
Related To:
canonical/imagecraft#437
(confidence 50%)
Zero-mount bootloader installation work also touched loop-device handling.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #428 feat(utils): add FUSE partition and volume mounting utilities | imagecraft | merged | Merged #428 in commit 33e8c5d, adding FUSE mount utilities and polling for loop partition nodes to prevent an udev race. |