mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2024-08-14 22:46:53 +00:00
Simplify option for enabling EFI
This commit is contained in:
parent
b2c44fe879
commit
bcae15019d
1 changed files with 16 additions and 7 deletions
23
quickemu.sh
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…
Reference in a new issue