From: Andreas Jellinghaus <aj@dungeon.inka.de>
To: linux-hotplug@vger.kernel.org
Subject: udev devname events have less environment
Date: Sun, 19 Mar 2006 21:37:31 +0000 [thread overview]
Message-ID: <dvkit7$jfo$1@sea.gmane.org> (raw)
maybe other people will run into this problem too, so I'm posting
it here:
for the old /proc/bus/usb filesystem I see events resulting
in environment like this (even if there is no usbfs mounted):
export ACTION="add"
export DEVICE="/proc/bus/usb/002/015"
export DEVPATH="/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1:1.0"
export INTERFACE="0/0/0"
export MODALIAS="usb:v0973p0001d0100dcFFdsc00dp00ic00isc00ip00"
export OLDPWD
export PHYSDEVBUS="usb"
export PRODUCT="973/1/100"
export PWD="/"
export SEQNUM="757"
export SHLVL="1"
export SUBSYSTEM="usb"
export TYPE="255/0/0"
export UDEVD_EVENT="1"
export UDEV_LOG="3"
now for /dev/bus/usb/... devices I see events coming from udev
too, bug with different environment:
export ACTION="add"
export DEVNAME="/dev/bus/usb/002/015"
export DEVPATH="/class/usb_device/usbdev2.15"
export MAJOR="189"
export MINOR="142"
export OLDPWD
export PHYSDEVBUS="usb"
export PHYSDEVDRIVER="usb"
export PHYSDEVPATH="/devices/pci0000:00/0000:00:13.0/usb2/2-1"
export PWD="/"
export SEQNUM="758"
export SHLVL="1"
export SUBSYSTEM="usb_device"
export UDEVD_EVENT="1"
export UDEV_LOG="3"
export USB_BUS="002"
export USB_DEV="015"
ok, it is not DEVICE but DEVNAME, I can check for both. but PRODUCT is not
set, and so far I depend on that setting. I wonder why it was designed this
way?
I changed my code to
V="`cat /sys/$DEVPATH/device/idVendor |sed -e "s/^0*//"`"
P="`cat /sys/$DEVPATH/device/idProduct|sed -e "s/^0*//"`"
D="`cat /sys/$DEVPATH/device/bcdDevice |sed -e "s/^0*//"`"
PRODUCT="$V/$P/$D"
so I can get $PRODUCT in that case too. not pretty, but works for me.
Regards, Andreas
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next reply other threads:[~2006-03-19 21:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-19 21:37 Andreas Jellinghaus [this message]
2006-03-20 1:14 ` udev devname events have less environment Kay Sievers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='dvkit7$jfo$1@sea.gmane.org' \
--to=aj@dungeon.inka.de \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.