fix(deploy-win): extract ISO with 7z so no-prompt boot patch works
xorriso -extract reads the ISO9660 name tree, which on a Windows ISO has
no Rock Ridge — names come back upper-cased/truncated, so the
`efi/microsoft/boot/efisys_noprompt.bin` lookup failed ("missing from
ISO") and a repack from that tree would corrupt Windows' long file names.
Extract with 7z instead (reads the UDF/Joliet tree, preserving the real
lower-case paths), excluding 7z's synthetic `[BOOT]` dump. Verified
end-to-end on the cached 26100.32860 ISO: 7z extract → xorriso repack
yields a 5 GB ISO with autounattend.xml + post-install.ps1 at the root and
efisys_noprompt.bin as the UEFI El Torito image (no boot prompt).
Also: cap the Joliet volume id at 16 chars (silence xorriso warning), add
a 7z preflight check, and add p7zip-full to setup-host-linux.sh.
This commit is contained in:
@@ -199,13 +199,15 @@ def test_patch_iso_happy(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> Non
|
||||
base.write_bytes(b"x" * 1000)
|
||||
out = tmp_path / "out.iso"
|
||||
monkeypatch.setattr(ip, "_require_xorriso", lambda: "xorriso")
|
||||
monkeypatch.setattr(ip, "_require_7z", lambda: "7z")
|
||||
monkeypatch.setattr(ip, "_read_volid", lambda _p: "WINSERVER")
|
||||
monkeypatch.setattr(ip, "_check_free_space", lambda *_a: None)
|
||||
|
||||
def fake_run(argv: list[str], **_kw: Any) -> subprocess.CompletedProcess[str]:
|
||||
# simulate xorriso -extract creating the efi boot file in the tree
|
||||
if "-extract" in argv:
|
||||
tree = Path(argv[-1])
|
||||
# simulate 7z extraction creating the efi boot file in the tree
|
||||
if argv[0] == "7z" and "x" in argv:
|
||||
outflag = next(a for a in argv if a.startswith("-o"))
|
||||
tree = Path(outflag[2:])
|
||||
boot = tree / ip._EFI_BOOT_NOPROMPT
|
||||
boot.parent.mkdir(parents=True, exist_ok=True)
|
||||
boot.write_bytes(b"boot")
|
||||
@@ -225,6 +227,7 @@ def test_patch_iso_missing_efi_boot(monkeypatch: pytest.MonkeyPatch, tmp_path: P
|
||||
base = tmp_path / "base.iso"
|
||||
base.write_bytes(b"x" * 1000)
|
||||
monkeypatch.setattr(ip, "_require_xorriso", lambda: "xorriso")
|
||||
monkeypatch.setattr(ip, "_require_7z", lambda: "7z")
|
||||
monkeypatch.setattr(ip, "_check_free_space", lambda *_a: None)
|
||||
monkeypatch.setattr(
|
||||
ip.subprocess, "run",
|
||||
|
||||
Reference in New Issue
Block a user