core: 修复因 subshell 导致变量丢失,从而重复运行 virt-what

This commit is contained in:
bin456789 2024-10-14 23:08:22 +08:00
parent 89800f18ed
commit d8692e787c
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -3809,6 +3809,12 @@ install_windows() {
mkdir -p "$drv" # 驱动下载临时文件夹
mkdir -p "/wim/drivers" # boot.wim 驱动文件夹
# 这里有坑
# $(get_cloud_vendor) 调用了 cache_dmi_and_virt
# 但是 $(get_cloud_vendor) 运行在 subshell 里面
# subshell 运行结束后里面的变量就消失了
# 因此先运行 cache_dmi_and_virt
cache_dmi_and_virt
vendor="$(get_cloud_vendor)"
# virtio