More reliable and often faster check to determine virtualization.

This commit is contained in:
Mark Ruys 2015-07-27 12:38:13 +02:00
parent c998924b51
commit 919e48001d

View File

@ -590,6 +590,19 @@
# 0 = no, 1 = yes, 2 = unknown
ISVIRTUALMACHINE=2; VMTYPE="unknown"; VMFULLTYPE="Unknown"
# Trying facter
if [ -x /usr/bin/facter ]; then
case "`facter is_virtual`" in
"true")
VMTYPE=`facter virtual`
logtext "Result: found virtual machine (type: ${VMTYPE})"
report "vm=1"
report "vmtype=${VMTYPE}"
return ;;
"false") return ;;
esac
fi
SHORT=""
# Trying systemd
@ -601,6 +614,13 @@
fi
fi
# # dmidecode
# if [ "${SHORT}" = "" ]; then
# if [ -x /usr/sbin/dmidecode ]; then
# SHORT=`dmidecode -s system-product-name`
# fi
# fi
# lshw
if [ "${SHORT}" = "" ]; then
if [ -x /usr/bin/lshw ]; then