Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/backend_win/asb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2119,11 +2119,19 @@ static HRESULT run_iso_patch_ubuntu(const wchar_t *iso_path,
if (g_progress_cb && pvm)
g_progress_cb(vm_handle(pvm), pct, is_staging, g_progress_ud);
} else if (strncmp(line, "ERROR:", 6) == 0) {
asb_log(L"iso-patch: ERROR: %S", line + 6);
if (error_msg && error_msg[0] == L'\0')
MultiByteToWideChar(CP_ACP, 0, line + 6, -1, error_msg, (int)error_msg_cap);
result = E_FAIL;
} else if (strncmp(line, "DONE:", 5) == 0) {
result = S_OK;
} else if (strncmp(line, "STATUS:", 7) == 0) {
/* Unlike the Windows --to-vhdx path there is no
in-guest installer log to fall back on, so the
iso-patch status lines (source squashfs, detected
kernel, ingest totals, ...) are the only host-side
record of how the Linux disk was built. */
asb_log(L"iso-patch: %S", line + 7);
}
}
start = ci + 1;
Expand Down
16 changes: 16 additions & 0 deletions tools/iso-patch/ubuntu_vhdx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2081,6 +2081,22 @@ int do_ubuntu_to_vhdx(const wchar_t *iso_path_arg,
goto cleanup;
}
strncpy(kernel_ver, pl.kernel_version, sizeof(kernel_ver) - 1);
if (kernel_ver[0] == 0) {
/* No /boot/vmlinuz-* was seen during the walk. minimal.squashfs
carries the kernel on the 26.04 desktop ISO, but on 24.04 it
lives only in the minimal.standard.live overlay, so the rootfs
built here has nothing to boot. Writing the bootstrap
grub.cfg with an empty version produces a disk that hangs at
the GRUB prompt while the UI shows "Installing Linux" forever
(jamesstringer90/appsandbox#66). Fail loudly instead;
exit_code stays 1 so cleanup deletes the VHDX. */
log_err(L"no kernel (/boot/vmlinuz-*) found in %s - the disk would not boot. "
L"Only Ubuntu Desktop 26.04 LTS ISOs are supported.", sqfs_path);
sqfs_close(sq);
ext4_writer_close(ew);
goto cleanup;
}
log_msg(L"kernel: %hs", kernel_ver);
sqfs_close(sq);
}

Expand Down