feat: Include drivers in image

This commit is contained in:
Kroese 2024-01-14 19:19:05 +01:00 committed by GitHub
parent efd1d1498e
commit 831d623fdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -Eeuo pipefail set -Eeuo pipefail
: "${VERSION:="win10x64"}" : "${VERSION:="win11x64"}"
BASE="$VERSION.iso" BASE="$VERSION.iso"
[ -f "$STORAGE/$BASE" ] && return 0 [ -f "$STORAGE/$BASE" ] && return 0
@ -13,6 +13,9 @@ else
PROGRESS="--progress=dot:giga" PROGRESS="--progress=dot:giga"
fi fi
DEST="$STORAGE/drivers.img"
[ ! -f "$DEST" ] && cp /run/drivers.img $DEST
rm -rf "$STORAGE/tmp" rm -rf "$STORAGE/tmp"
mkdir -p "$STORAGE/tmp" mkdir -p "$STORAGE/tmp"
SCRIPT="$STORAGE/tmp/mido.sh" SCRIPT="$STORAGE/tmp/mido.sh"
@ -36,17 +39,4 @@ rm -rf "$STORAGE/tmp"
cd /run cd /run
DEST="$STORAGE/drivers.img"
if [ ! -f "$DEST" ]; then
info "Downloading VirtIO drivers for Windows..."
DRIVERS="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso"
{ wget "$DRIVERS" -O "$DEST" -q --no-check-certificate --show-progress "$PROGRESS"; rc=$?; } || :
(( rc != 0 )) && info "Failed to download $DRIVERS, reason: $rc" && rm -f "$DEST"
fi
return 0 return 0