summaryrefslogtreecommitdiffstats
path: root/remote/modules/run-virt/data/opt/openslx/scripts
diff options
context:
space:
mode:
authorSimon Rettberg2016-03-22 14:35:46 +0100
committerSimon Rettberg2016-03-22 14:35:46 +0100
commit65674c3d8915b2170b3a4f8c0722cf14dee52947 (patch)
tree81c743a69850ba45b5d4308693c81075d221a7c0 /remote/modules/run-virt/data/opt/openslx/scripts
parent[run-virt] Default to vmware shared folder for homedir for backwards compat (diff)
downloadtm-scripts-65674c3d8915b2170b3a4f8c0722cf14dee52947.tar.gz
tm-scripts-65674c3d8915b2170b3a4f8c0722cf14dee52947.tar.xz
tm-scripts-65674c3d8915b2170b3a4f8c0722cf14dee52947.zip
[run-virt/hwstats/vmware] Only enable KVM in guest if hw supports it
Otherwise vmware will refuse to start the virtual machine.
Diffstat (limited to 'remote/modules/run-virt/data/opt/openslx/scripts')
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc22
1 files changed, 16 insertions, 6 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc
index e74423ec..09430718 100644
--- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc
@@ -16,7 +16,12 @@ mkfs.fat "${FLOPPYIMG}" || mkfs.vfat "${FLOPPYIMG}" || mkdosfs "${FLOPPYIMG}"
# Create file with resolution information etc.
. "/opt/openslx/inc/shares"
-[ -z "$SHARE_REMAP_MODE" ] && SHARE_REMAP_MODE="3"
+if [ -z "$SHARE_REMAP_MODE" ]; then
+ SHARE_REMAP_MODE_INI="0"
+ SHARE_REMAP_MODE="3"
+else
+ SHARE_REMAP_MODE_INI="$SHARE_REMAP_MODE"
+fi
[ -z "$SHARE_CREATE_MISSING_REMAP" ] && SHARE_CREATE_MISSING_REMAP="1"
RESOLUTION=$(xrandr | grep -o -E 'connected\s*(primary)?\s*[0-9]+x[0-9]+\+0\+0' \
| grep -o -E -m1 '[0-9]+x[0-9]+')
@@ -25,7 +30,7 @@ cat > "${TMPDIR}/geraffel.ini" <<-HIER
[openslx]
resolution=${RESOLUTION}
createMissingRemap=${SHARE_CREATE_MISSING_REMAP}
-remapMode=${SHARE_REMAP_MODE}
+remapMode=${SHARE_REMAP_MODE_INI}
homeDrive=${SHARE_HOME_DRIVE}
[remap]
@@ -36,8 +41,14 @@ media=${SHARE_MEDIA}
other=${SHARE_OTHER}
HIER
+# Legacy: hostres.txt
+cat > "${TMPDIR}/hostres.txt" <<-HIER
+${RESOLUTION}
+This file is deprecated! Use geraffel.ini
+HIER
+
# Create file for network shares to mount
-SHARES="${TMPDIR}/shares.dat"
+declare -rg SHARES="${TMPDIR}/shares.dat"
touch "${SHARES}"
chmod 0600 "${SHARES}"
if pwdaemon --query "${TMPHOME}/.pwsocket" > "${SHARES}"; then
@@ -54,9 +65,8 @@ if pwdaemon --query "${TMPHOME}/.pwsocket" > "${SHARES}"; then
fi
# Copy all them files into floppy image
-mcopy -i "${FLOPPYIMG}" "${TMPDIR}/geraffel.ini" "::/"
+mcopy -i "${FLOPPYIMG}" "${TMPDIR}/geraffel.ini" "${TMPDIR}/hostres.txt" "${SHARES}" "::/"
mcopy -i "${FLOPPYIMG}" "$VMCHOOSER_DIR/data/openslx.exe" "::/"
-mcopy -i "${FLOPPYIMG}" "${SHARES}" "::/"
-rm -f -- "${SHARES}"
+rm -f -- "${SHARES}" "${TMPDIR}/geraffel.ini" "${TMPDIR}/hostres.txt"
unset SHARES VAR NETHOME