Skip to content

Commit

Permalink
fix: Switch device type based on machine (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored May 22, 2024
1 parent c19dbe2 commit 1508c03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ set -Eeuo pipefail

BOOT_DESC=""
BOOT_OPTS=""
DRIVER_TYPE="ide"
SECURE=",smm=off"

if [[ "${BOOT_MODE,,}" == "windows"* ]]; then
Expand Down
12 changes: 8 additions & 4 deletions src/disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,16 @@ case "${DISK_TYPE,,}" in
* ) error "Invalid DISK_TYPE, value \"$DISK_TYPE\" is unrecognized!" && exit 80 ;;
esac

DRIVER_TYPE="ide"
MEDIA_TYPE="$DISK_TYPE"

if [[ "${MACHINE,,}" == "pc-q35-2"* ]]; then
DISK_TYPE="blk"
MEDIA_TYPE="ide"
fi
case "${MACHINE,,}" in
"virt" )
DRIVER_TYPE="usb" ;;
"pc-q35-2"* )
DISK_TYPE="blk"
MEDIA_TYPE="ide" ;;
esac

if [ -f "$BOOT" ] && [ -s "$BOOT" ]; then
DISK_OPTS=$(addMedia "$BOOT" "$MEDIA_TYPE" "0" "$BOOT_INDEX" "0x5")
Expand Down

0 comments on commit 1508c03

Please sign in to comment.