summaryrefslogtreecommitdiffstats
path: root/remote/modules/hardware-stats/data
diff options
context:
space:
mode:
authorSimon Rettberg2016-03-22 14:35:46 +0100
committerSimon Rettberg2016-03-22 14:35:46 +0100
commit65674c3d8915b2170b3a4f8c0722cf14dee52947 (patch)
tree81c743a69850ba45b5d4308693c81075d221a7c0 /remote/modules/hardware-stats/data
parent[run-virt] Default to vmware shared folder for homedir for backwards compat (diff)
downloadtm-scripts-65674c3d8915b2170b3a4f8c0722cf14dee52947.tar.gz
tm-scripts-65674c3d8915b2170b3a4f8c0722cf14dee52947.tar.xz
tm-scripts-65674c3d8915b2170b3a4f8c0722cf14dee52947.zip
[run-virt/hwstats/vmware] Only enable KVM in guest if hw supports it
Otherwise vmware will refuse to start the virtual machine.
Diffstat (limited to 'remote/modules/hardware-stats/data')
-rwxr-xr-xremote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats15
1 files changed, 11 insertions, 4 deletions
diff --git a/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats b/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
index ce910a2b..0331cada 100755
--- a/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
+++ b/remote/modules/hardware-stats/data/opt/openslx/scripts/systemd-hardware_stats
@@ -129,13 +129,13 @@ fi
# A) Read system model and manufacturer
dmidec() {
- local MODEL=$(dmidecode "$@" | sed 's/\s\s*/ /g;s/^ //;s/ $//')
- case "$MODEL" in
+ local LMODEL=$(dmidecode "$@" 2>/dev/null | sed 's/\s\s*/ /g;s/^ //;s/ $//')
+ case "$LMODEL" in
""|*"Product Name"*|*"be filled"*|"unknown"|*"product name"*)
- MODEL="Unknown"
+ LMODEL="Unknown"
;;
esac
- echo "$MODEL"
+ echo "$LMODEL"
}
MODEL=$(dmidec -s system-product-name)
MANUF=$(dmidec -s system-manufacturer)
@@ -180,6 +180,13 @@ EOF
[ -n "$ALLSMART" ] && rm -f -- "$ALLSMART"
+# Put some info in local file for later use
+cat > "/run/hwinfo" <<HORST
+HW_KVM='${VT}'
+HW_ID44='${ID44}'
+HW_MBRAM='${RAM}'
+HORST
+
# Fire away
for DELAY in 1 1 0; do
if curl --data-urlencode "type=~poweron" --data-urlencode "uuid=$UUID" --data-urlencode "macaddr=$MAC" \