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: Continue without drivers #204

Merged
merged 5 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions src/define.sh
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,8 @@ addFolder() {
info "$msg" && html "$msg"

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

! cp -Lr "$folder/." "$dest" && return 1
mkdir -p "$dest" || return 1
cp -Lr "$folder/." "$dest" || return 1

local file
file=$(find "$dest" -maxdepth 1 -type f -iname install.bat | head -n 1)
Expand Down
69 changes: 35 additions & 34 deletions src/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ detectImage() {
fi

info=$(wimlib-imagex info -xml "$wim" | tr -d '\000')
! checkPlatform "$info" && exit 67
checkPlatform "$info" || exit 67

DETECTED=$(detectVersion "$info")

Expand Down Expand Up @@ -588,7 +588,7 @@ prepareImage() {

desc=$(printVersion "$DETECTED" "$DETECTED")

! setMachine "$DETECTED" "$iso" "$dir" "$desc" && return 1
setMachine "$DETECTED" "$iso" "$dir" "$desc" || return 1
skipVersion "$DETECTED" && return 0

if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then
Expand Down Expand Up @@ -704,9 +704,9 @@ addDriver() {
esac

local dest="$path/$target/$driver"
mkdir -p "$dest"
mkdir -p "$dest" || return 1
cp -Lr "$path/$driver/$folder/." "$dest" || return 1

cp -Lr "$path/$driver/$folder/." "$dest"
return 0
}

Expand All @@ -731,33 +731,33 @@ addDrivers() {

local target="\$WinPEDriver\$"
local dest="$drivers/$target"
mkdir -p "$dest"
mkdir -p "$dest" || return 1

wimlib-imagex update "$file" "$index" --command "delete --force --recursive /$target" >/dev/null || true

addDriver "$version" "$drivers" "$target" "qxl"
addDriver "$version" "$drivers" "$target" "viofs"
addDriver "$version" "$drivers" "$target" "sriov"
# Disable temporarily : addDriver "$version" "$drivers" "$target" "smbus"
addDriver "$version" "$drivers" "$target" "qxldod"
addDriver "$version" "$drivers" "$target" "viorng"
addDriver "$version" "$drivers" "$target" "viostor"
addDriver "$version" "$drivers" "$target" "viomem"
addDriver "$version" "$drivers" "$target" "NetKVM"
addDriver "$version" "$drivers" "$target" "Balloon"
addDriver "$version" "$drivers" "$target" "vioscsi"
# Disable temporarily : addDriver "$version" "$drivers" "$target" "pvpanic"
addDriver "$version" "$drivers" "$target" "vioinput"
addDriver "$version" "$drivers" "$target" "viogpudo"
addDriver "$version" "$drivers" "$target" "vioserial"
addDriver "$version" "$drivers" "$target" "qemupciserial"
addDriver "$version" "$drivers" "$target" "qxl" || return 1
addDriver "$version" "$drivers" "$target" "viofs" || return 1
addDriver "$version" "$drivers" "$target" "sriov" || return 1
# Disable temporarily : addDriver "$version" "$drivers" "$target" "smbus" || return 1
addDriver "$version" "$drivers" "$target" "qxldod" || return 1
addDriver "$version" "$drivers" "$target" "viorng" || return 1
addDriver "$version" "$drivers" "$target" "viostor" || return 1
addDriver "$version" "$drivers" "$target" "viomem" || return 1
addDriver "$version" "$drivers" "$target" "NetKVM" || return 1
addDriver "$version" "$drivers" "$target" "Balloon" || return 1
addDriver "$version" "$drivers" "$target" "vioscsi" || return 1
# Disable temporarily : addDriver "$version" "$drivers" "$target" "pvpanic" || return 1
addDriver "$version" "$drivers" "$target" "vioinput" || return 1
addDriver "$version" "$drivers" "$target" "viogpudo" || return 1
addDriver "$version" "$drivers" "$target" "vioserial" || return 1
addDriver "$version" "$drivers" "$target" "qemupciserial" || return 1

case "${version,,}" in
"win11x64"* | "win2025"* )
# Workaround Virtio GPU driver bug
local dst="$src/\$OEM\$/\$\$/Drivers"
mkdir -p "$dst"
! cp -Lr "$dest/." "$dst" && return 1
mkdir -p "$dst" || return 1
cp -Lr "$dest/." "$dst" || return 1
rm -rf "$dest/viogpudo"
;;
esac
Expand Down Expand Up @@ -815,11 +815,11 @@ updateImage() {
fi

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

if ! addFolder "$src"; then
error "Failed to add OEM folder to image!" && return 1
error "Failed to add OEM folder to image!"
fi

if wimlib-imagex extract "$wim" "$index" "/$file" "--dest-dir=$tmp" >/dev/null 2>&1; then
Expand Down Expand Up @@ -884,7 +884,8 @@ removeImage() {

[ ! -f "$iso" ] && return 0
[ -n "$CUSTOM" ] && return 0
! rm -f "$iso" 2> /dev/null && warn "failed to remove $iso !"

rm -f "$iso" 2> /dev/null || warn "failed to remove $iso !"

return 0
}
Expand Down Expand Up @@ -927,20 +928,20 @@ buildImage() {

if [[ "${BOOT_MODE,,}" != "windows_legacy" ]]; then

! genisoimage -o "$out" -b "$ETFS" -no-emul-boot -c "$cat" -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -V "${LABEL::30}" \
-udf -boot-info-table -eltorito-alt-boot -eltorito-boot "$EFISYS" -no-emul-boot -allow-limited-size -quiet "$dir" 2> "$log" && failed="y"
genisoimage -o "$out" -b "$ETFS" -no-emul-boot -c "$cat" -iso-level 4 -J -l -D -N -joliet-long -relaxed-filenames -V "${LABEL::30}" \
-udf -boot-info-table -eltorito-alt-boot -eltorito-boot "$EFISYS" -no-emul-boot -allow-limited-size -quiet "$dir" 2> "$log" || failed="y"

else

case "${DETECTED,,}" in
"win2k"* | "winxp"* | "win2003"* )
! genisoimage -o "$out" -b "$ETFS" -no-emul-boot -boot-load-seg 1984 -boot-load-size 4 -c "$cat" -iso-level 2 -J -l -D -N -joliet-long \
-relaxed-filenames -V "${LABEL::30}" -quiet "$dir" 2> "$log" && failed="y" ;;
genisoimage -o "$out" -b "$ETFS" -no-emul-boot -boot-load-seg 1984 -boot-load-size 4 -c "$cat" -iso-level 2 -J -l -D -N -joliet-long \
-relaxed-filenames -V "${LABEL::30}" -quiet "$dir" 2> "$log" || failed="y" ;;
"win9"* )
! genisoimage -o "$out" -b "$ETFS" -J -r -V "${LABEL::30}" -quiet "$dir" 2> "$log" && failed="y" ;;
genisoimage -o "$out" -b "$ETFS" -J -r -V "${LABEL::30}" -quiet "$dir" 2> "$log" || failed="y" ;;
* )
! genisoimage -o "$out" -b "$ETFS" -no-emul-boot -c "$cat" -iso-level 2 -J -l -D -N -joliet-long -relaxed-filenames -V "${LABEL::30}" \
-udf -allow-limited-size -quiet "$dir" 2> "$log" && failed="y" ;;
genisoimage -o "$out" -b "$ETFS" -no-emul-boot -c "$cat" -iso-level 2 -J -l -D -N -joliet-long -relaxed-filenames -V "${LABEL::30}" \
-udf -allow-limited-size -quiet "$dir" 2> "$log" || failed="y" ;;
esac

fi
Expand All @@ -956,7 +957,7 @@ buildImage() {
[ -s "$log" ] && error="$(<"$log")"
[[ "$error" != "$hide" ]] && echo "$error"

! mv -f "$out" "$BOOT" && return 1
mv -f "$out" "$BOOT" || return 1
return 0
}

Expand Down
2 changes: 1 addition & 1 deletion src/mido.sh
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ downloadFile() {
if [ "$total" -lt 100000000 ]; then
error "Invalid download link: $url (is only $total bytes?). Please report this at $SUPPORT/issues." && return 1
fi
! verifyFile "$iso" "$size" "$total" "$sum" && return 1
verifyFile "$iso" "$size" "$total" "$sum" || return 1
html "Download finished successfully..." && return 0
fi

Expand Down