From: Michael Prokop Date: Fri, 1 Sep 2023 11:57:49 +0000 (+0200) Subject: Replace deprecated vmware-detect with virt-what/imvirt X-Git-Tag: v0.20.6~2 X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=commitdiff_plain;h=b39d89f0db161916b1acbda58f99604f6f2d724d Replace deprecated vmware-detect with virt-what/imvirt As of git commit 0c1cd5d0cbee in grml-scripts we no longer ship our vmware-detect binary, so instead rely on virt-what and imvirt. Output of virt-what executed inside a VM on a VMware cluster is `vmware` and `VMware ESX server` for imvirt. Thanks: Christoph Biedl and AndrĂ¡s Korn for feedback --- diff --git a/autoconfig.functions b/autoconfig.functions index 891242e..af3a117 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -184,7 +184,8 @@ KVM=false VIRTUALBOX=false VMWARE=false -if vmware-detect &>/dev/null; then +if virt-what 2>/dev/null | grep -q 'vmware' || \ + imvirt 2>/dev/null | grep -i "vmware" ; then VIRTUAL=true; VMWARE=true; VIRTUAL_ENV='VMware' fi