mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Replace --efi flag with boot= property in the VM configuration
Choosing between Legacy BIOS and EFI booting is really a fixed feature of the VM not something that can be toggled at will. `boot=` has been added to the VM configuration file. Valid options are `legacy` or `efi|uefi`, if undefined it defaults to `legacy`.
This commit is contained in:
		
							parent
							
								
									84efcf2bf3
								
							
						
					
					
						commit
						97a2ebf3d0
					
				
					 1 changed files with 8 additions and 9 deletions
				
			
		
							
								
								
									
										17
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										17
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -98,19 +98,21 @@ function vm_boot() { | ||||||
|   echo "Starting ${VM}" |   echo "Starting ${VM}" | ||||||
|   echo " - QEMU:     ${QEMU} v${QEMU_VER}" |   echo " - QEMU:     ${QEMU} v${QEMU_VER}" | ||||||
| 
 | 
 | ||||||
|   if [ ${ENABLE_EFI} -eq 1 ]; then |   # Force to lowercase. | ||||||
|  |   boot=$(echo ${boot,,}) | ||||||
|  |   if [ "${boot}" == "efi" ] || [ "${boot}" == "uefi" ]; then | ||||||
|     if [ -e "${VIRGIL_PATH}/usr/share/qemu/edk2-x86_64-code.fd" ] ; then |     if [ -e "${VIRGIL_PATH}/usr/share/qemu/edk2-x86_64-code.fd" ] ; then | ||||||
|       if [ ! -e "${VMDIR}/${VMNAME}-vars.fd" ]; then |       if [ ! -e "${VMDIR}/${VMNAME}-vars.fd" ]; then | ||||||
|         cp "${VIRGIL_PATH}/usr/share/qemu/edk2-i386-vars.fd" "${VMDIR}/${VMNAME}-vars.fd" |         cp "${VIRGIL_PATH}/usr/share/qemu/edk2-i386-vars.fd" "${VMDIR}/${VMNAME}-vars.fd" | ||||||
|       fi |       fi | ||||||
|       BIOS="-drive if=pflash,format=raw,readonly,file=${VIRGIL_PATH}/usr/share/qemu/edk2-x86_64-code.fd -drive if=pflash,format=raw,file=${VMDIR}/${VMNAME}-vars.fd" |       BIOS="-drive if=pflash,format=raw,readonly,file=${VIRGIL_PATH}/usr/share/qemu/edk2-x86_64-code.fd -drive if=pflash,format=raw,file=${VMDIR}/${VMNAME}-vars.fd" | ||||||
|  |       echo " - BOOT:     EFI" | ||||||
|     else |     else | ||||||
|       echo " - EFI:      Booting requested but no EFI firmware found." |       echo " - BOOT:     Legacy BIOS" | ||||||
|       echo "             Booting from Legacy BIOS." |       echo " -           EFI Booting requested but no EFI firmware found." | ||||||
|     fi |     fi | ||||||
|     echo " - BIOS:     EFI" |  | ||||||
|   else |   else | ||||||
|     echo " - BIOS:     Legacy" |     echo " - BOOT:     Legacy BIOS" | ||||||
|   fi |   fi | ||||||
| 
 | 
 | ||||||
|   # Force to lowercase. |   # Force to lowercase. | ||||||
|  | @ -292,7 +294,6 @@ 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." |  | ||||||
|   echo "  --snapshot apply <tag>  : Apply/restore a snapshot." |   echo "  --snapshot apply <tag>  : Apply/restore a snapshot." | ||||||
|   echo "  --snapshot create <tag> : Create a snapshot." |   echo "  --snapshot create <tag> : Create a snapshot." | ||||||
|   echo "  --snapshot delete <tag> : Delete a snapshot." |   echo "  --snapshot delete <tag> : Delete a snapshot." | ||||||
|  | @ -302,6 +303,7 @@ function usage() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| # Lowercase variables are used in the VM config file only | # Lowercase variables are used in the VM config file only | ||||||
|  | boot="legacy" | ||||||
| guest_os="linux" | guest_os="linux" | ||||||
| iso="" | iso="" | ||||||
| driver_iso="" | driver_iso="" | ||||||
|  | @ -323,9 +325,6 @@ readonly VIRGIL_PATH="/snap/qemu-virgil/current" | ||||||
| 
 | 
 | ||||||
| while [ $# -gt 0 ]; do | while [ $# -gt 0 ]; do | ||||||
|   case "${1}" in |   case "${1}" in | ||||||
|     -efi|--efi) |  | ||||||
|       ENABLE_EFI=1 |  | ||||||
|       shift;; |  | ||||||
|     -delete|--delete) |     -delete|--delete) | ||||||
|       DELETE=1 |       DELETE=1 | ||||||
|       shift;; |       shift;; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue