From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Thu, 04 Nov 2004 18:18:20 +0000 Subject: Re: add the physical device and the bus to the hotplug environment Message-Id: <20041104181820.GA17022@kroah.com> List-Id: References: <20041104024428.GA17927@vrfy.org> In-Reply-To: <20041104024428.GA17927@vrfy.org> MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Thu, Nov 04, 2004 at 03:44:28AM +0100, Kay Sievers wrote: > Add the sysfs path of the physical device to the hotplug event of class > and block devices. This should solve the userspace issue not to know if > the device is a virtual one and the "device" symlink will never be create= d, > but we sit there and wait for it to show up not knowing when we should > give up. >=20 > Also the bus name is added to the hotplug event, so we don't need to > reverse lookup in the /sys/bus/* directory which bus our physical > device belongs to. This is e.g. the value matched against the BUS=3D key, > that may be used in an udev rule. >=20 > This is a PCI network card: > ACTION=ADd > SUBSYSTEM=3Dnet > DEVPATH=3D/class/net/eth0 > PHYSDEVPATH=3D/devices/pci0000:00/0000:00:1e.0/0000:02:01.0 > PHYSDEVBUS=3Dpci > INTERFACE=3Deth0 > SEQNUM=827 > PATH=3D/sbin:/bin:/usr/sbin:/usr/bin > HOME=3D/ >=20 > This is a IDE CDROM: > ACTION=ADd > SUBSYSTEM=3Dblock > DEVPATH=3D/block/hdc > PHYSDEVPATH=3D/devices/pci0000:00/0000:00:1f.1/ide1/1.0 > PHYSDEVBUS=3Dide > SEQNUM=1017 > PATH=3D/sbin:/bin:/usr/sbin:/usr/bin > HOME=3D/ >=20 > This is an USB-stick partition: > ACTION=ADd > SUBSYSTEM=3Dblock > DEVPATH=3D/block/sda/sda1 > PHYSDEVPATH=3D/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host1/t= arget1:0:0/1:0:0:0 > PHYSDEVBUS=3Dscsi > SEQNUM=1032 > PATH=3D/sbin:/bin:/usr/sbin:/usr/bin > HOME=3D/ >=20 >=20 > Signed-off-by: Kay Sievers Very nice, I like this a lot. Should make userspace logic a lot simpler now. I've applied this to my trees. thanks, greg k-h ------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_idU88&alloc_id=12065&op=3Dclick _______________________________________________ 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