mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	Catch missing iso with non-bootable disk scenario
This commit is contained in:
		
							parent
							
								
									3a367090c2
								
							
						
					
					
						commit
						e566e38e9c
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		
							
								
								
									
										8
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										8
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -117,6 +117,10 @@ function vm_boot() { | ||||||
|   if [ ! -f "${disk_img}" ]; then |   if [ ! -f "${disk_img}" ]; then | ||||||
|       # If there is no disk image, create a new image. |       # If there is no disk image, create a new image. | ||||||
|       ${QEMU_IMG} create -q -f qcow2 "${disk_img}" "${disk}" |       ${QEMU_IMG} create -q -f qcow2 "${disk_img}" "${disk}" | ||||||
|  |       if [ -z "${iso}" ]; then | ||||||
|  |         echo "ERROR! You haven't specified a .iso image to boot from." | ||||||
|  |         exit 1 | ||||||
|  |       fi | ||||||
|       echo "             Just created, booting from ${iso}" |       echo "             Just created, booting from ${iso}" | ||||||
|     if [ $? -ne 0 ]; then |     if [ $? -ne 0 ]; then | ||||||
|       echo "ERROR! Failed to create ${disk_img} of ${disk}. Stopping here." |       echo "ERROR! Failed to create ${disk_img} of ${disk}. Stopping here." | ||||||
|  | @ -132,6 +136,10 @@ function vm_boot() { | ||||||
|       disk_curr_size=$(stat -c%s "${disk_img}") |       disk_curr_size=$(stat -c%s "${disk_img}") | ||||||
|       if [ ${disk_curr_size} -le ${disk_min_size} ]; then |       if [ ${disk_curr_size} -le ${disk_min_size} ]; then | ||||||
|         echo "             Looks unused, booting from ${iso}" |         echo "             Looks unused, booting from ${iso}" | ||||||
|  |         if [ -z "${iso}" ]; then | ||||||
|  |           echo "ERROR! You haven't specified a .iso image to boot from." | ||||||
|  |           exit 1 | ||||||
|  |         fi | ||||||
|       else |       else | ||||||
|         # If there is a disk image, that appears to have an install |         # If there is a disk image, that appears to have an install | ||||||
|         # then do not boot from the iso |         # then do not boot from the iso | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue