diff options
-rwxr-xr-x | core/modules/vmware-version-check/data/opt/openslx/bin/vmware-get-supported-version | 33 | ||||
-rwxr-xr-x | core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-download_slx_addons | 14 | ||||
l--------- | core/targets/vmware-legacy/kernel (renamed from core/targets/vmware12/kernel) | 0 | ||||
l--------- | core/targets/vmware-legacy/vmware (renamed from core/targets/vmware12/vmware) | 0 | ||||
l--------- | core/targets/vmware-legacy/vmware-common (renamed from core/targets/vmware12/vmware-common) | 0 | ||||
l--------- | core/targets/vmware/kernel | 1 | ||||
l--------- | core/targets/vmware/vmware-common (renamed from core/targets/vmware15/vmware-common) | 0 | ||||
l--------- | core/targets/vmware/vmware16 | 1 | ||||
l--------- | core/targets/vmware15/kernel | 1 | ||||
l--------- | core/targets/vmware15/vmware15 | 1 |
10 files changed, 22 insertions, 29 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" diff --git a/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-download_slx_addons b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-download_slx_addons index 73e0efb1..c9b06f9d 100755 --- a/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-download_slx_addons +++ b/core/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-download_slx_addons @@ -18,7 +18,7 @@ . /opt/openslx/config || { echo "Could not source config!"; exit 23; } # source functions.inc for the download function -. /opt/openslx/inc/functions || { echo "/opt/openslx/inc/functions not found!"; exit 1337; } +. /opt/openslx/inc/functions || { echo "/opt/openslx/inc/functions not found!"; exit 42; } # quick fix for the missing FUTURE_ROOT needed by /opt/openslx/etc/functions.inc export FUTURE_ROOT="/" @@ -65,13 +65,17 @@ if [ $# -eq 1 ]; then FILE="$ADDON" if [ "$ADDON" = "vmware" ]; then # check with the helper - version="$(vmware-get-supported-version)" - FILE="vmware$version" - echo "Deciding to download $FILE instead of $ADDON after checking CPU" + version="$( vmware-get-supported-version )" + if [ "$version" = "legacy" ]; then + FILE="${ADDON}-${version}" + fi + echo "Deciding to download flavor '$version' of $ADDON ($FILE) after checking CPU" fi # XXX if ! download "${SLX_BASE_PATH}/${FILE}.sqfs" "${ADDON_TARGET_PATH}"; then - slxlog --echo "addon-download" "Download of '${HTTP_BASE_PATH}/${ADDON}.sqfs' failed." + if [ "$ADDON" = "$FILE" ] || ! download "${SLX_BASE_PATH}/${ADDON}.sqfs" "${ADDON_TARGET_PATH}"; then + slxlog --echo "addon-download" "Download of '${HTTP_BASE_PATH}/${FILE}.sqfs' failed. (${ADDON})" + fi exit 1 fi fi diff --git a/core/targets/vmware12/kernel b/core/targets/vmware-legacy/kernel index 1369e8ff..1369e8ff 120000 --- a/core/targets/vmware12/kernel +++ b/core/targets/vmware-legacy/kernel diff --git a/core/targets/vmware12/vmware b/core/targets/vmware-legacy/vmware index ea1b2f86..ea1b2f86 120000 --- a/core/targets/vmware12/vmware +++ b/core/targets/vmware-legacy/vmware diff --git a/core/targets/vmware12/vmware-common b/core/targets/vmware-legacy/vmware-common index bae6192c..bae6192c 120000 --- a/core/targets/vmware12/vmware-common +++ b/core/targets/vmware-legacy/vmware-common diff --git a/core/targets/vmware/kernel b/core/targets/vmware/kernel new file mode 120000 index 00000000..1369e8ff --- /dev/null +++ b/core/targets/vmware/kernel @@ -0,0 +1 @@ +../../modules/kernel-vanilla
\ No newline at end of file diff --git a/core/targets/vmware15/vmware-common b/core/targets/vmware/vmware-common index bae6192c..bae6192c 120000 --- a/core/targets/vmware15/vmware-common +++ b/core/targets/vmware/vmware-common diff --git a/core/targets/vmware/vmware16 b/core/targets/vmware/vmware16 new file mode 120000 index 00000000..b6b5d82b --- /dev/null +++ b/core/targets/vmware/vmware16 @@ -0,0 +1 @@ +../../modules/vmware16
\ No newline at end of file diff --git a/core/targets/vmware15/kernel b/core/targets/vmware15/kernel deleted file mode 120000 index 044f086d..00000000 --- a/core/targets/vmware15/kernel +++ /dev/null @@ -1 +0,0 @@ -../../modules/kernel
\ No newline at end of file diff --git a/core/targets/vmware15/vmware15 b/core/targets/vmware15/vmware15 deleted file mode 120000 index 4918a2a2..00000000 --- a/core/targets/vmware15/vmware15 +++ /dev/null @@ -1 +0,0 @@ -../../modules/vmware15
\ No newline at end of file |