iso-patch: fail loudly when the Ubuntu ISO's minimal.squashfs has no kernel (refs #66) - #122
Open
adihanifsdr wants to merge 1 commit into
Open
Conversation
…kernel Refs jamesstringer90#66. do_ubuntu_to_vhdx builds the rootfs from casper/minimal.squashfs and picks the kernel version up from the first /boot/vmlinuz-* it sees during the walk. On the Ubuntu 26.04 desktop ISO that layer carries the kernel; on 24.04 it does not (the kernel lives only in the minimal.standard.live overlay). A full ingest of ubuntu-24.04.4-desktop-amd64.iso walks 85,075 files / 4.9 GiB and never sees a vmlinuz, so kernel_ver stays empty and the bootstrap grub.cfg is written as: linux /boot/vmlinuz- root=UUID=... ro ... initrd /boot/initrd.img- GRUB cannot load that, the guest sits at the GRUB prompt with one vCPU busy and ~24 MB of RAM touched, the agent never comes up, and the UI shows "Installing Linux" forever with nothing in the log explaining why. Two changes: * tools/iso-patch/ubuntu_vhdx.c: after the squashfs ingest, treat an empty kernel version as a hard error. log_err() reports which image lacked /boot/vmlinuz-* and that only Ubuntu Desktop 26.04 LTS ISOs are supported; exit_code stays 1 so cleanup deletes the VHDX. Also log the detected kernel version as a STATUS line on success. * src/backend_win/asb_core.c (run_iso_patch_ubuntu): forward iso-patch STATUS: and ERROR: lines into the app log. The Windows --to-vhdx path deliberately ignores STATUS lines because the in-guest installer logs are available later; the Linux build has no such fallback, so these lines are the only host-side record of how the disk was built. A cheaper pre-flight on casper/minimal.manifest was considered and dropped: the manifest lists no linux-image-* package on the 26.04 and 26.04.1 ISOs either, so it cannot tell bootable from unbootable images. The post-ingest check reads the actual squashfs contents and only rejects builds that would have produced an unbootable disk. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.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.
Refs #66 (Ubuntu 24.04 ISO hangs at "Installing Linux"). @jamesstringer90 — this doesn't add 24.04 support, it just turns the silent hang into an immediate, explained failure.
What happens today
do_ubuntu_to_vhdxingestscasper/minimal.squashfsand takes the kernel version from the first/boot/vmlinuz-*seen during the walk. On the 26.04 desktop ISO that layer carries the kernel. On 24.04 it does not — the kernel lives only in theminimal.standard.liveoverlay — sokernel_verstays empty and the bootstrapgrub.cfgis written as:GRUB can't load that. The guest sits at the GRUB prompt (1 vCPU at ~30 %, the other 7 at 0 %, ~24 MB of guest RAM touched, nothing on the COM1 serial pipe because the kernel never starts), the agent never connects, and the UI shows "Installing Linux" forever. Nothing in the log says why, because
run_iso_patch_ubuntuonly parsesPROGRESS:/ERROR:/DONE:and drops iso-patch'sSTATUS:lines.Full-ingest evidence from
ubuntu-24.04.4-desktop-amd64.isowith this patch applied:Changes
tools/iso-patch/ubuntu_vhdx.c— after the squashfs ingest, an empty kernel version is a hard error:log_err()names the image that lacked/boot/vmlinuz-*and states that only Ubuntu Desktop 26.04 LTS ISOs are supported;exit_codestays 1 socleanupdeletes the VHDX. On success the detected kernel is logged as aSTATUS:line.src/backend_win/asb_core.c(run_iso_patch_ubuntu) — forward iso-patchSTATUS:andERROR:lines into the app log asiso-patch: .... The Windows--to-vhdxpath intentionally ignoresSTATUS:because the in-guest installer logs are available later; the Linux build has no such fallback, so these lines are the only host-side record of how the disk was built.With both, a 24.04 ISO now fails the create step in ~70 s with the error surfaced in the UI log and as the create error, instead of leaving a VM that never finishes.
Considered and dropped
A cheap pre-flight on
casper/minimal.manifest(refuse before the ingest if nolinux-image-*line) would have saved the ~70 s, but the manifest lists nolinux-image-*package on the 26.04 and 26.04.1 ISOs either (checked via range reads against releases.ubuntu.com), so it can't discriminate. The post-ingest check reads the real squashfs contents and only rejects builds that would have been unbootable anyway — there is no path where a currently-working 26.04 build is affected.Testing
iso-patch.vcxprojandAppSandbox.slnRelease|x64 (VS 2026 Community). Only pre-existing warnings (xz_crc64_initinprefetch_build_deps.c,DwmSetWindowAttributeinvm_display_idd.c).iso-patch.exe --ubuntu-to-vhdx ubuntu-24.04.4-desktop-amd64.iso --output ... --size-gb 16(elevated): full ingest, then the new error, exit code 1, no VHDX left behind (log excerpt above).🤖 Generated with Claude Code