Add an openssh-win target to download the Win32-OpenSSH zip

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
GuofangandClaude Sonnet 5.5 committed 2026-10-19 14:28:13 +08:00
1 parent f5881cd5c8
commit 5e58722aca
3 files changed
+27 -3

No files matched your search

+20 -2
View File
@@ -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 <<EOF
Usage: $(basename "$0") [--force] [all|debian13|almalinux10|fedora44|ubuntu2604|virtio-win] ...
Usage: $(basename "$0") [--force] [all|debian13|almalinux10|fedora44|ubuntu2604|virtio-win|openssh-win] ...
$(basename "$0") --print-path TARGET [--iso]
Download one or more shared VM images. With no arguments, all targets are
@@ -150,6 +160,7 @@ print_image_path() {
fedora44) printf '%s\n' "$fedora_image" ;;
ubuntu2604) printf '%s\n' "$ubuntu_image" ;;
virtio-win) printf '%s\n' "$virtio_image" ;;
openssh-win) printf '%s\n' "$openssh_image" ;;
windows11)
if [[ "$media" == iso ]]; then
windows_iso_path
@@ -195,7 +206,7 @@ fi
for target in "${targets[@]}"; do
case "$target" in
all|debian13|almalinux10|fedora44|ubuntu2604|virtio-win) ;;
all|debian13|almalinux10|fedora44|ubuntu2604|virtio-win|openssh-win) ;;
-h|--help) usage; exit 0 ;;
*) printf 'Error: unknown download target: %s\n' "$target" >&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