macOS's openrsync ignores --chmod, so the staged directories kept the
read-only permissions of the UDF mount and wimlib-imagex split failed
with Permission denied. Run chmod -R u+rwX on the staging directory on
Darwin.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Copy the ISO without install.wim to a staging directory, split install.wim
into it, and fill the image with one recursive mcopy instead of a mmd and
mcopy per directory. rsync --chmod keeps the staged directories writable so
that cleanup can remove them.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Print the command line before every external command (hdiutil, udisksctl,
wimlib-imagex, sgdisk, mkfs.fat, mmd, mcopy and so on) so the log shows
which command is running. Write the image straight to the output path
instead of moving it from the work directory, and remove a partial output
if the run fails or is cancelled.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
QEMU's emulated USB CD-ROM reads the Windows ISO at a few MB/s. The script
builds a bootable FAT32 GPT disk image from the ISO, splitting install.wim into
install*.swm parts for the 4 GB FAT32 file limit, so the image can be attached
as an NVMe disk and read about 15 times faster.
It runs on macOS and Debian. The ISO has to be read as UDF: hdiutil on macOS,
mount -t udf as root on Linux, otherwise udisksctl, otherwise 7z extracts it.
A desktop session automounts the loop device that udisksctl creates, so the
existing mount point is reused when there is one. The image itself is built
without root.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>