mirror of
				https://github.com/oSoWoSo/DistroHopper.git
				synced 2024-08-14 22:46:53 +00:00 
			
		
		
		
	* Fix #21 configurable RAM and #22 configurable cores * Initialize new config values with empty strings
This commit is contained in:
		
							parent
							
								
									64cff9bbab
								
							
						
					
					
						commit
						8618421abb
					
				
					 1 changed files with 22 additions and 12 deletions
				
			
		
							
								
								
									
										34
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										34
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -279,23 +279,31 @@ function vm_boot() { | ||||||
|   fi |   fi | ||||||
| 
 | 
 | ||||||
|   local CORES_VM="1" |   local CORES_VM="1" | ||||||
|   local CORES_HOST=$(nproc --all) |   if [ -z "$cpu_cores" ]; then | ||||||
|   if [ ${CORES_HOST} -ge 8 ]; then |       local CORES_HOST=$(nproc --all) | ||||||
|     CORES_VM="4" |       if [ ${CORES_HOST} -ge 8 ]; then | ||||||
|   elif [ ${CORES_HOST} -ge 4 ]; then |         CORES_VM="4" | ||||||
|     CORES_VM="2" |       elif [ ${CORES_HOST} -ge 4 ]; then | ||||||
|  |         CORES_VM="2" | ||||||
|  |       fi | ||||||
|  |   else | ||||||
|  |       CORES_VM="$cpu_cores" | ||||||
|   fi |   fi | ||||||
|   local SMP="-smp ${CORES_VM},sockets=1,cores=${CORES_VM},threads=1" |   local SMP="-smp ${CORES_VM},sockets=1,cores=${CORES_VM},threads=1" | ||||||
|   echo " - CPU:      ${CORES_VM} Core(s)" |   echo " - CPU:      ${CORES_VM} Core(s)" | ||||||
| 
 | 
 | ||||||
|   local RAM_VM="2G" |   local RAM_VM="2G" | ||||||
|   local RAM_HOST=$(free --mega -h | grep Mem | cut -d':' -f2 | cut -d'G' -f1 | sed 's/ //g') |   if [ -z "$ram" ]; then | ||||||
|   #Round up - https://github.com/wimpysworld/quickemu/issues/11 |       local RAM_HOST=$(free --mega -h | grep Mem | cut -d':' -f2 | cut -d'G' -f1 | sed 's/ //g') | ||||||
|   RAM_HOST=$(printf '%.*f\n' 0 ${RAM_HOST}) |       #Round up - https://github.com/wimpysworld/quickemu/issues/11 | ||||||
|   if [ ${RAM_HOST} -ge 64 ]; then |       RAM_HOST=$(printf '%.*f\n' 0 ${RAM_HOST}) | ||||||
|     RAM_VM="4G" |       if [ ${RAM_HOST} -ge 64 ]; then | ||||||
|   elif [ ${RAM_HOST} -ge 16 ]; then |         RAM_VM="4G" | ||||||
|     RAM_VM="3G" |       elif [ ${RAM_HOST} -ge 16 ]; then | ||||||
|  |         RAM_VM="3G" | ||||||
|  |       fi | ||||||
|  |   else | ||||||
|  |       RAM_VM="$ram" | ||||||
|   fi |   fi | ||||||
|   echo " - RAM:      ${RAM_VM}" |   echo " - RAM:      ${RAM_VM}" | ||||||
| 
 | 
 | ||||||
|  | @ -505,6 +513,8 @@ driver_iso="" | ||||||
| disk_img="" | disk_img="" | ||||||
| disk="64G" | disk="64G" | ||||||
| usb_devices=() | usb_devices=() | ||||||
|  | ram="" | ||||||
|  | cpu_cores="" | ||||||
| 
 | 
 | ||||||
| DELETE=0 | DELETE=0 | ||||||
| ENABLE_EFI=0 | ENABLE_EFI=0 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue