Fix querydisk -d output
authorBryn M. Reeves <bmr@redhat.com>
Tue, 30 Oct 2012 16:52:02 +0000 (16:52 +0000)
committerBryn M. Reeves <bmr@redhat.com>
Tue, 30 Oct 2012 16:52:02 +0000 (16:52 +0000)
Stat's field formatters produce maj:min values in hex. Pass them
through the shell's arithmetic expansion to decmialise them before
using so that they match the oracleasm and ls -l output.

wwidmap

diff --git a/wwidmap b/wwidmap
index 212354a..da58ccd 100755 (executable)
--- a/wwidmap
+++ b/wwidmap
@@ -212,9 +212,13 @@ wm_querydisk () {
         exit 2
     fi
     WWID=${NAMEMAP[$NNAME]}
+    debug "wm_querydisk: NNAME=\"$NNAME\" WWID=\"$WWID\" LISTDEV=\"$LISTDEV\""
     if [ "$LISTDEV" == "1" ]; then
         DEV="/dev/$WM_DEV_PATH/$(readlink "/dev/$WM_DEV_PATH/$NNAME")"
-        ONDEV="on device $(stat --format "[%t, %T]" $DEV)"
+        MAJ="$[0x$(stat --format "%t" $DEV)]"
+        MIN="$[0x$(stat --format "%T" $DEV)]"
+        ONDEV="on device [$MAJ,$MIN]"
+        debug "wm_querydisk: DEV=\"$DEV\" MAJ=\"$MAJ\" MIN=\"$MIN\""
     fi
     if [ "$WWID" != "" ]; then
         echo "$NNAME is a valid wwidmap disk$ONDEV"