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

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