summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt/data/opt/openslx/vmchooser
diff options
context:
space:
mode:
authorJonathan Bauer2017-08-15 17:24:18 +0200
committerJonathan Bauer2017-08-15 17:24:18 +0200
commit28347a8abc243400b4da797a37b35749dc6928f0 (patch)
treebc8d49f3669cd18188a219fad0052c4ea76fa580 /core/modules/run-virt/data/opt/openslx/vmchooser
parent[rfs-s32] add ext. regey for grep use (diff)
downloadmltk-28347a8abc243400b4da797a37b35749dc6928f0.tar.gz
mltk-28347a8abc243400b4da797a37b35749dc6928f0.tar.xz
mltk-28347a8abc243400b4da797a37b35749dc6928f0.zip
[run-virt] check for tmp on hdd once
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser')
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/init_core.inc6
-rw-r--r--core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc2
2 files changed, 7 insertions, 1 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/init_core.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/init_core.inc
index 942c7887..2d9239d0 100644
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/init_core.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/init_core.inc
@@ -31,5 +31,11 @@ if check_dep mkdir && ! mkdir -p "$TMPDIR"; then
EXIT_TYPE="internal" EXIT_REASON="Konnte kein Arbeitsverzeichnis für die VM-Sitzung anlegen." cleanexit 1
fi
+# Determine if /tmp resides on the hdd
+if grep -q -E '^/dev/\S+\s/tmp' '/proc/mounts'; then
+ writelog "Hard drive partition mounted on /tmp"
+ declare -rg TMP_ON_HDD=1
+fi
+
# Get a unique VM_ID for the current invocation
get_vm_id
diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
index 1319163d..46af7496 100644
--- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
+++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt-includes/set_runvirt_hardware_variables.inc
@@ -34,7 +34,7 @@ set_virt_memory() {
# Amount of memory for the VM. Be generous if diff is written to HDD
local min=768
local reserve max
- if mount | grep -q '^/dev/sd.*on.*/tmp'; then
+ if isset TMP_ON_HDD; then
if lsmod | grep -q '^nvidia'; then
max=2800
reserve=28