[Ovirt-devel] [PATCH node] handle wildcards appropriately in dracut plugin

Mike Burns mburns at redhat.com
Mon Aug 22 13:55:16 UTC 2011


when specifying a list of devices, one with a wildcard, the dracut
plugin would attempt to use all devices matching the wildcard
instead of just the first device.

Ex.  storage_init=/dev/vd*,/dev/sda
should match /dev/vda and /dev/sda only, but if /dev/vdb, /dev/vdc
etc existed, it would match all of those as well.

rhbz#726843

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

diff --git a/dracut/ovirt-cleanup.sh b/dracut/ovirt-cleanup.sh
index e36a265..1d7db84 100755
--- a/dracut/ovirt-cleanup.sh
+++ b/dracut/ovirt-cleanup.sh
@@ -55,12 +55,15 @@ info "Found storage_init:  $storage_init"
 # 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"
+storage_init="$(echo "$storage_init" | sed 's/\*/\\\*/')"
+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')"
     device=$(IFS=$oldIFS parse_disk_id "$dev")
     info "After parsing \"$dev\", we got \"$device\""
     echo "Wiping LVM from device: ${device}"
-- 
1.7.4.4




More information about the ovirt-devel mailing list