From bf67a23c74873aa616f6b1b8359ef663978f8c46 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 13 Oct 2020 11:31:30 +0200 Subject: [vmware-common] Hard-coded lookup table for hwversion Unfortunately, looking this up from files lying around was a short-lived endeavor. --- .../vmchooser/plugins/vmware/includes/init_core.inc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'core/modules/vmware-common') diff --git a/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/init_core.inc b/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/init_core.inc index 8a71a21b..ae1900cd 100644 --- a/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/init_core.inc +++ b/core/modules/vmware-common/data/opt/openslx/vmchooser/plugins/vmware/includes/init_core.inc @@ -39,9 +39,17 @@ $(safesource "${VMWARE_PLUGIN_DIR}/vmware.conf") # Try to tell from the xml files in this dir, and hope nobody added any gmax="$( find /etc/vmware/hostd/env/ -name "ws-*.xml" | grep -o '[0-9]*' | sort -nr | head -n 1 )" if [ -z "$gmax" ]; then - # Failed, guess major version number == max hw version, which unfortunately VMware decided to fuck up with - # VMware 15.1.0, which supports hw version 16 - gmax="$( grep -m 1 -F '.product.version' /etc/vmware/config | grep -o '[0-9]*' | head -n 1 )" + # Failed, VMware 16 doesn't have above xml files anymore, great. Back to hard coded lists + gmax="$( grep -m 1 -F '.product.version' /etc/vmware/config | grep -oE '[0-9]+\.[0-9.]+' | head -n 1 )" + case "$gmax" in + 16.*) gmax=18 ;; + 15.5.*|15.1.*) gmax=16 ;; + *) + # No hit, guess major version number == max hw version, which unfortunately VMware decided to fuck up with + # VMware 15.1.0, which supports hw version 16 + gmax="${gmax%%.*}" + ;; + esac fi [ -n "$gmax" ] && maxhardwareversion="$gmax" -- cgit v1.2.3-55-g7522