powerpc-utils/powerpc-utils-udevadm.patch

31 lines
911 B
Diff
Raw Normal View History

2010-06-09 16:28:59 +00:00
Index: powerpc-utils/scripts/ofpathname
===================================================================
--- powerpc-utils.orig/scripts/ofpathname 2010-05-18 08:15:43.000000000 -0500
+++ powerpc-utils/scripts/ofpathname 2010-05-18 08:28:47.000000000 -0500
@@ -232,12 +232,23 @@
{
local this_dir=$PWD
local sysfs_dir
+ local udev_path
local udevinfo="/usr/bin/udevinfo"
+ local udevadm="/sbin/udevadm"
- if [[ ! -a $udevinfo ]]; then
+ if [[ -a $udevadm ]]; then
+ udev_path=`$udevadm info --query=path --name=$DEVNAME`
+ elif [[ -a $udevinfo ]]; then
+ udev_path=`$udevinfo -q path -n $DEVNAME`
+ else
+ echo "no"
+ return
+ fi
+
+ if [[ -z $udev_path ]]; then
echo "no"
else
- sysfs_dir=`get_link -f /sys/$($udevinfo -q path -n $DEVNAME)/device`
+ sysfs_dir=`get_link -f /sys/$udev_path/device`
if [[ ! -d $sysfs_dir ]]; then
echo "no"
else