summaryrefslogtreecommitdiffstats
path: root/remote/modules/vmware/data/opt
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules/vmware/data/opt')
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc10
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware.inc66
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc1
-rw-r--r--remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include36
4 files changed, 24 insertions, 89 deletions
diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc
index f8f43ad3..092abce5 100644
--- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc
+++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc
@@ -99,11 +99,15 @@ HEREEND
# Serial, parallel: Empty, nothing is being currently set. TODO later.
-# Graphics, GPU: 3D will be activated if FORCE3D is set.
-# Force3D is set in set_hardware.inc if SLX_VMWARE_3D is set in config.
-if [ -n "$FORCE3D" ]; then
+# Graphics, GPU: 3D will be enabled (even if vmware doesn't support the chip) if we whitelisted it.
+if [ -n "$SLX_VMWARE_3D" ]; then
writelog "FORCE3D set - overriding 3D in vmx file."
echo 'mks.gl.allowBlacklistedDrivers = "TRUE"' >> "$TMPDIR/$IMGUUID"
+ # We override... play safe and cap the hwVersion to 10, since some i915 chips goofed up with 12
+ # Investigate if we might have to do this in other cases where we don't override
+ if grep -qi '^mks.enable3d.*true' "$TMPDIR/$IMGUUID"; then
+ vmw_cap_hw_version "10"
+ fi
else
writelog "FORCE3D not set - 3D will only work if GPU/driver is whitelisted by vmware."
fi
diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware.inc
deleted file mode 100644
index a94f5b26..00000000
--- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware.inc
+++ /dev/null
@@ -1,66 +0,0 @@
-#########################################
-# Include: Hardware checks and settings #
-#########################################
-
-# check for 3D configuration setting
-case "$enable3d" in
- true|yes)
- enable3d="TRUE"
- ;;
- *)
- enable3d="FALSE"
- ;;
-esac
-
-# set standard sound card, overwrite depending on OS (options sb16, es1371, hdaudio)
-sound="es1371"
-
-# set sound card explicitly if there is more than one card in the host system
-sound_fileName='sound.fileName = "-1"
-sound.autodetect = "TRUE"'
-
-# check for whitelisted HW-3D
-source /opt/openslx/config
-FORCE3D=""
-if [ -n "$SLX_VMWARE_3D" ]; then
- FORCE3D='mks.gl.allowBlacklistedDrivers = "TRUE"'
-fi
-
-# read only the first 30 lines to be sure
-imghead=$(head -n 30 "${diskfile}")
-hwver=$(echo "${imghead}" | grep -m1 -ia "ddb.virtualHWVersion" | awk -F '"' '{print $2}')
-
-
-if [ -z "$override_hddtype" ]; then
- hddrv=$(echo "${imghead}" | grep -m1 -ia "ddb.adapterType" | awk -F '"' '{print $2}')
-else
- hddrv=$override_hddtype
-fi
-
-PCIE=
-case "${hddrv}" in
- ide)
- ide="TRUE"
- scsi="FALSE"
- ;;
- lsisas*)
- ide="FALSE"
- scsi="TRUE"
- PCIE='pciBridge4.present = "TRUE"
- pciBridge4.virtualDev = "pcieRootPort"
- pciBridge4.functions = "8"'
- ;;
- lsilogic|buslogic)
- ide="FALSE"
- scsi="TRUE"
- ;;
- scsi)
- ide="FALSE"
- scsi="TRUE"
- hddrv="lsilogic"
- ;;
- *)
- slxlog "virt-vmware-hdd" "vmware: Unknown HDD adapter type $hddrv"
- ;;
-esac
-
diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc
index 899f5aea..22718839 100644
--- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc
+++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_hardware_legacy.inc
@@ -43,7 +43,6 @@ case "$enable3d" in
esac
# check for whitelisted HW-3D
-source /opt/openslx/config
FORCE3D=""
if [ -n "$SLX_VMWARE_3D" ]; then
FORCE3D='mks.gl.allowBlacklistedDrivers = "TRUE"'
diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include
index f63092bd..5c76a180 100644
--- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include
+++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include
@@ -22,43 +22,41 @@
VMWAREINCLUDEDIR=/opt/openslx/vmchooser/vmware/includes
vmostype=$(rv_clean_string "$vmostype")
+# declaration of default variables for vmware
+source "${VMWAREINCLUDEDIR}/set_vmware_include_variables.inc" && set_vmware_include_variables
+# General global openslx config
+source /opt/openslx/config
+
+# TODO: Where to put global helper functions that could be used in several units below?
+vmw_cap_hw_version() {
+ [ -z "$1" ] && writelog "cap_hw_version called without parameter!" && return 1
+ [ "$1" -lt "$maxhardwareversion" ] && maxhardwareversion="$1"
+}
+
if [ "$LEGACY" ]; then
- # declaration of default variables for vmware
- source "${VMWAREINCLUDEDIR}/set_vmware_include_variables.inc" && set_vmware_include_variables
# hardware checks
- # sources /opt/openslx/config to check for whitelisted HW-3D
source "${VMWAREINCLUDEDIR}/set_hardware_legacy.inc" && set_hardware_legacy
# write configuration files
# write_config_files calls:
# set_vmhome_preferences_header
# set_vmware_startup_file
source "${VMWAREINCLUDEDIR}/write_config_files_legacy.inc" && write_config_files_legacy
- # logging and stdout
- # needs writelog() from vmchooser-run_virt
- source "${VMWAREINCLUDEDIR}/logging.inc" && logging
else
- # declaration of default variables for vmware
- source "${VMWAREINCLUDEDIR}/set_vmware_include_variables.inc" && set_vmware_include_variables
-
- # hardware checks: sources /opt/openslx/config to check for whitelisted HW-3D
- source "${VMWAREINCLUDEDIR}/set_hardware.inc"
-
# write configuration files
source "${VMWAREINCLUDEDIR}/write_config_files.inc"
# parse the given vmx file
source "${VMWAREINCLUDEDIR}/parse_vmx.inc"
+fi
- # logging and stdout
- # needs writelog() from vmchooser-run_virt
- source "${VMWAREINCLUDEDIR}/logging.inc" && logging
-
-fi
-
-# $maxhardwareversion
+# logging and stdout
+# needs writelog() from vmchooser-run_virt
+source "${VMWAREINCLUDEDIR}/logging.inc" && logging
+# Apply $maxhardwareversion to final VMX
HWVER=$(grep -i '^virtualHW.version *= *' "$conffile" | head -n 1 | awk -F '=' '{print $2}' | sed -r 's/[^0-9]//g')
if [ -n "$HWVER" ] && [ "$HWVER" -gt "$maxhardwareversion" ]; then
+ writelog "Hardware version capped to $maxhardwareversion (was $HWVER)"
sed -i 's/^virtualHW\.version.*$/virtualHW.version = "'$maxhardwareversion'"/I' "$conffile"
fi