From 5d1001000a6a0076e28cd9c4b31032ae794d0703 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sat, 26 Sep 2026 23:20:16 +0800 Subject: [PATCH] =?UTF-8?q?windows:=20=E6=9B=B4=E6=96=B0=E8=85=BE=E8=AE=AF?= =?UTF-8?q?=E4=BA=91=20virtio=20=E9=A9=B1=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/trans.sh b/trans.sh index aefcdb6..b1a6aca 100644 --- a/trans.sh +++ b/trans.sh @@ -6987,7 +6987,7 @@ install_windows() { if is_virt_contains virtio; then if [ "$vendor" = aliyun ] && is_nt_ver_ge 6.1 && [ "$arch_wim" = x86_64 ]; then add_driver_aliyun_virtio - elif [ "$vendor" = qcloud ] && is_nt_ver_ge 6.1 && [ "$arch_wim" = x86_64 ]; then + elif [ "$vendor" = qcloud ] && is_nt_ver_ge 6.0 && { [ "$arch_wim" = x86 ] || [ "$arch_wim" = x86_64 ]; }; then add_driver_qcloud_virtio # 未测试是否需要专用驱动 elif false && [ "$vendor" = huawei ] && is_nt_ver_ge 6.0 && { [ "$arch_wim" = x86 ] || [ "$arch_wim" = x86_64 ]; }; then @@ -7670,9 +7670,86 @@ EOF add_driver_qcloud_virtio() { info "Add drivers: QCloud virtio" - # 测试版? - # https://mirrors.tencent.com/install/cts/windows/Drivers.zip + # 标准型S8 | S8.LARGE8 实例安装 32 位 win10 + # PE 阶段加载社区版 viostor 驱动后会自动重启 + # 因此 32 位也需要用腾讯云版驱动 + # 下面的版本以 win10 viostor amd64 inf 为准 + + # 58005 没有 32 位 + # https://mirrors.tencent.com/install/windows/virtio_64_1.0.9.exe + + # 58007 没有气球驱动 + # https://windows-1251783334.cos.ap-shanghai.myqcloud.com/Win7_Win2008R2.zip 有 32 位 + # https://windows-1251783334.cos.ap-shanghai.myqcloud.com/Win8.1_Win2012R2.zip 有 32 位 + # https://windows-1251783334.cos.ap-shanghai.myqcloud.com/Win10_2016_2019.zip 有 32 位 + # https://windows-1251783334.cos.ap-shanghai.myqcloud.com/VirtIO_Win_58007.zip 有 32 位 + # https://windows-1251783334.cos.ap-shanghai.myqcloud.com/Install_QCloudVirtIO.zip 只有 win10 有 32 位 + # https://go2tencentcloud-1251783334.cos.accelerate.tencentcos.cn/latest/go2tencentcloud.zip 没有 32 位 + + # 58010 + # https://windows-1251783334.cos.ap-shanghai.myqcloud.com/Install_KVMVirtIO.zip 只有 win10 有 32 位,没有气球驱动,netkvm 是社区版 + # https://windows-1251783334.cos.ap-shanghai.myqcloud.com/Install_QCloudVirtIO_new.zip 只有 win10 有 32 位,只有 win10 有气球驱动 + # https://winpecheck-1251783334.cos.accelerate.tencentcos.cn/Install_QCloudVirtIO_new.zip + # https://mirrors.tencent.com/install/cts/windows/Drivers.zip 有 32 位,没有气球驱动 + # https://mirrors.tencent.com/install/cts/windows/AllTools/Drivers.zip + + # 腾讯云 windows server 2025 系统镜像,驱动是 58010 + + # Install_QCloudVirtIO_new.zip 可视为稳定版 + # 因为 WinPE-Diag.7z\checks\50-DriverCleanup.ps1 用的是 Install_QCloudVirtIO_new.zip + # https://mirrors.tencent.com/install/cts/windows/WinPE-Diag.7z + + # 第 1 步 + # 从 Drivers.zip 获取 viostor netkvm qxldod 驱动 + # 里面的 qxldod windows server 驱动和普通 windows 驱动文件相同 + # XP 文件夹有个中文文件,busybox unzip 解压会报错,因此排除该文件夹 + download https://mirrors.tencent.com/install/cts/windows/Drivers.zip $drv/Drivers.zip + unzip $drv/Drivers.zip -d $drv/qcloud/ + unzip $drv/qcloud/Drivers/VirtIO_Win_20250827.zip -d $drv/qcloud/ -x '*/XP/*' + + drivers=$( + case "$nt_ver" in + 6.0) + # sha1 + echo VioStor/Vista_Win2008 + echo NetKVM/Vista_Win2008 + # 没有 qxl/qxldod + ;; + 6.1) + # sha1 + echo VioStor/Win7_2008R2 + echo NetKVM/Win7_Win2008R2 + # 没有 qxl/qxldod + ;; + 6.2) + echo VioStor/Win8_8.1_2012_2012R2 + echo NetKVM/Win8_Win2012 + echo qxldod/w8 + ;; + 6.3) + echo VioStor/Win8_8.1_2012_2012R2 + echo NetKVM/Win8.1_Win2012R2 + echo qxldod/w8.1 + ;; + *) + echo VioStor/Win10_2016_2019 + echo NetKVM/Win10_2016_2019 + echo qxldod/w10 + ;; + esac + ) + + local dir + for dir in $drivers; do + cp_drivers "$drv/qcloud/VirtIO_Win_20250827/$dir/$arch" + done + + # 第 2 步 + # 从 virtio_64_1.0.9.exe 获取气球驱动 + if ! { is_nt_ver_ge 6.1 && [ "$arch_wim" = x86_64 ]; }; then + return + fi apk add 7zip download https://mirrors.tencent.com/install/windows/virtio_64_1.0.9.exe $drv/virtio.exe true exclude='$*' # 排除 $PLUGINSDIR @@ -7701,6 +7778,10 @@ EOF for old_name in $drivers; do part=${old_name%%_*} + # 只复制气球驱动 + if ! [ "$part" = "balloon" ]; then + continue + fi if ! [ "$old_name" = "$part" ]; then find $drv/qcloud/$part -type f -iname "$old_name.*" | while read -r file; do ext="${file##*.}"