On a Linux host the UUP converter only produces the RTM install.wim (build 26100.1), so Windows Update had to install the entire cumulative anyway — the UUP download/convert machinery added a slow ~5 GB step and several host tools (aria2/wimtools/cabextract/chntpw) for no benefit. Replace it: deploy-win now takes the install ISO directly via `--iso-url` (urllib download + cache by file name under <CI_ROOT>/iso/, optional --iso-sha256) or a local `--win-iso` (exactly one required). Patch + deploy flow is unchanged. Supply an already-updated ISO (e.g. a massgrave link) to skip the WU step entirely. - Remove winimage/uup.py and its tests. - Trim setup-host-linux.sh deps to p7zip-full + xorriso + genisoimage. - Update RUNBOOK §5 and the Windows-host port plan. Coverage 93.6%.
4.4 KiB
Plan — cross-platform deploy-win / deploy-linux on a Windows host (deferred)
Context
ci template deploy-win (and the existing deploy-linux) are implemented for a
Linux VMware Workstation host: they shell out to Linux-only tools
(xorriso, genisoimage, aria2c, wimlib-imagex) and use POSIX paths. The
Windows host port was deferred when the Linux slice was built — this document
captures how to make both commands run on a Windows Workstation host without
duplicating the orchestration logic.
The Python orchestrator stays the single entry point. Where a step needs a
Windows-only tool, Python detects os.name == "nt" and routes that one step to
a thin PowerShell shim (or reuses functions already in
template/Deploy-WinBuild2025.ps1). Everything else (ISO download/cache, VMX
build, vmrun lifecycle, flag wait, NIC swap, snapshot) is already
platform-neutral Python and is reused unchanged.
What already works cross-platform (reuse as-is)
- ISO acquisition:
deploy-win --iso-url(urllib download + cache) /--win-isois pure stdlib and portable as-is. (UUP dump was removed — on Linux it only produced the RTMinstall.wim; supply an updated ISO directly instead.) winimage/autounattend.py—importlib.resources, fully portable.commands/template.pydeploy-win orchestration:_winbuild_vmx_lines,_remove_vmx_lines,_patch_vmx_key,_wait_install_flag,_vmrun_soft_stop,_poll_guest_ip_deploy, snapshot viavmrun— all platform-neutral (vmrun.exeexists on both hosts).config.pyalready resolvesF:\CI\...paths on Windows.
The one platform-specific step: ISO patch
winimage/iso_patch.py uses xorriso, absent on Windows. Introduce an ISO-tool
abstraction:
| Host | No-prompt + inject implementation |
|---|---|
| Linux | current xorriso -as mkisofs path |
| Windows | oscdimg.exe (Windows ADK) or reuse the IMAPI2FS / New-WinIsoNoPrompt + New-IsoFromFolder functions already in template/Deploy-WinBuild2025.ps1 via a small .ps1 shim |
Design:
winimage/iso_patch.pyexposespatch_iso(...)unchanged; inside, dispatch onos.name. Linux → existing xorriso. Windows →_patch_iso_windows(...)that writesautounattend.xml+post-install.ps1to a staging dir and calls a shimtemplate/shims/patch-win-iso.ps1(new, thin) which usesoscdimg.exe:oscdimg -m -o -u2 -udfver102 -bootdata:2#p0,e,b<etfsboot.com>#pEF,e,b<efisys_noprompt.bin> <src> <out>.- Prefer
oscdimgover IMAPI2FS (single command, scriptable, deterministic boot args) but keep the legacy IMAPI2FS path documented as a fallback for hosts without the ADK. - Note: with
oscdimgwe can injectautounattend.xmlinto the ISO root (one CD), matching the Linux design; VMware Tools stay a 2nd CD.
deploy-linux on Windows (parallel work)
deploy-linux Step 3 builds the cloud-init seed ISO with genisoimage
(_build_seed_iso). On Windows, route that to oscdimg.exe (data ISO, volume
label cidata, no boot) behind the same os.name dispatch. The rest of
deploy-linux (paramiko SSH, cloud image download, VMX, vmrun) is already
portable.
Steps
winimage/isotool.py(new) —make_data_iso(staging, out, label)andpatch_windows_iso(src, out, files, efi_boot)with Linux (xorriso/genisoimage) and Windows (oscdimg / shim) implementations selected byos.name.- Refactor
iso_patch.patch_isoandtemplate._build_seed_isoto callisotool. Keep current Linux behaviour byte-for-byte. template/shims/patch-win-iso.ps1(new, lint-clean PS 5.1) — oscdimg wrapper; optional IMAPI2FS fallback reusingDeploy-WinBuild2025.ps1functions.- Preflight: on Windows check for
oscdimg.exe(ADK) /7zinstead of the Linux tools; clear error if the ADK is missing. (ISO download is stdlib — no extra tool.) - Tests: parametrize the new
isotooldispatch (mockos.name); mock the shim call. Keep coverage ≥90%. - Docs: note Windows-host prerequisites (Windows ADK for
oscdimg) indocs/RUNBOOK-PhaseC.md/ a Windows runbook.
Verification
- Linux regression: existing
deploy-win/deploy-linuxtests stay green (the abstraction must not change Linux argv). - Windows live: on a Windows Workstation host with the ADK installed, run
ci template deploy-winend-to-end → unattended install → snapshot.
Risks
oscdimgboot-args syntax differs from xorriso; validate the no-prompt UEFI boot on a real VM.