dm-mod: also check for device-mapper support using /proc/misc
authorMichael Prokop <mika@grml.org>
Thu, 7 Jun 2012 19:02:54 +0000 (21:02 +0200)
committerMichael Prokop <mika@grml.org>
Thu, 7 Jun 2012 19:02:56 +0000 (21:02 +0200)
As noted in http://gsocdebian.wordpress.com/2012/06/06/dm_mod/

grml-debootstrap

index 7f367ec..60358d3 100755 (executable)
@@ -945,7 +945,7 @@ prepare_vm() {
 
   # if dm-mod isn't available then kpartx will fail with
   # "Is device-mapper driver missing from kernel? [...]"
 
   # if dm-mod isn't available then kpartx will fail with
   # "Is device-mapper driver missing from kernel? [...]"
-  if ! kpartx -av $TARGET >/dev/null 2>&1 ; then
+  if ! kpartx -av $TARGET >/dev/null 2>&1 || ! grep -q device-mapper /proc/misc >/dev/null 2>&1 ; then
     einfo "Device-mapper not ready yet, trying to load dm-mod module."
     modprobe dm-mod ; eend $?
   fi
     einfo "Device-mapper not ready yet, trying to load dm-mod module."
     modprobe dm-mod ; eend $?
   fi