mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	When deleting a disk, also remove the EFI vars
This commit is contained in:
		
							parent
							
								
									96b0c9ebea
								
							
						
					
					
						commit
						fcc050ed82
					
				
					 1 changed files with 12 additions and 4 deletions
				
			
		
							
								
								
									
										16
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -4,6 +4,11 @@ export LC_ALL=C | ||||||
| function disk_delete() { | function disk_delete() { | ||||||
|   if [ -e "${disk_img}" ]; then |   if [ -e "${disk_img}" ]; then | ||||||
|     rm "${disk_img}" |     rm "${disk_img}" | ||||||
|  |     # Remove any EFI vars, but not for macOS | ||||||
|  |     rm "${VMDIR}/OVMF_VARS_4M.fd" >/dev/null 2>&1 | ||||||
|  |     rm "${VMPATH}/${VMDIR}/OVMF_VARS_4M.fd" >/dev/null 2>&1 | ||||||
|  |     rm "${VMDIR}/${VMNAME}-vars.fd" >/dev/null 2>&1 | ||||||
|  |     rm "${VMPATH}/${VMDIR}/${VMNAME}-vars.fd" > /dev/null 2>&1 | ||||||
|     echo "SUCCESS! Deleted ${disk_img}" |     echo "SUCCESS! Deleted ${disk_img}" | ||||||
|   else |   else | ||||||
|     echo "NOTE! ${disk_img} not found. Doing nothing." |     echo "NOTE! ${disk_img} not found. Doing nothing." | ||||||
|  | @ -135,10 +140,6 @@ function check_cpu_flag() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function vm_boot() { | function vm_boot() { | ||||||
|   local VMNAME="" |  | ||||||
|   VMNAME=$(basename "${VM}" .conf) |  | ||||||
|   local VMDIR="" |  | ||||||
|   VMDIR=$(dirname "${disk_img}") |  | ||||||
|   local BALLOON="-device virtio-balloon" |   local BALLOON="-device virtio-balloon" | ||||||
|   local CPU="" |   local CPU="" | ||||||
|   local GUEST_CPU_CORES="" |   local GUEST_CPU_CORES="" | ||||||
|  | @ -794,6 +795,9 @@ SNAPSHOT_TAG="" | ||||||
| STATUS_QUO="" | STATUS_QUO="" | ||||||
| USB_PASSTHROUGH="" | USB_PASSTHROUGH="" | ||||||
| VM="" | VM="" | ||||||
|  | VMDIR="" | ||||||
|  | VMNAME="" | ||||||
|  | VMPATH="" | ||||||
| 
 | 
 | ||||||
| readonly LAUNCHER=$(basename "${0}") | readonly LAUNCHER=$(basename "${0}") | ||||||
| readonly DISK_MIN_SIZE=$((197632 * 8)) | readonly DISK_MIN_SIZE=$((197632 * 8)) | ||||||
|  | @ -899,6 +903,10 @@ if [ -n "${VM}" ] && [ -e "${VM}" ]; then | ||||||
|     exit 1 |     exit 1 | ||||||
|   fi |   fi | ||||||
| 
 | 
 | ||||||
|  |   VMDIR=$(dirname "${disk_img}") | ||||||
|  |   VMNAME=$(basename "${VM}" .conf) | ||||||
|  |   VMPATH=$(dirname "${VM}") | ||||||
|  | 
 | ||||||
|   # Backwards compatibility for ${driver_iso} |   # Backwards compatibility for ${driver_iso} | ||||||
|   if [ -n "${driver_iso}" ] && [ -z "${fixed_iso}" ]; then |   if [ -n "${driver_iso}" ] && [ -z "${fixed_iso}" ]; then | ||||||
|     fixed_iso="${driver_iso}" |     fixed_iso="${driver_iso}" | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue