Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Workaround VirtIO display driver bug #790

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions src/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,6 @@ addDriver() {
"winvista"* )
[[ "${driver,,}" == "viorng" ]] && return 0
;;
"win11x64"* | "win2025"* )
[[ "${driver,,}" == "viogpudo" ]] && return 0
;;
esac

local dest="$path/$target/$driver"
Expand All @@ -714,9 +711,10 @@ addDriver() {

addDrivers() {

local file="$1"
local index="$2"
local version="$3"
local src="$1"
local file="$2"
local index="$3"
local version="$4"

local msg="Adding drivers to image..."
info "$msg" && html "$msg"
Expand Down Expand Up @@ -751,6 +749,16 @@ addDrivers() {
addDriver "$version" "$drivers" "$target" "vioserial"
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
return 1
fi
Expand All @@ -772,10 +780,10 @@ addFolder() {
local msg="Adding OEM folder to image..."
info "$msg" && html "$msg"

local dest="$src/\$OEM\$/\$1/"
local dest="$src/\$OEM\$/\$1/OEM"
mkdir -p "$dest"

! cp -r "$folder" "$dest" && return 1
! cp -a "$folder/." "$dest" && return 1

local file
file=$(find "$dest" -maxdepth 1 -type f -iname install.bat | head -n 1)
Expand Down Expand Up @@ -824,7 +832,7 @@ updateImage() {
index="2"
fi

if ! addDrivers "$wim" "$index" "$DETECTED"; then
if ! addDrivers "$src" "$wim" "$index" "$DETECTED"; then
error "Failed to add drivers to image!" && return 1
fi

Expand Down