fix: Workaround VirtIO display driver bug (#790)

This commit is contained in:
Kroese 2024-10-10 23:53:41 +02:00 committed by GitHub
parent a2208ace94
commit 5bd88a5cc8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -701,9 +701,6 @@ addDriver() {
"winvista"* ) "winvista"* )
[[ "${driver,,}" == "viorng" ]] && return 0 [[ "${driver,,}" == "viorng" ]] && return 0
;; ;;
"win11x64"* | "win2025"* )
[[ "${driver,,}" == "viogpudo" ]] && return 0
;;
esac esac
local dest="$path/$target/$driver" local dest="$path/$target/$driver"
@ -714,9 +711,10 @@ addDriver() {
addDrivers() { addDrivers() {
local file="$1" local src="$1"
local index="$2" local file="$2"
local version="$3" local index="$3"
local version="$4"
local msg="Adding drivers to image..." local msg="Adding drivers to image..."
info "$msg" && html "$msg" info "$msg" && html "$msg"
@ -751,6 +749,16 @@ addDrivers() {
addDriver "$version" "$drivers" "$target" "vioserial" addDriver "$version" "$drivers" "$target" "vioserial"
addDriver "$version" "$drivers" "$target" "qemupciserial" addDriver "$version" "$drivers" "$target" "qemupciserial"
case "${version,,}" in
"win11x64"* | "win2025"* )
# Workaround Virtio GPU driver bug
local dst="$src/\$OEM\$/\$\$/Drivers"
mkdir -p "$dst"
! cp -a "$dest/." "$dst" && return 1
rm -rf "$dest/viogpudo"
;;
esac
if ! wimlib-imagex update "$file" "$index" --command "add $dest /$target" >/dev/null; then if ! wimlib-imagex update "$file" "$index" --command "add $dest /$target" >/dev/null; then
return 1 return 1
fi fi
@ -772,10 +780,10 @@ addFolder() {
local msg="Adding OEM folder to image..." local msg="Adding OEM folder to image..."
info "$msg" && html "$msg" info "$msg" && html "$msg"
local dest="$src/\$OEM\$/\$1/" local dest="$src/\$OEM\$/\$1/OEM"
mkdir -p "$dest" mkdir -p "$dest"
! cp -r "$folder" "$dest" && return 1 ! cp -a "$folder/." "$dest" && return 1
local file local file
file=$(find "$dest" -maxdepth 1 -type f -iname install.bat | head -n 1) file=$(find "$dest" -maxdepth 1 -type f -iname install.bat | head -n 1)
@ -824,7 +832,7 @@ updateImage() {
index="2" index="2"
fi fi
if ! addDrivers "$wim" "$index" "$DETECTED"; then if ! addDrivers "$src" "$wim" "$index" "$DETECTED"; then
error "Failed to add drivers to image!" && return 1 error "Failed to add drivers to image!" && return 1
fi fi