[Ovirt-devel] [PATCH node] always remove HostVG in dracut when reinstall/uninstall/firstboot passed

Mike Burns mburns at redhat.com
Thu Aug 25 13:57:33 UTC 2011


rhbz#733274

Signed-off-by: Mike Burns <mburns at redhat.com>
---
 dracut/install          |    1 +
 dracut/ovirt-cleanup.sh |   14 +++++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/dracut/install b/dracut/install
index 1832b89..000272a 100755
--- a/dracut/install
+++ b/dracut/install
@@ -2,6 +2,7 @@

 inst yes
 inst head
+inst awk

 inst_hook pre-pivot 01 "$moddir/ovirt-cleanup.sh"
 inst_simple "$moddir/ovirt-boot-functions" /sbin/ovirt-boot-functions
diff --git a/dracut/ovirt-cleanup.sh b/dracut/ovirt-cleanup.sh
index 1d7db84..c96d6fe 100755
--- a/dracut/ovirt-cleanup.sh
+++ b/dracut/ovirt-cleanup.sh
@@ -40,10 +40,19 @@ if [ $? -eq 1 ]; then
     storage_init="$(getargs ovirt_init)"
     if [ $? -eq 1 ]; then
         info "storage_init or ovirt_init arguments not found"
-        return 0
+    else
+        info "Found storage_init:  $storage_init"
     fi
 fi
-info "Found storage_init:  $storage_init"
+
+# Check for HostVG
+lvm pvscan >/dev/null 2>&1
+
+for hostvg in $(lvm pvs --noheadings -o vg_name,pv_name 2>/dev/null | awk '/^  HostVG/{print $2}'); do
+    storage_init="$hostvg,$storage_init"
+    info "Found HostVG on $hostvg"
+done
+

 # storage_init is passed in a specific format
 # A comma separated list of HostVG devices
@@ -60,7 +69,6 @@ info "Escaped all asterisks:  $storage_init"

 oldIFS=$IFS

-lvm pvscan 2>/dev/null
 IFS=","
 for dev in $storage_init; do
     dev="$(echo "$dev" | sed 's/\\\*/\*/g')"
-- 
1.7.4.4




More information about the ovirt-devel mailing list