powerpc-utils/powerpc-utils-1.2.12-ofpathname-884826.patch

30 lines
906 B
Diff

diff -up powerpc-utils-1.2.12/scripts/ofpathname.884826 powerpc-utils-1.2.12/scripts/ofpathname
--- powerpc-utils-1.2.12/scripts/ofpathname.884826 2012-12-13 16:31:42.890057349 +0100
+++ powerpc-utils-1.2.12/scripts/ofpathname 2012-12-13 16:33:23.929498245 +0100
@@ -291,6 +291,13 @@ print_aliases()
fi
}
+get_slave()
+{
+ cd /sys/class/*/$1
+ while [[ -n "`ls slaves 2> /dev/null`" ]]; do cd slaves/*; done
+ $FIND /dev -name "`basename $PWD`"
+}
+
#
# logical_to_ofpathname
# Conversion for logical device name to an Open Firmware device path
@@ -333,6 +340,11 @@ logical_to_ofpathname()
fi ;;
hd*) l2of_ide ;;
fd*) echo "no fd support yet" ;;
+ dm-*)
+ DEVNAME=`get_slave $DEVICE`
+ logical_to_ofpathname
+ exit
+ ;;
esac
if [[ -z $OF_PATH ]]; then