From mboxrd@z Thu Jan 1 00:00:00 1970 From: Moshe Yudkowsky Date: Tue, 04 Apr 2006 11:20:27 +0000 Subject: Re: Why not picking up ENV variables? Message-Id: <4432567B.8060901@bl.com> List-Id: References: <442FD482.5000707@bl.com> In-Reply-To: <442FD482.5000707@bl.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org This patch didn't seem to help. > Could you try if this patch helps? > > diff --git a/udev_device.c b/udev_device.c > index 5db2709..cd84a0a 100644 > - --- a/udev_device.c > +++ b/udev_device.c > @@ -101,6 +101,7 @@ int udev_device_event(struct udev_rules > if (major(udev->devt) != 0 && strcmp(udev->action, "remove") = 0) { > struct name_entry *name_loop; > > + udev_db_get_device(udev, udev->dev->devpath); > udev_rules_get_run(rules, udev); > if (udev->ignore_device) { > info("device event will be ignored"); > > - -andrey (1) The relevant lines in udev_device.c now read: if (major(udev->devt) != 0 && strcmp(udev->action, "remove") = 0) { struct name_entry *name_loop; udev_db_get_device(udev, udev->dev->devpath); udev_rules_get_run(rules, udev); if (udev->ignore_device) { info("device event will be ignored"); return 0; } and then I simply ran: make make install in my normal environment. I didn't make or install, e.g., ata-id. (2) On unplug, the output of udevmonitor --env reads: > UDEV [1144149290.702789] remove@/block/sdb > UDEV_LOG=3 > ACTION=remove > DEVPATH=/block/sdb > SUBSYSTEM=block > SEQNUM374 > MINOR > MAJOR=8 > PHYSDEVPATH=/devices/pci0000:00/0000:00:10.3/usb4/4-4/4-4:1.0/host21/target21:0:0/21:0:0:0 > PHYSDEVBUS=scsi > PHYSDEVDRIVER=sd > UDEVD_EVENT=1 > 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 /dev/iriverDEVNAME=/dev/scsi/host21/bus0/target0/lun0/disc > ID_VENDOR=iriver > ID_MODEL=MassStorage_Disc > ID_REVISION01 > 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 > REMOVE_CMD=/etc/hotplug/usb/iriver remove (3) the rules are (the "add" rule works, the "remove" does not): SUBSYSTEM="block" IMPORT{program}="path_id $devpath" SUBSYSTEM="block", ACTION="add", ENV{ID_VENDOR}="iriver", ENV{ID_SERIAL}="iriver_MassStorage_Disc", SYMLINK+="iriver", RUN+="/etc/hotplug/usb/iriver", ENV{REMOVE_CMD}="/etc/hotplug/usb/iriver remove" SUBSYSTEM="block", ACTION="remove", ENV{ID_VENDOR}="iriver", ENV{ID_SERIAL}="iriver_MassStorage_Disc", RUN+="/etc/hotplug/usb/iriver" Please let me know what further tests to run. -- 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&kid0944&bid$1720&dat1642 _______________________________________________ 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