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

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