Simplify option for enabling EFI

pull/4/head
Martin Wimpress 5 years ago
parent b2c44fe879
commit bcae15019d
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
  1. 23
      quickemu.sh

@ -69,6 +69,15 @@ function vm_boot() {
iso="" iso=""
fi fi
if [ ${ENABLE_EFI} -eq 1 ]; then
if [ "${ENGINE}" == "virgil" ]; then
BIOS="-bios /snap/qemu-virgil/current/usr/share/qemu/OVMF.fd"
else
BIOS="-bios /usr/share/qemu/OVMF.fd"
fi
echo "${BIOS}"
fi
# If smbd is available, export $HOME to the guest via samba # If smbd is available, export $HOME to the guest via samba
if [ "${ENGINE}" == "virgil" ] && [ -e /snap/qemu-virgil/current/usr/sbin/smbd ]; then if [ "${ENGINE}" == "virgil" ] && [ -e /snap/qemu-virgil/current/usr/sbin/smbd ]; then
SAMBA=",smb=${HOME}" SAMBA=",smb=${HOME}"
@ -85,7 +94,7 @@ function vm_boot() {
fi fi
# Boot the iso image # Boot the iso image
qemu-${ENGINE} \ qemu-${ENGINE} ${BIOS} \
-cdrom "${iso}" \ -cdrom "${iso}" \
-drive "file=${disk_img},format=qcow2,if=virtio,aio=native,cache.direct=on" \ -drive "file=${disk_img},format=qcow2,if=virtio,aio=native,cache.direct=on" \
-enable-kvm \ -enable-kvm \
@ -102,7 +111,7 @@ function vm_boot() {
-device virtio-rng-pci,rng=rng0 \ -device virtio-rng-pci,rng=rng0 \
-device qemu-xhci \ -device qemu-xhci \
-device virtio-vga,virgl=on,edid=on,xres=${xres},yres=${yres} \ -device virtio-vga,virgl=on,edid=on,xres=${xres},yres=${yres} \
${display} ${BIOS} \ ${display} \
"$@" "$@"
} }
@ -113,16 +122,17 @@ function usage() {
echo echo
echo "You can also pass optional parameters" echo "You can also pass optional parameters"
echo " --delete : Delete the disk image." echo " --delete : Delete the disk image."
echo " --efi : Enable EFI BIOS (default)." echo " --efi : Enable EFI BIOS (experimental)."
echo " --legacy : Enable legacy BIOS." echo " --legacy : Enable legacy BIOS (default)."
echo " --restore : Restore the snapshot." echo " --restore : Restore the snapshot."
echo " --snapshot : Create a disk snapshot." echo " --snapshot : Create a disk snapshot."
echo " --virgil : Use virgil, if available." echo " --virgil : Use virgil, if available."
exit 1 exit 1
} }
BIOS="-bios /usr/share/qemu/OVMF.fd" BIOS=""
DELETE=0 DELETE=0
ENABLE_EFI=0
ENGINE="system-x86_64" ENGINE="system-x86_64"
RESTORE=0 RESTORE=0
SNAPSHOT=0 SNAPSHOT=0
@ -131,7 +141,7 @@ VM=""
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "${1}" in case "${1}" in
-efi|--efi) -efi|--efi)
BIOS="-bios /usr/share/qemu/OVMF.fd" ENABLE_EFI=1
shift;; shift;;
-delete|--delete) -delete|--delete)
DELETE=1 DELETE=1
@ -146,7 +156,6 @@ while [ $# -gt 0 ]; do
SNAPSHOT=1 SNAPSHOT=1
shift;; shift;;
-virgil|--virgil) -virgil|--virgil)
BIOS=""
ENGINE="virgil" ENGINE="virgil"
SAMBA="" SAMBA=""
shift;; shift;;

Loading…
Cancel
Save