diff options
author | Simon Rettberg | 2016-01-13 22:13:07 +0100 |
---|---|---|
committer | Simon Rettberg | 2016-01-13 22:13:07 +0100 |
commit | 4d1c783aa4e0a4c842e278fbf2dc99448c24e629 (patch) | |
tree | ebe13c7377abf71606c4cff44c420d8845053226 | |
parent | [vmware] Remove useless include (diff) | |
download | tm-scripts-4d1c783aa4e0a4c842e278fbf2dc99448c24e629.tar.gz tm-scripts-4d1c783aa4e0a4c842e278fbf2dc99448c24e629.tar.xz tm-scripts-4d1c783aa4e0a4c842e278fbf2dc99448c24e629.zip |
[vmware] Cap hwversion to 10 if enable3d && useBlacklistedDriver
3 files changed, 23 insertions, 19 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_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 4b30c5e6..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,40 +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 - # write configuration files source "${VMWAREINCLUDEDIR}/write_config_files.inc" # parse the given vmx file source "${VMWAREINCLUDEDIR}/parse_vmx.inc" - - # 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 |