Blame 0018-lvm-always-install-thin-utils-for-lvm.patch

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