Blame SOURCES/0059-lvm-install-thin-tools-only-when-needed-in-hostonly.patch

966cef
From ef290e26156d9f55a5e2bc3fc265c81e82fa510a Mon Sep 17 00:00:00 2001
966cef
From: Harald Hoyer <harald@redhat.com>
966cef
Date: Thu, 5 Dec 2013 15:57:42 +0100
966cef
Subject: [PATCH] lvm: install thin tools, only when needed in hostonly
966cef
966cef
---
966cef
 modules.d/90lvm/module-setup.sh | 8 +++++++-
966cef
 1 file changed, 7 insertions(+), 1 deletion(-)
966cef
966cef
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
966cef
index 7e3d44f..877631b 100755
966cef
--- a/modules.d/90lvm/module-setup.sh
966cef
+++ b/modules.d/90lvm/module-setup.sh
966cef
@@ -95,5 +95,11 @@ install() {
966cef
 
966cef
     inst_libdir_file "libdevmapper-event-lvm*.so"
966cef
 
966cef
-    inst_multiple -o thin_dump thin_restore thin_check thin_repair
966cef
+    if [[ $hostonly ]] && type -P lvs &>/dev/null; then
966cef
+        for dev in "${!host_fs_types[@]}"; do
966cef
+            if [[ "$(lvs --noheadings -o segtype "$dev" 2>/dev/null)" == *thin* ]] ; then
966cef
+                inst_multiple -o thin_dump thin_restore thin_check thin_repair
966cef
+            fi
966cef
+        done
966cef
+    fi
966cef
 }