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