diff --git a/src/install.sh b/src/install.sh index e720408..895d3a6 100644 --- a/src/install.sh +++ b/src/install.sh @@ -128,6 +128,8 @@ finishInstall() { rm -f "$STORAGE/windows.old" rm -f "$STORAGE/windows.vga" + rm -f "$STORAGE/windows.net" + rm -f "$STORAGE/windows.usb" rm -f "$STORAGE/windows.args" rm -f "$STORAGE/windows.base" rm -f "$STORAGE/windows.boot" @@ -170,10 +172,18 @@ finishInstall() { echo "$ARGS" > "$STORAGE/windows.args" fi + if [ -n "${USB:-}" ] && [[ "${USB:-}" != "qemu-xhci"* ]]; then + echo "$USB" > "$STORAGE/windows.usb" + fi + if [ -n "${DISK_TYPE:-}" ] && [[ "${DISK_TYPE:-}" != "scsi" ]]; then echo "$DISK_TYPE" > "$STORAGE/windows.type" fi + if [ -n "${ADAPTER:-}" ] && [[ "${ADAPTER:-}" != "virtio-net-pci" ]]; then + echo "$ADAPTER" > "$STORAGE/windows.net" + fi + rm -rf "$TMP" return 0 } @@ -1054,6 +1064,20 @@ bootWindows() { ARGUMENTS="$ARGS ${ARGUMENTS:-}" fi + if [ -s "$STORAGE/windows.usb" ] && [ -f "$STORAGE/windows.usb" ]; then + if [ -z "${USB:-}" ]; then + USB=$(<"$STORAGE/windows.usb") + USB="${USB//[![:print:]]/}" + fi + fi + + if [ -s "$STORAGE/windows.net" ] && [ -f "$STORAGE/windows.net" ]; then + if [ -z "${ADAPTER:-}" ]; then + ADAPTER=$(<"$STORAGE/windows.net") + ADAPTER="${ADAPTER//[![:print:]]/}" + fi + fi + if [ -s "$STORAGE/windows.type" ] && [ -f "$STORAGE/windows.type" ]; then if [ -z "${DISK_TYPE:-}" ]; then DISK_TYPE=$(<"$STORAGE/windows.type")