windows: 更新腾讯云 virtio 驱动

This commit is contained in:
bin456789
2026-09-26 23:20:16 +08:00
parent 2bcbc96100
commit 5d1001000a
+84 -3
View File
@@ -6987,7 +6987,7 @@ install_windows() {
if is_virt_contains virtio; then if is_virt_contains virtio; then
if [ "$vendor" = aliyun ] && is_nt_ver_ge 6.1 && [ "$arch_wim" = x86_64 ]; then if [ "$vendor" = aliyun ] && is_nt_ver_ge 6.1 && [ "$arch_wim" = x86_64 ]; then
add_driver_aliyun_virtio 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 add_driver_qcloud_virtio
# 未测试是否需要专用驱动 # 未测试是否需要专用驱动
elif false && [ "$vendor" = huawei ] && is_nt_ver_ge 6.0 && { [ "$arch_wim" = x86 ] || [ "$arch_wim" = x86_64 ]; }; then 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() { add_driver_qcloud_virtio() {
info "Add drivers: QCloud virtio" info "Add drivers: QCloud virtio"
# 测试版? # 标准型S8 | S8.LARGE8 实例安装 32 位 win10
# https://mirrors.tencent.com/install/cts/windows/Drivers.zip # 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 apk add 7zip
download https://mirrors.tencent.com/install/windows/virtio_64_1.0.9.exe $drv/virtio.exe true download https://mirrors.tencent.com/install/windows/virtio_64_1.0.9.exe $drv/virtio.exe true
exclude='$*' # 排除 $PLUGINSDIR exclude='$*' # 排除 $PLUGINSDIR
@@ -7701,6 +7778,10 @@ EOF
for old_name in $drivers; do for old_name in $drivers; do
part=${old_name%%_*} part=${old_name%%_*}
# 只复制气球驱动
if ! [ "$part" = "balloon" ]; then
continue
fi
if ! [ "$old_name" = "$part" ]; then if ! [ "$old_name" = "$part" ]; then
find $drv/qcloud/$part -type f -iname "$old_name.*" | while read -r file; do find $drv/qcloud/$part -type f -iname "$old_name.*" | while read -r file; do
ext="${file##*.}" ext="${file##*.}"