grml-reboot: use virt-what instead of imvirt for detection of VMs
authorMichael Prokop <mika@grml.org>
Fri, 22 Jun 2012 20:56:39 +0000 (22:56 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 22 Jun 2012 20:59:17 +0000 (22:59 +0200)
As noted in the bugreport imvirt doesn't detect Virtualbox reliable
enough, virt-what seems to work more reliable (and faster too) so
let's give it a shot. Adjusted the dependency accordingly.

Closes: issue1184
Thanks: Ulrich Dangel for bugreport and suggestion

debian/control
etc/init.d/grml-reboot

index d39b19c..b77b7d0 100644 (file)
@@ -15,7 +15,7 @@ Architecture: all
 Replaces: automount-knoppix
 Suggests: grml-desktop, grml-docs, grml-x, policyrcd-script-zg2
 Recommends: eterm, python, vim (>= 7.0)
-Depends: ${misc:Depends}, grml-scripts (>= 0.9), grml-etc-core (>= 0.3), imvirt
+Depends: ${misc:Depends}, grml-scripts (>= 0.9), grml-etc-core (>= 0.3), virt-what
 Description: ecetera files for the grml system
  This package includes /etc files for the Grml system.
  Whereas the grml-etc-core package is limited to some
index c90fa8c..c88f71f 100755 (executable)
@@ -149,7 +149,8 @@ esac
 [ -r /etc/noprompt ] && NOPROMPT=true
 [ -r /etc/noeject ]  && NOPROMPT=true && NOEJECT=true
 
-if [ "$(/usr/bin/imvirt 2>/dev/null)" != "Physical" ] ; then
+VIRT_WHAT=$(/usr/sbin/virt-what 2>/dev/null)
+if [ -n "$VIRT_WHAT" ] ; then
   log_begin_msg "System seems to be a virtual machine, assuming noprompt as default."
   NOPROMPT=true
   log_end_msg 0