Package: powerpc-ibm-utils
Version: 1.1.0-1
Severity: important
Tags: patch

ofpathname isn't working on my IBM p520.  I managed to fix it with a
few lines of small changes.

Before:
rceng03:~# ofpathname /dev/sda
ofpathname: Could not find sysfs information for logical device "/dev/sda".

After:
rceng03:~# /tmp/ofpathname /dev/sda
/p...@800000020000200/pci1014,0...@1/sas/d...@20000

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: powerpc (ppc64)

Kernel: Linux 2.6.32-5-powerpc64 (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages powerpc-ibm-utils depends on:
ii  bash                          4.1-3      The GNU Bourne Again SHell
ii  libc6                         2.11.2-7   Embedded GNU C Library: Shared lib

powerpc-ibm-utils recommends no packages.

powerpc-ibm-utils suggests no packages.

-- no debconf information
--- /usr/sbin/ofpathname        2008-02-05 15:23:37.000000000 -0500
+++ /tmp/ofpathname     2010-12-13 15:19:17.461114982 -0500
@@ -369,7 +369,7 @@
 #
 l2of_scsi()
 {
-    local sysfs_sd=`$FIND /sys -name $DEVICE 2>/dev/null`
+    local sysfs_sd=`$FIND /sys -type d -name $DEVICE 2>/dev/null`
     if [[ -z $sysfs_sd ]]; then
         err $ERR_NOT_CONFIG
     fi
@@ -563,7 +563,7 @@
     dev_hbtl_no=${device#...@}
 
     local dir
-    for dir in `$FIND /sys/block -name "s[dr]*"`; do
+    for dir in `$FIND /sys/block -name 's[dr]*'`; do
         # go up to find directory with 'device' link
         goto_dir $dir "device"
 
@@ -653,7 +653,7 @@
     DEV_ID=`echo "ibase=16;obase=A; $DEV_ID" | bc`
 
     local dir
-    for dir in `$FIND /sys/block -name s[dr]*`; do
+    for dir in `$FIND /sys/block -name 's[dr]*'`; do
         # go up to find directory with 'device' link
         goto_dir $dir "device"
 

Reply via email to