summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmchooser/files/run-virt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'os-plugins/plugins/vmchooser/files/run-virt.sh')
-rw-r--r--os-plugins/plugins/vmchooser/files/run-virt.sh11
1 files changed, 5 insertions, 6 deletions
diff --git a/os-plugins/plugins/vmchooser/files/run-virt.sh b/os-plugins/plugins/vmchooser/files/run-virt.sh
index adfc737e..771ebef4 100644
--- a/os-plugins/plugins/vmchooser/files/run-virt.sh
+++ b/os-plugins/plugins/vmchooser/files/run-virt.sh
@@ -121,22 +121,21 @@ cpu_cores="${cpu_cores}"
# check for CPU virtualization flags
-# get total amount of memory installed in your machine
-totalmem=$(expr $(grep -i "memtotal" /proc/meminfo | awk '{print $2}') / 1024)
+# total amount of memory defined in stage 3
permem=60
+# get a result which can be divided through 4
mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4)
+[ -n "${mainvirtmem}" ] && forcemem=$(expr ${mainvirtmem} / 4 \* 4)
# configuring ethernet mac address: first 3 bytes are fixed (00:50:56)
# 4th byte is the VM-ID (0D)
# last two bytes are taken from the bridge of the host
# define one MAC per guest
macguestpart="00:50:56:${VM_ID}"
-machostpart=$($(which ifconfig) br0 | grep br0 | sed -e "s/ //g" | \
- awk -F ":" '{print $(NF-1)":"$NF}')
+machostpart=$(echo ${machostaddr} | awk -F ":" '{print $(NF-1)":"$NF}')
macaddr=$(echo "${macguestpart}:${machostpart}" | tr [a-z] [A-Z])
#TODO: remove when vmware modified
-mac=$(/sbin/ifconfig eth0 | grep eth0 | sed -e "s/ //g" \
- | awk -F ":" '{print $(NF-1)":"$NF}')
+mac=${machostpart}
# virtual fd/cd/dvd and drive devices, floppy b: for configuration
# if $floppy_0 from run-virt.include set then fdtest="TRUE"