summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt/data/opt/openslx/system-check/hooks.d
diff options
context:
space:
mode:
authorJonathan Bauer2019-10-31 17:00:23 +0100
committerJonathan Bauer2019-10-31 17:00:23 +0100
commitba6753cfabc149cc312f33a3c507b1cc0dbcee3b (patch)
treebf12c077ce4c1722a20319fc82b3eb2143b65a2c /core/modules/run-virt/data/opt/openslx/system-check/hooks.d
parent[vmware-common] Fix launching usbarbitrator with 15.5.x (diff)
downloadmltk-ba6753cfabc149cc312f33a3c507b1cc0dbcee3b.tar.gz
mltk-ba6753cfabc149cc312f33a3c507b1cc0dbcee3b.tar.xz
mltk-ba6753cfabc149cc312f33a3c507b1cc0dbcee3b.zip
[*] introduce system-check
* hardware stats now only reports hardware info data in /run/hwinfo and /run/hwreport * system-check hooks will generate lightdm warnings and curl the report to the satellite * run-virt now handles the ID44 warnings to cope for network shares on /tmp/virt WARNING PROFI111!
Diffstat (limited to 'core/modules/run-virt/data/opt/openslx/system-check/hooks.d')
-rwxr-xr-xcore/modules/run-virt/data/opt/openslx/system-check/hooks.d/30-run-virt44
1 files changed, 44 insertions, 0 deletions
diff --git a/core/modules/run-virt/data/opt/openslx/system-check/hooks.d/30-run-virt b/core/modules/run-virt/data/opt/openslx/system-check/hooks.d/30-run-virt
new file mode 100755
index 00000000..2621ec83
--- /dev/null
+++ b/core/modules/run-virt/data/opt/openslx/system-check/hooks.d/30-run-virt
@@ -0,0 +1,44 @@
+#!/bin/ash
+
+. /opt/openslx/config
+. /opt/openslx/bin/slx-tools
+. /run/hwinfo
+
+if [ -n "$1" ]; then
+ exec >> "$1"
+fi
+
+if [ "$HW_KVM" = "DISABLED" ]; then
+ echo 'slx-virt-kvm-disabled'
+elif [ "$HW_KVM" = "UNSUPPORTED" ]; then
+ echo 'slx-virt-kvm-unsupported'
+fi
+
+if [ -n "$HW_MBRAM" ] && [ "$HW_MBRAM" -lt 3400 ]; then
+ GB=$(( ( HW_MBRAM + 300 ) / 1024 ))
+ echo "slx-virt-lowmemory|${GB}"
+fi
+
+if [ -n "$SLX_VM_NFS" ] && ! systemctl status mount-vm-store >/dev/null; then
+ echo 'slx-virt-vmstore-fail'
+fi
+
+# TODO: when native sessions will be rolled out, we should always
+# check if an ID44 partition is present (to back the base OS).
+if fs_path_ismountpoint /tmp/virt; then
+ exit 0
+fi
+
+if [ "$HW_ID44" = "0" ]; then
+ echo 'slx-virt-noid44'
+ if [ "$HW_HDDCOUNT" = "0" ]; then
+ echo 'slx-virt-noid44-nohdd'
+ elif [ -n "$HW_HDDCOUNT" ]; then
+ echo 'slx-virt-noid44-hdd'
+ fi
+ if [ -n "$HW_MBRAM" ] && [ "$HW_MBRAM" -lt 4500 ]; then
+ echo 'slx-virt-noid44-lowmemory'
+ fi
+elif [ -n "$HW_ID44" ] && [ "$HW_ID44" -lt 10000 ]; then
+ echo 'slx-virt-id44-small'
+fi