Blame 0013-dm-check-for-presence-of-dmsetup.patch

Harald Hoyer 18c19d
From df96787019aadea63f6398a8ca8ba0a1e4d10202 Mon Sep 17 00:00:00 2001
Harald Hoyer 18c19d
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 18c19d
Date: Fri, 8 Jun 2012 12:41:49 +0200
Harald Hoyer 18c19d
Subject: [PATCH] dm: check for presence of dmsetup
Harald Hoyer 18c19d
Harald Hoyer 18c19d
---
Harald Hoyer 18c19d
 modules.d/90dm/dm-shutdown.sh  |    7 ++++++-
Harald Hoyer 18c19d
 modules.d/90dm/module-setup.sh |    1 +
Harald Hoyer 18c19d
 2 files changed, 7 insertions(+), 1 deletion(-)
Harald Hoyer 18c19d
Harald Hoyer 18c19d
diff --git a/modules.d/90dm/dm-shutdown.sh b/modules.d/90dm/dm-shutdown.sh
Harald Hoyer 18c19d
index 80d80d0..bf97637 100755
Harald Hoyer 18c19d
--- a/modules.d/90dm/dm-shutdown.sh
Harald Hoyer 18c19d
+++ b/modules.d/90dm/dm-shutdown.sh
Harald Hoyer 18c19d
@@ -13,4 +13,9 @@ _do_dm_shutdown() {
Harald Hoyer 18c19d
     fi
Harald Hoyer 18c19d
     return $ret
Harald Hoyer 18c19d
 }
Harald Hoyer 18c19d
-_do_dm_shutdown $1
Harald Hoyer 18c19d
+
Harald Hoyer 18c19d
+if command -v dmsetup >/dev/null; then
Harald Hoyer 18c19d
+    _do_dm_shutdown $1
Harald Hoyer 18c19d
+else
Harald Hoyer 18c19d
+    :
Harald Hoyer 18c19d
+fi
Harald Hoyer 18c19d
diff --git a/modules.d/90dm/module-setup.sh b/modules.d/90dm/module-setup.sh
Harald Hoyer 18c19d
index bac854a..4209537 100755
Harald Hoyer 18c19d
--- a/modules.d/90dm/module-setup.sh
Harald Hoyer 18c19d
+++ b/modules.d/90dm/module-setup.sh
Harald Hoyer 18c19d
@@ -3,6 +3,7 @@
Harald Hoyer 18c19d
 # ex: ts=8 sw=4 sts=4 et filetype=sh
Harald Hoyer 18c19d
 
Harald Hoyer 18c19d
 check() {
Harald Hoyer 18c19d
+    type -P dmsetup >/dev/null || return 1
Harald Hoyer 18c19d
     return 255
Harald Hoyer 18c19d
 }
Harald Hoyer 18c19d