From 5f24e4340171913248a6965ff2153e2517cb892a Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 31 Jul 2015 09:05:51 +0200 Subject: [PATCH] 90qemu: fixed systemd-detect-virt output parsing redirecting systemd-detect-virt to /dev/null doesn't help with parsing the output :-/ Also, add "Red Hat" as a vendor. (cherry picked from commit 4135eea634b20c7f7285d134bd6dfe6b799fe226) --- modules.d/90qemu/module-setup.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules.d/90qemu/module-setup.sh b/modules.d/90qemu/module-setup.sh index 64eac9ed..46b7ae21 100755 --- a/modules.d/90qemu/module-setup.sh +++ b/modules.d/90qemu/module-setup.sh @@ -4,7 +4,7 @@ check() { if type -P systemd-detect-virt >/dev/null 2>&1; then - vm=$(systemd-detect-virt --vm >/dev/null 2>&1) + vm=$(systemd-detect-virt --vm 2>/dev/null) (($? != 0)) && return 255 [[ $vm = "qemu" ]] && return 0 [[ $vm = "kvm" ]] && return 0 @@ -14,8 +14,9 @@ check() { for i in /sys/class/dmi/id/*_vendor; do [[ -f $i ]] || continue read vendor < $i - [[ "$vendor" == "QEMU" ]] && return 0 - [[ "$vendor" == "Bochs" ]] && return 0 + [[ "$vendor" == "QEMU" ]] && return 0 + [[ "$vendor" == "Red Hat" ]] && return 0 + [[ "$vendor" == "Bochs" ]] && return 0 done return 255 }