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

a56a5e
From 53b20afabbc034b4fe1e09f0b7d4f7d04f0584c5 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
1755ca
index 7e3d44fa..877631bb 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
 }