[Ovirt-devel] [PATCH ovirt-node] use disk/by-id to support non-sdX block devices like cciss

Alan Pevec apevec at redhat.com
Sat Nov 1 23:40:15 UTC 2008


Signed-off-by: Alan Pevec <apevec at redhat.com>
---
 scripts/ovirt-early |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/ovirt-early b/scripts/ovirt-early
index 3c8c494..1a14220 100755
--- a/scripts/ovirt-early
+++ b/scripts/ovirt-early
@@ -85,15 +85,17 @@ find_disk() {
     local bus=$1
     local serial=$2
     local live=$3
-    for d in /dev/sd?; do
+    for d in /dev/disk/by-id/{scsi,usb}*; do
+      ID_FS_USAGE=
       eval $(udevinfo --query env --name $d)
-      if [ "$ID_BUS" = "$bus" ]; then
+      # ID_FS_USAGE is set for partitions
+      if [ -z "$ID_FS_USAGE" -a "$ID_BUS" = "$bus" ]; then
         if [ -z "$serial" -o "$ID_SERIAL" = "$serial" ]; then
           if [ -n "$live" -a "$d" = "$live" ]; then
             # cannot install LiveOS over itself
             continue
           else
-            echo $d
+            echo $(readlink -e $d)
             return 0
           fi
         fi
-- 
1.5.6.5




More information about the ovirt-devel mailing list