From mboxrd@z Thu Jan 1 00:00:00 1970 From: Moshe Yudkowsky Date: Sun, 02 Apr 2006 13:41:22 +0000 Subject: Why not picking up ENV variables? Message-Id: <442FD482.5000707@bl.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org Here's the output of udevmonitor --env: UDEV [1143983665.856252] add@/block/sdb UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/block/sdb SUBSYSTEM=3Dblock SEQNUM#89 MINOR=16 MAJOR=3D8 PHYSDEVPATH=3D/devices/pci0000:00/0000:00:10.3/usb4/4-4/4-4:1.0/host6/targe= t6:0:0/6:0:0:0 PHYSDEVBUS=3Dscsi PHYSDEVDRIVER=3Dsd UDEVD_EVENT=3D1 ID_VENDOR=3Diriver ID_MODEL=3DMassStorage_Disc ID_REVISION=0001 ID_SERIAL=3Diriver_MassStorage_Disc ID_TYPE=3Ddisk ID_BUS=3Dusb ID_PATH=3Dpci-0000:00:10.3-usb-0:4:1.0-scsi-0:0:0:0 DEVNAME=3D/dev/scsi/host6/bus0/target0/lun0/disc DEVLINKS=3D/dev/sdb /dev/discs/disc2/disc=20 /dev/disk/by-id/usb-iriver_MassStorage_Disc=20 /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=20 documentation that states, explicitly, what variables are part of SYSFS=20 and what variables are part of ENV. I can figure out -- only by running=20 udevinfo and reading the "sysfs" prefixes -- what info is SYSFS only. However, when I read (e.g.) persistent.rules, I get the impression that=20 some of the info that's in the udevmonitor --env printout isn't really=20 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=20 part of ENV and which are not, by default. In any case, here are two rules: SUBSYSTEM=3D"block", ACTION=3D"add", ENV{ID_VENDOR}=3D"iriver",=20 ENV{ID_SERIAL}=3D"iriver_MassStorage_Disc", SYMLINK+=3D"iriver",=20 RUN+=3D"/etc/hotplug/usb/iriver" SUBSYSTEM=3D"block", ACTION=3D"remove", ENV{ID_VENDOR}=3D"iriver",=20 ENV{ID_SERIAL}=3D"iriver_MassStorage_Disc", RUN+=3D"/etc/hotplug/usb/iriver" Neither of these two rules will run. I've tried different variations,=20 including SYMLINK=3D instead of SYMLINK+=3D, leaving off ID_VENDOR matching= ,=20 etc. If I use SYSFS variables, I can easily match that "add," but the goal is=20 to also be able to match on "remove." Now, what's interesting is that these very same variables are used by=20 persistent.rules to create /dev/disk/by-*. So, for example, there's a=20 device called /dev/disk/by-id/usb-iriver_MassStorage_Disc. I will start some experiments with path_id and the order the files=20 execute, but if someone wants to toss me a hint, it'll save me a lot of=20 time. --=20 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=3Dlnk&kid=110944&bid$1720&dat=121642 _______________________________________________ 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