Blame 0031-lvm-pass-the-correct-rd.lvm.lv-parameter.patch

Harald Hoyer 3957aa
From a72cae66dcceba812eedeb6c4e15961bd02af8a3 Mon Sep 17 00:00:00 2001
Harald Hoyer 3957aa
From: Cong Wang <xiyou.wangcong@gmail.com>
Harald Hoyer 3957aa
Date: Tue, 20 Dec 2011 14:10:01 +0800
Harald Hoyer 3957aa
Subject: [PATCH] lvm: pass the correct rd.lvm.lv parameter
Harald Hoyer 3957aa
Harald Hoyer 3957aa
rd.lvm.lv accepts ${DM_VG_NAME}/${DM_LV_NAME}, not ${DM_LV_NAME}.
Harald Hoyer 3957aa
Harald Hoyer 3957aa
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Harald Hoyer 3957aa
---
Harald Hoyer 3957aa
 modules.d/90lvm/module-setup.sh |   15 +++++----------
Harald Hoyer 3957aa
 1 files changed, 5 insertions(+), 10 deletions(-)
Harald Hoyer 3957aa
Harald Hoyer 3957aa
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
Harald Hoyer 3957aa
index c910f13..01bfa8a 100755
Harald Hoyer 3957aa
--- a/modules.d/90lvm/module-setup.sh
Harald Hoyer 3957aa
+++ b/modules.d/90lvm/module-setup.sh
Harald Hoyer 3957aa
@@ -11,16 +11,11 @@ check() {
Harald Hoyer 3957aa
     [[ $debug ]] && set -x
Harald Hoyer 3957aa
 
Harald Hoyer 3957aa
     check_lvm() {
Harald Hoyer 3957aa
-        local dev=$1
Harald Hoyer 3957aa
-        DM_LV_NAME=$(udevadm info --query=property --name=$dev \
Harald Hoyer 3957aa
-            | while read line; do
Harald Hoyer 3957aa
-                [[ ${line#DM_LV_NAME} = $line ]] && continue
Harald Hoyer 3957aa
-                eval "$line"
Harald Hoyer 3957aa
-                echo $DM_LV_NAME
Harald Hoyer 3957aa
-                break
Harald Hoyer 3957aa
-                done)
Harald Hoyer 3957aa
-        [[ ${DM_LV_NAME} ]] || continue
Harald Hoyer 3957aa
-        echo " rd.lvm.lv=${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
Harald Hoyer 3957aa
+        unset DM_VG_NAME
Harald Hoyer 3957aa
+        unset DM_LV_NAME
Harald Hoyer 3957aa
+        eval $(udevadm info --query=property --name=$1|egrep '(DM_VG_NAME|DM_LV_NAME)=')
Harald Hoyer 3957aa
+        [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return
Harald Hoyer 3957aa
+        echo " rd.lvm.lv=${DM_VG_NAME}/${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
Harald Hoyer 3957aa
     }
Harald Hoyer 3957aa
 
Harald Hoyer 3957aa
     [[ $hostonly ]] || [[ $mount_needs ]] && {