fix(pack): fix GRUB EFI stub and classic boot test setup - #385
Draft
lengau wants to merge 13 commits into
Draft
Conversation
- Fix GRUB EFI stub generation in grubutil.py to avoid hardware serial overrides in UEFI mode, which conflict with OVMF and cause QEMU to hang. - Update tests/spread/boot/classic/imagecraft.yaml to configure recordfail timeout, serial terminal, and manual boot-sentinel service symlinking. - Update tests/spread/boot/classic/task.yaml to include a QEMU timeout and check output log for sentinel output.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses UEFI boot hangs in the “classic” QEMU boot test flow by adjusting how GRUB EFI stubs/fallback paths are generated and by tightening the spread test’s boot-time configuration and assertions.
Changes:
- Update GRUB UEFI install logic to force a consistent
/EFI/ubuntulayout and populate a UEFI fallbackEFI/BOOTsibling GRUB binary +grub.cfgstub. - Refactor/adjust the classic boot test image overlay to improve deterministic serial/menu behavior and enable the sentinel service via direct unit symlink.
- Update the classic spread task to add a QEMU timeout and validate sentinel output in
output.log.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/spread/boot/classic/task.yaml | Adds a QEMU timeout and changes the disk interface used by QEMU, then asserts sentinel output from the serial log. |
| tests/spread/boot/classic/imagecraft.yaml | Tweaks GRUB defaults for serial/menu behavior and adjusts how the sentinel systemd unit is enabled in the overlay. |
| imagecraft/pack/grubutil.py | Forces --bootloader-id=ubuntu, adds UEFI fallback population, and changes chroot /dev mounting behavior to expose host loop devices. |
| -drive if=pflash,format=raw,readonly=on,file=$UEFI_CODE \ | ||
| -drive if=pflash,format=raw,file=/tmp/uefi_vars.fd \ | ||
| -drive file=pc.img,format=raw,index=0,if=virtio 2>&1 | tee output.log || true | ||
| -drive file=pc.img,format=raw,index=0,if=ide 2>&1 | tee output.log || true |
| cp "$UEFI_VARS" /tmp/uefi_vars.fd | ||
|
|
||
| $QEMU_BIN \ | ||
| timeout 180 $QEMU_BIN \ |
… and ext2 in EFI stub
Add --ignore=unmaintained flag to imagecraft pack commands in tests that run on all systems, including Ubuntu 25.10 which is now EOL. This allows the tests to continue running without failures due to unmaintained base distributions. Affected tests: - tests/spread/pack/simple/task.yaml - tests/spread/pack/non-sequential-partitions/task.yaml - tests/spread/pack/sector-write/task.yaml Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update craft-providers constraint from ~=3.0 to ~=3.7 to ensure we use the latest bug fixes and improvements in the 3.7.x series. This helps support newer Ubuntu versions like 26.04. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
is_effective_base_eol() crashes with UnknownVersionError when build-base: devel is used with --ignore=unmaintained, since it lacks the same devel/unknown-base handling as its sibling methods check_base_is_supported()/base_eol_soon_date(). This broke tests/spread/pack/non-sequential-partitions and tests/spread/pack/sector-write on all systems. Point craft-application at the canonical/craft-application#1153 fix branch until it's merged and released, then switch back to a released craft-application~=7.1. Fixes canonical/craft-application#1152 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Commit 0c879c9 unintentionally included local editor/agent tooling config and scratch files that don't belong in the repository: - .agents/, .kdev4/, imagecraft.kdev4, .workshop/ (local IDE/agent config) - TODO.md and contributors.html (personal scratch notes / generated report, referencing a local file path) - docs/release-notes/imagecraft-0-2-0.rst (belongs to the separate 0.2.0 release-notes work, not this branch) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lengau
force-pushed
the
work/IMAGECRAFT-176/fix-main
branch
from
August 10, 2026 22:08
3ae763a to
396f873
Compare
…d change Pointing craft-application at the work/fix-1152 branch (based on current main) pulls in an unrelated upstream change: LifecycleManager's ignore_outdated now also includes ".spread-reuse.*" to avoid re-pulling sources when spread test files change. Update the expected call to match. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
grubutil.pyto avoid hardware serial driver overrides in UEFI mode, which conflict with OVMF firmware and cause QEMU to hang atBdsDxe: starting Boot0001._extract_root_uuidand_populate_uefi_fallback) to satisfy linter and complexity rules.tests/spread/boot/classic/imagecraft.yamlto configureGRUB_RECORDFAIL_TIMEOUT=1, setGRUB_TERMINAL="console serial", and create themulti-user.target.wants/boot-sentinel.servicesymlink directly in the overlay.tests/spread/boot/classic/task.yamlto include a QEMU timeout and assert sentinel output inoutput.log.craft-applicationto thework/fix-1152branch (canonical/craft-application#1153) to fixtests/spread/pack/non-sequential-partitionsandtests/spread/pack/sector-write, which were crashing on all systems withUnknownVersionError: Unknown version ubuntu devel. This happens becauseProjectService.is_effective_base_eol()doesn't special-case adevelbase the way its sibling methods (check_base_is_supported()/base_eol_soon_date()) do, so--ignore=unmaintained+build-base: develcrashes instead of proceeding. Filed as canonical/craft-application#1152; revert to a releasedcraft-application~=7.1once #1153 is merged and released..agents/,.kdev4/,imagecraft.kdev4,.workshop/) and unrelated scratch files (TODO.md,contributors.html,docs/release-notes/imagecraft-0-2-0.rst) that were accidentally committed.