Blame SOURCES/0031-lvm-always-install-thin-utils-for-lvm.patch

90b079
From f9fc4330da71dfb43c64fb424a5fef2909e4f4c3 Mon Sep 17 00:00:00 2001
90b079
From: Harald Hoyer <harald@redhat.com>
90b079
Date: Mon, 21 Oct 2013 09:09:26 +0200
90b079
Subject: [PATCH] lvm: always install thin utils for lvm
90b079
90b079
---
90b079
 modules.d/90lvm/module-setup.sh | 34 ++++++++--------------------------
90b079
 1 file changed, 8 insertions(+), 26 deletions(-)
90b079
90b079
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
90b079
index 50d9b98..f1c19a2 100755
90b079
--- a/modules.d/90lvm/module-setup.sh
90b079
+++ b/modules.d/90lvm/module-setup.sh
90b079
@@ -22,7 +22,8 @@ depends() {
90b079
     return 0
90b079
 }
90b079
 
90b079
-get_host_lvs() {
90b079
+# called by dracut
90b079
+cmdline() {
90b079
     local _activated
90b079
     declare -A _activated
90b079
 
90b079
@@ -35,35 +36,20 @@ get_host_lvs() {
90b079
         eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev" 2>/dev/null)
90b079
         [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1
90b079
         if ! [[ ${_activated[${DM_VG_NAME}/${DM_LV_NAME}]} ]]; then
90b079
-            printf "%s\n" "${DM_VG_NAME}/${DM_LV_NAME} "
90b079
+            printf " rd.lvm.lv=%s\n" "${DM_VG_NAME}/${DM_LV_NAME} "
90b079
             _activated["${DM_VG_NAME}/${DM_LV_NAME}"]=1
90b079
         fi
90b079
     done
90b079
 }
90b079
 
90b079
-cmdline() {
90b079
-    get_host_lvs | while read line; do
90b079
-        printf " rd.lvm.lv=$line"
90b079
-    done
90b079
-}
90b079
-
90b079
+# called by dracut
90b079
 install() {
90b079
-    local _i _needthin
90b079
+    local _i
90b079
 
90b079
     inst lvm
90b079
 
90b079
-    if [[ $hostonly ]]; then
90b079
-        while read line; do
90b079
-            [[ -n "$line" ]] || continue
90b079
-            printf "%s" " rd.lvm.lv=$line"
90b079
-            if ! [[ $_needthin ]]; then
90b079
-                [[ "$(lvs --noheadings -o segtype ${line%%/*} 2>/dev/null)" == *thin* ]] && _needthin=1
90b079
-            fi
90b079
-        done <<<$(get_host_lvs) >> "${initdir}/etc/cmdline.d/90lvm.conf"
90b079
-        echo >> "${initdir}/etc/cmdline.d/90lvm.conf"
90b079
-    else
90b079
-        _needthin=1
90b079
-    fi
90b079
+    cmdline >> "${initdir}/etc/cmdline.d/90lvm.conf"
90b079
+    echo >> "${initdir}/etc/cmdline.d/90lvm.conf"
90b079
 
90b079
     inst_rules "$moddir/64-lvm.rules"
90b079
 
90b079
@@ -99,9 +85,5 @@ install() {
90b079
 
90b079
     inst_libdir_file "libdevmapper-event-lvm*.so"
90b079
 
90b079
-    if [[ $_needthin ]]; then
90b079
-        inst_multiple -o thin_dump thin_restore thin_check thin_repair
90b079
-    fi
90b079
-
90b079
+    inst_multiple -o thin_dump thin_restore thin_check thin_repair
90b079
 }
90b079
-