diff options
author | Simon Rettberg | 2020-10-14 12:10:47 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-10-14 12:10:47 +0200 |
commit | a5010bbcd06c6a12d946558c4d85da089b02d440 (patch) | |
tree | 4cf3d21faaeb7e6a3c1af21155c74b24c4b59d7b /core/modules/vmware-version-check | |
parent | [vmware16] New module (diff) | |
download | mltk-a5010bbcd06c6a12d946558c4d85da089b02d440.tar.gz mltk-a5010bbcd06c6a12d946558c4d85da089b02d440.tar.xz mltk-a5010bbcd06c6a12d946558c4d85da089b02d440.zip |
[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.
Diffstat (limited to 'core/modules/vmware-version-check')
-rwxr-xr-x | core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version | 33 |
1 files changed, 11 insertions, 22 deletions
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" |