← Back to issue list

feat(grub): install EFI GRUB without loop devices

View original Github issue

Metadata

Project
imagecraft
Number
#415
Type
pull request
State
closed
Author
lengau
Labels
—
Created
Updated
Closed

Current evaluation

Closed after its EFI/GPT work was superseded by #437, which merged the broader zero-mount bootloader installer in commit 0ca6f6e.

Resolution: closed superseded

Reason: PR #415 was replaced by canonical/imagecraft#437. The replacement was merged into main as commit 0ca6f6e, delivering zero-mount bootloader installation without kernel loop devices.

Evaluated by: mr-cal-bot

No scores available.

Issue body

## Description Installs GRUB for EFI/GPT images using FUSE partition mounts (`fuse2fs`), chroot, and `mtools`, eliminating the need for kernel loop devices and host filesystem bind mounts (`/dev`, `/proc`, `/sys`). ### The Problem Previously, installing GRUB required attaching a kernel loop device to the image, mounting all partitions, bind-mounting host `/dev`, `/proc`, and `/sys`, chrooting in, and running distribution `grub-install` and `update-grub`. This required host root privileges and loop device access, preventing builds in unprivileged environments. ### The Approach - **FUSE & mtools**: Root (and optional boot) partitions are mounted via FUSE (`mount_partition`). ESP files are written in place with `mtools` without kernel loop devices. - **Binary Deployment**: Deploys pre-signed Ubuntu shim+GRUB if present (for Secure Boot), or builds a standalone GRUB EFI binary using the image's `grub-mkimage` inside the mounted rootfs. - **Config Generation**: Uses `update-grub` inside the mounted rootfs (via chroot) to discover kernels and generate `grub.cfg` and ESP stub configs, avoiding the need for `grub-mkimage` in the rootfs. The `grub-probe` stub handles device queries from precomputed UUIDs. ### Scope Only the **EFI/GPT** path is converted. Legacy BIOS/MBR continues using the loop-device path until a follow-up change. IMAGECRAFT-176 --- - [x] I've followed the [contribution guidelines](https://github.com/canonical/imagecraft/blob/main/CONTRIBUTING.md). - [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/). - [x] I've successfully run `make lint && make test`. - [ ] I've added or updated any relevant documentation. - [ ] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed superseded Closed after its EFI/GPT work was superseded by #437, which merged the broader zero-mount bootloader installer in commit 0ca6f6e.
qwen/qwen3.8-27b — closed resolved Merged as PR #437 (commit 0ca6f6e), converting the EFI/GPT GRUB install path to use FUSE partition mounts (fuse2fs), mtools, and chroot instead of kernel loop devices and host bind mounts, enabling unprivileged builds.
stealth/space-bunny-alpha — closed stale Closed unmerged after prolonged inactivity: review remained pending, 11 review comments were unresolved, and three root slow-test jobs failed; no replacement was recorded.
stealth/space-bunny-alpha
Impact: 67
Quick Win: 5
Complexity: 78
Confidence: 95
Actionability: 34
keep open Reworks EFI/GPT GRUB installation with FUSE, mtools, and chroot to remove loop-device requirements; open with 11 unresolved comments, three root slow-test failures, and pending builds.
qwen3.6-35b-a3b-mtp-q6
Impact: 70
Quick Win: 18
Staleness: 35
Complexity: 75
Confidence: 70
needs review PR converts EFI/GPT GRUB installation to use FUSE partition mounts instead of kernel loop devices, enabling unprivileged image builds. Has 11 unresolved review comments and some failing CI slow tests.
qwen/qwen3.8-27b
Impact: 75
Quick Win: 14
Staleness: 5
Complexity: 82
Confidence: 80
needs review Converts EFI/GPT GRUB install to build the bootloader on the host (grub-mkimage, mtools, debugfs) instead of chroot/loop devices, enabling unprivileged image builds. Part 5 of a stack; BIOS unchanged. +1746/-394, CI mostly green, review pending.
qwen/qwen3.8-27b
Impact: 72
Quick Win: 13
Staleness: 5
Complexity: 82
Confidence: 78
needs review Core of a 5-PR stack replacing chroot/loop-device GRUB install with host-side grub-mkimage + mtools + debugfs for EFI/GPT. Fresh (15d), 2 unresolved review comments, CI slow tests failing, build pending.
qwen/qwen3.8-27b
Impact: 85
Quick Win: 17
Staleness: 5
Complexity: 80
Confidence: 70
needs review Converts EFI/GPT GRUB installation to build grub-mkimage on host and copy via mtools/debugfs, removing loop devices, mounts, and chroot for the EFI path; BIOS still uses old chroot. Part 5 of an unprivileged-build stack. Fresh (15 days, active today), 0 comments, 2 unresolved review comments, 3 slow root CI jobs failing, build/snap-builds pending.
qwen/qwen3.8-27b
Impact: 62
Quick Win: 7
Staleness: 5
Complexity: 88
Confidence: 80
keep open Replaces chroot/loop-device GRUB EFI install with host-based grub-mkimage, mtools, debugfs; adds Secure Boot. Part 5 of unprivileged-build stack; depends on unmerged imgfs PR. 10 files, +1788/-327. 3 slow CI tests failing; build pending.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 65
Confidence: 90
needs review Replaces chroot-based GRUB EFI installation with host-side build using grub-mkimage and mtools. Currently pending maintainer review with two unresolved comments and passing CI.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 80
Confidence: 85
needs review Replaces chroot-based GRUB EFI installation with host-side generation using grub-mkimage and mtools. Generates grub.cfg directly. Currently awaiting maintainer review with passing CI.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 65
Confidence: 85
needs review Refactors EFI GRUB installation to run without loop devices, mounts, or chroot, enabling unprivileged container builds. Currently awaiting maintainer review with CI spread tests pending.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 65
Confidence: 90
needs review Implements EFI GRUB installation without loop devices or chroot, enabling unprivileged image builds. Currently pending maintainer review with all CI checks passing.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 75
Confidence: 85
needs review Refactors EFI GRUB installation to run on the host without loop devices, chroot, or root privileges. Builds bootloader, copies to ESP via mtools, and generates grub.cfg. Enables unprivileged image building in containers.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 65
Confidence: 85
needs review Refactors EFI GRUB installation to run without root, loop devices, or chroot by building the bootloader on the host. Currently awaiting maintainer review with CI tests pending.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 65
Confidence: 90
needs review Implements EFI GRUB installation without loop devices or chroot by building the bootloader on the host, copying via mtools, and generating grub.cfg directly. Currently awaiting maintainer review with CI checks running.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 75
Confidence: 90
needs review Refactors EFI GRUB installation to run on the host without loop devices or chroot, enabling unprivileged builds. Currently awaiting maintainer review with mixed CI results.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 80
Confidence: 90
needs review Replaces chroot-based GRUB EFI installation with host-side build using grub-mkimage and mtools. Generates grub.cfg directly. Currently awaiting maintainer review with CI mostly passing.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 65
Confidence: 90
needs review Refactors EFI GRUB installation to run on the host without loop devices, mounts, or chroot. Builds bootloader with grub-mkimage, copies via imgfs, generates grub.cfg directly. Currently pending maintainer review with passing CI.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 65
Confidence: 85
needs review Implements EFI GRUB installation without loop devices or chroot by building the bootloader on the host. Currently pending maintainer review with mixed CI results.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 65
Confidence: 85
needs review Converts EFI GRUB installation to run without root, loop devices, or chroot by building the bootloader on the host and using mtools/debugfs. Currently awaiting maintainer review with mixed CI results.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 65
Confidence: 90
needs review Refactors EFI GRUB installation to run without root, loop devices, or chroot by building the bootloader on the host and using mtools/debugfs. Currently pending maintainer review with CI passing.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 75
Confidence: 85
needs review Replaces chroot-based GRUB EFI installation with host-side assembly using grub-mkimage and mtools, enabling unprivileged image builds. Currently awaiting maintainer review with CI pending.

Update history

Date Change
updated
closed
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
updated
updated
updated
updated
updated
updated
updated
updated
updated
created

Related work

  • Superseded By: canonical/imagecraft#437 (confidence 99%)

    Merged replacement implementing the broader zero-mount bootloader installation.

Related issues

Issue Project State Summary Similarity
#434 feat(grub): loop-device-free EFI GRUB setup imagecraft closed Closed unmerged and superseded by #437, which merged the broader zero-mount bootloader installer in commit 0ca6f6e.
92%
#416 feat(grub): install BIOS GRUB without loop devices or chroot imagecraft closed Closed unmerged after inactivity; its zero-mount GRUB goal was superseded by merged #437 (commit 0ca6f6e), which replaced loop-device and chroot installation.
85%
#348 No loops for grub imagecraft closed Closed unmerged and superseded by #437, merged as 0ca6f6e, which introduced zero-mount bootloader installation without loop devices.
77%