linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why not picking up ENV variables?
@ 2006-04-02 13:41 Moshe Yudkowsky
  2006-04-02 14:58 ` Moshe Yudkowsky
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Moshe Yudkowsky @ 2006-04-02 13:41 UTC (permalink / raw)
  To: linux-hotplug

Here's the output of udevmonitor --env:

UDEV  [1143983665.856252] add@/block/sdb
UDEV_LOG=3
ACTION­d
DEVPATH=/block/sdb
SUBSYSTEM=block
SEQNUM#89
MINOR\x16
MAJOR=8
PHYSDEVPATH=/devices/pci0000:00/0000:00:10.3/usb4/4-4/4-4:1.0/host6/target6:0:0/6:0:0:0
PHYSDEVBUS=scsi
PHYSDEVDRIVER=sd
UDEVD_EVENT=1
ID_VENDOR=iriver
ID_MODEL=MassStorage_Disc
ID_REVISION\001
ID_SERIAL=iriver_MassStorage_Disc
ID_TYPE=disk
ID_BUS=usb
ID_PATH=pci-0000:00:10.3-usb-0:4:1.0-scsi-0:0:0:0
DEVNAME=/dev/scsi/host6/bus0/target0/lun0/disc
DEVLINKS=/dev/sdb /dev/discs/disc2/disc 
/dev/disk/by-id/usb-iriver_MassStorage_Disc 
/dev/disk/by-path/pci-0000:00:10.3-usb-0:4:1.0-scsi-0:0:0:0

Now, I will tell you the truth: I have not yet been able to find any 
documentation that states, explicitly, what variables are part of SYSFS 
and what variables are part of ENV. I can figure out -- only by running 
udevinfo and reading the "sysfs" prefixes -- what info is SYSFS only.

However, when I read (e.g.) persistent.rules, I get the impression that 
some of the info that's in the udevmonitor --env printout isn't really 
part of the standard environment. Instead, it's imported there by path_id.

It'd be very nice to find documentation that explains what variables are 
part of ENV and which are not, by default.

In any case, here are two rules:

SUBSYSTEM="block", ACTION="add", ENV{ID_VENDOR}="iriver", 
ENV{ID_SERIAL}="iriver_MassStorage_Disc", SYMLINK+="iriver", 
RUN+="/etc/hotplug/usb/iriver"

SUBSYSTEM="block", ACTION="remove",  ENV{ID_VENDOR}="iriver", 
ENV{ID_SERIAL}="iriver_MassStorage_Disc", RUN+="/etc/hotplug/usb/iriver"

Neither of these two rules will run. I've tried different variations, 
including SYMLINK= instead of SYMLINK+=, leaving off ID_VENDOR matching, 
etc.

If I use SYSFS variables, I can easily match that "add," but the goal is 
to also be able to match on "remove."

Now, what's interesting is that these very same variables are used by 
persistent.rules to create /dev/disk/by-*. So, for example, there's a 
device called /dev/disk/by-id/usb-iriver_MassStorage_Disc.

I will start some experiments with path_id and the order the files 
execute, but if someone wants to toss me a hint, it'll save me a lot of 
time.

-- 
  Moshe Yudkowsky
  work: http://www.Disaggregate.com
  book: http://www.PebbleAndAvalanche.com


-------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-04-04 17:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-02 13:41 Why not picking up ENV variables? Moshe Yudkowsky
2006-04-02 14:58 ` Moshe Yudkowsky
2006-04-02 16:47 ` Andrey Borzenkov
2006-04-02 19:48 ` Moshe Yudkowsky
2006-04-04 11:20 ` Moshe Yudkowsky
2006-04-04 16:31 ` Andrey Borzenkov
2006-04-04 17:40 ` Moshe Yudkowsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).