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
				
			
		
							
								
								
									
										10
									
								
								quickemu
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								quickemu
									
										
									
									
									
								
							|  | @ -279,16 +279,21 @@ function vm_boot() { | |||
|   fi | ||||
| 
 | ||||
|   local CORES_VM="1" | ||||
|   if [ -z "$cpu_cores" ]; then | ||||
|       local CORES_HOST=$(nproc --all) | ||||
|       if [ ${CORES_HOST} -ge 8 ]; then | ||||
|         CORES_VM="4" | ||||
|       elif [ ${CORES_HOST} -ge 4 ]; then | ||||
|         CORES_VM="2" | ||||
|       fi | ||||
|   else | ||||
|       CORES_VM="$cpu_cores" | ||||
|   fi | ||||
|   local SMP="-smp ${CORES_VM},sockets=1,cores=${CORES_VM},threads=1" | ||||
|   echo " - CPU:      ${CORES_VM} Core(s)" | ||||
| 
 | ||||
|   local RAM_VM="2G" | ||||
|   if [ -z "$ram" ]; then | ||||
|       local RAM_HOST=$(free --mega -h | grep Mem | cut -d':' -f2 | cut -d'G' -f1 | sed 's/ //g') | ||||
|       #Round up - https://github.com/wimpysworld/quickemu/issues/11 | ||||
|       RAM_HOST=$(printf '%.*f\n' 0 ${RAM_HOST}) | ||||
|  | @ -297,6 +302,9 @@ function vm_boot() { | |||
|       elif [ ${RAM_HOST} -ge 16 ]; then | ||||
|         RAM_VM="3G" | ||||
|       fi | ||||
|   else | ||||
|       RAM_VM="$ram" | ||||
|   fi | ||||
|   echo " - RAM:      ${RAM_VM}" | ||||
| 
 | ||||
|   local X_RES=1152 | ||||
|  | @ -505,6 +513,8 @@ driver_iso="" | |||
| disk_img="" | ||||
| disk="64G" | ||||
| usb_devices=() | ||||
| ram="" | ||||
| cpu_cores="" | ||||
| 
 | ||||
| DELETE=0 | ||||
| ENABLE_EFI=0 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue