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

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