From 5e58722aca71e30feab903cd2c36ba827ef2bad6 Mon Sep 17 00:00:00 2001 From: Guofang Date: Mon, 19 Oct 2026 14:28:13 +0800 Subject: [PATCH] Add an openssh-win target to download the Win32-OpenSSH zip Co-Authored-By: Claude Sonnet 5.5 --- .gitignore | 1 + README.md | 7 ++++++- download-images.sh | 22 ++++++++++++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index f082508..a47e22d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.img *.vhd *.vhdx +*.zip *.part *.part.url *.aria2 diff --git a/README.md b/README.md index 2a3e8b6..3b95716 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,8 @@ ISO (for example `Win11_25H2_English_x64_v2.iso` → existing `*Win*11*x64*.qcow2` (`*Win*11*arm64*.qcow2` on arm64) in `base-qcow2/` is used instead. Download URLs can be overridden with `DEBIAN_IMAGE_URL`, `ALMA_IMAGE_URL`, -`FEDORA_IMAGE_URL`, `UBUNTU_IMAGE_URL`, and `VIRTIO_WIN_ISO_URL`. Each may +`FEDORA_IMAGE_URL`, `UBUNTU_IMAGE_URL`, `VIRTIO_WIN_ISO_URL`, and +`OPENSSH_WIN_ZIP_URL`. Each may list several mirrors of the same file, separated by whitespace; the Fedora image defaults to the TUNA, BFSU and NJU mirrors, and the Ubuntu image to the TUNA, NJU and official cloud-images.ubuntu.com mirrors. @@ -63,6 +64,10 @@ download is only resumed with the same downloader and mirror list; otherwise it starts over. The Fedora and Ubuntu checksums can be overridden with `FEDORA_IMAGE_SHA256` and `UBUNTU_IMAGE_SHA256` when using a custom image. +The `openssh-win` target downloads the Win32-OpenSSH zip matching the +architecture into `tools-iso/`: `OpenSSH-Win64.zip` on amd64 hosts and +`OpenSSH-ARM64.zip` on arm64 hosts. + ## Windows installation disk image QEMU's emulated USB CD-ROM reads the Windows ISO at only a few MB/s on macOS. diff --git a/download-images.sh b/download-images.sh index 19c619d..8c4d575 100755 --- a/download-images.sh +++ b/download-images.sh @@ -57,6 +57,15 @@ fi virtio_image="${tools_iso_dir}/virtio-win.iso" +# Win32-OpenSSH names its zip after the architecture: Win64 for x64 and ARM64 +# for arm64. +if [[ "$image_arch" == arm64 ]]; then + openssh_zip=OpenSSH-ARM64.zip +else + openssh_zip=OpenSSH-Win64.zip +fi +openssh_image="${tools_iso_dir}/${openssh_zip}" + # Windows 11 media is named after the architecture: x64 on amd64 hosts and # Arm64 on arm64 hosts. if [[ "$image_arch" == arm64 ]]; then @@ -111,6 +120,7 @@ debian_url="${DEBIAN_IMAGE_URL:-$debian_url_default}" alma_url="${ALMA_IMAGE_URL:-$alma_url_default}" fedora_url="${FEDORA_IMAGE_URL:-$fedora_url_default}" ubuntu_url="${UBUNTU_IMAGE_URL:-$ubuntu_url_default}" +openssh_url="${OPENSSH_WIN_ZIP_URL:-https://github.com/PowerShell/Win32-OpenSSH/releases/download/10.0.0.0p2-Preview/${openssh_zip}}" virtio_url="${VIRTIO_WIN_ISO_URL:-https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso}" debian_sha512="${DEBIAN_IMAGE_SHA512:-$debian_sha512_default}" alma_sha256="${ALMA_IMAGE_SHA256:-$alma_sha256_default}" @@ -120,7 +130,7 @@ force_download=false usage() { cat <&2; usage >&2; exit 2 ;; esac @@ -417,3 +428,10 @@ if wants_target virtio-win; then "$virtio_url" \ "$virtio_image" fi + +if wants_target openssh-win; then + download_file \ + 'Win32-OpenSSH zip' \ + "$openssh_url" \ + "$openssh_image" +fi