From a5010bbcd06c6a12d946558c4d85da089b02d440 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 14 Oct 2020 12:10:47 +0200 Subject: [rfs-stage32/vmware*] Change vmware version naming Hard-coding the version check to VMware 12 and 15 isn't great for future updates -- i.e. now, that VMware 16 is released. Instead make the version check script return "new" or "legacy", and rename the targets: vmware12 -> vmware-legacy vmware15 -> vmware The addon downloading/setup should then act upon this accordingly. --- .../opt/openslx/bin/vmware-get-supported-version | 33 ++++++++-------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'core/modules/vmware-version-check') diff --git a/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version b/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version index 24382bca..887e995b 100755 --- a/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version +++ b/core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version @@ -3,42 +3,31 @@ # * Intel: check for "VMX Unrestricted Guest" CPU flag # * AMD: check if CPU family is Bulldozer or newer -VIRTTYPE=$(grep -m1 '^flags\s*:' /proc/cpuinfo | grep -wo -e svm -e vmx) +VIRTTYPE="$( grep -m1 '^flags\s*:' /proc/cpuinfo | grep -woF -e svm -e vmx )" if [ -z "$VIRTTYPE" ]; then - echo 12 + # No need to bother with msr + echo "legacy" exit 0 fi modprobe msr -VT= +version="legacy" if [ "$VIRTTYPE" = "vmx" ]; then # intel - BIT1=$(rdmsr --bitfield 0:0 0x3a 2>/dev/null || echo "fail") - BIT2=$(rdmsr --bitfield 2:2 0x3a 2>/dev/null || echo "fail") + BIT1="$( rdmsr --bitfield 0:0 0x3a 2>/dev/null || echo "fail" )" + BIT2="$( rdmsr --bitfield 2:2 0x3a 2>/dev/null || echo "fail" )" if [ "$BIT1" = "0" ] || [ "$BIT2" = "1" ]; then - VT="ENABLED" + flag="$( rdmsr --bitfield 5:5 0x485 )" + [ "$flag" = "1" ] && version="new" fi elif [ "$VIRTTYPE" = "svm" ]; then # amd - BIT=$(rdmsr --bitfield 4:4 0xc0010114 2>/dev/null || echo "fail") + BIT="$( rdmsr --bitfield 4:4 0xc0010114 2>/dev/null || echo "fail" )" if [ "$BIT" = "0" ]; then - VT="ENABLED" + family="$( awk '$1$2 == "cpufamily" {print $NF;exit}' /proc/cpuinfo )" + [ "$family" -ge 21 ] && version="new" fi fi -if [ "$VT" != "ENABLED" ]; then - echo 12 - exit 0 -fi - -version=12 -if [ "$VIRTTYPE" = "vmx" ]; then - flag="$( rdmsr --bitfield 5:5 0x485 )" - [ "$flag" = "1" ] && version=15 -elif [ "$VIRTTYPE" = "svm" ]; then - family="$( awk '$1$2 == "cpufamily" {print $NF;exit}' /proc/cpuinfo )" - [ "$family" -ge 21 ] && version=15 -fi - echo "$version" -- cgit v1.2.3-55-g7522