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