[Ovirt-devel] [PATCH node] Add debugging info to dracut plugin

Mike Burns mburns at redhat.com
Fri Jul 29 19:23:45 UTC 2011


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

diff --git a/dracut/ovirt-cleanup.sh b/dracut/ovirt-cleanup.sh
index a6762cf..f800bf2 100755
--- a/dracut/ovirt-cleanup.sh
+++ b/dracut/ovirt-cleanup.sh
@@ -20,24 +20,29 @@ elif getarg reinstall >/dev/null; then
 elif getarg uninstall >/dev/null; then
     fb=$(getarg uninstall)
 else
+    info "No firstboot, reinstall or uninstall parameter found"
     return 0
 fi

 if [ "$fb" = "no" -o "$fb" = 0 ]; then
+    info "firtboot reinstall or uninstall parameter set to 0 or no, exitting"
     return 0
 fi
-
+info "Found valid firstboot reinstall or uninstall parameter"

 # Check storage_init argument
 # Accept either storage_init or ovirt_init
 # Prefer storage_init
 # Blank entry will result in getting first disk

-if getarg storage_init; then
+if getarg storage_init >/dev/null; then
     storage_init="$(sed -r 's/^.*storage_init=([^ ]*) .*$/\1/' /proc/cmdline)"
-elif getarg ovirt_init; then
+    info "Found storage_init:  $storage_init"
+elif getarg ovirt_init >/dev/null; then
     storage_init="$(sed -r 's/^.*ovirt_init=([^ ]*) .*$/\1/' /proc/cmdline)"
+    info "Found ovirt_init:  $storage_init"
 else
+    info "storage_init or ovirt_init arguments not found"
     return 0
 fi

@@ -50,6 +55,7 @@ fi
 # sdc and sdd as part of AppVG
 # Since we only care which disks are being used, change to a single list
 storage_init="$(echo "$storage_init" | sed 's/;/,/')"
+info "Replaced all ';' with ',' : $storage_init"

 oldIFS=$IFS

@@ -57,14 +63,17 @@ lvm pvscan 2>/dev/null
 IFS=","
 for dev in "$storage_init"; do
     device=$(IFS=$oldIFS parse_disk_id "$dev")
+    info "After parsing \"$dev\", we got \"$device\""
     echo "Wiping LVM from device: ${device}"
     IFS=$oldIFS
     for i in $(lvm pvs --noheadings -o pv_name,vg_name --separator=, $device* 2>/dev/null); do
         pv="${i%%,*}"
         vg="${i##*,}"
         if [ -n "$vg" ]; then
+            info "Found and removing vg: $vg"
             yes | lvm vgremove -ff "$vg"
         fi
+        info "Found and removing pv: $pv"
         yes | lvm pvremove -ff "$pv"
     done
     IFS=,
-- 
1.7.4.4




More information about the ovirt-devel mailing list