From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Zeuthen Date: Mon, 29 Sep 2003 20:50:31 +0000 Subject: Re: Hardware Abstraction Layer Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Wed, 2003-09-24 at 23:08, Greg KH wrote: > > > > 3. Provide some place where user-made settings are stored and pers= isted > > > > for a device. For instance UI-things like device name, where to > > > > mount a storage device and with what options (storage only read= able > > > > by the user or not etc.).=20 > > >=20 > > > Some of that will be taken care of in udev for Linux. But others (li= ke > > > where to mount the device) would be up to you. > > >=20 > >=20 > > Yes. I did install 2.6.0-test5 over the weekend and played around with > > udev 0.2, /sys and libsysfs + tools. It seems udev can't handle USB > > storage devices yet? It didn't worked for me at least. >=20 > Should work just fine. They show up as block devices, just like any > other disk (look in /sys/block). My demo at OLS 2003 used my usb camera > which is a usb storage device. >=20 My bad. I hadn't loaded the kernel module sd_mod. Works like a charm with this module.. > > Side question: Is it really true that the only way to obtain where the > > SCSI subsystem mounts the usb-storage is by inspecting /var/log/messages > > on 2.4? I couldn't find anything on 2.5/2.6 through googling either... > > It's very frustrating >=20 > Don't remember, sorry. There are a bunch of different scsi programs for > doing this. Search the linux-scsi archives for links to them. >=20 Hmm yes.. I searched for a long time, but found this message http://www.dragoninc.on.ca/mail-archives/linux-usb/2002-06/0122.html where you say this is not possible in 2.4. > > More on udev: how will it fit with the linux-hotplug project? >=20 > It uses the hotplug-base package, that's all. >=20 Ah, I see.. You symlink udev to /etc/hotplug.d/default/udev.hotplug and on hotplug ACTION=ADd, $1=3Dblock invocations query the sys/$DEVPATH/dev file and do a mknod.=20 I can see that it's a clever thing to have a (pluggable) naming database and strategy, especially for those sites you mention with thousands of disks. Do you intend udev to send a hotplug message to notify that a new device file have been created? Or is it only for kernel messages? The thinking is that one could make a generic script that broadcast each and every hotplug event. It could be as simple as dbus-send --dest=3Dorg.freedesktop.DBus.Broadcast org.kernel.Hotplug string:$1 string:"`env`" to broadcast the hotplug event on the dbus system bus. Of course, in a proper script one would test for /usr/bin/dbus-send and /var/run/messagebus.pid. This way, I wouldn't need my hal_hotplug program, but just listen for org.kernel.Hotplug messages on the dbus system bus and still enjoy the functionality of udev. > > Maybe it's already there, but it could be nice to have a set of > > prioritized hotplug scripts that is invoked a'la /etc/init.d.. So one > > for loading a kernel module, udev for naming the device and one for > > sending a D-BUS message, notifying, among others, the HAL. In the chain > > of invoking these, the environment would grow.=20 >=20 > Heh, we already have that. See the latest release of the linux-hotplug > package :) >=20 OK. One thing though.. When I plug in my USB storage device I get a number hotplug invocations on 2.6 (instead of only one on 2.4): o usb, DEVPATH=3D/devices/pci0000:00/0000:00:10.0/0000:02:07.0/usb2/ 2-1/2-1.3 o usb, DEVPATH=3D/devices/pci0000:00/0000:00:10.0/0000:02:07.0/ usb2/2-1/2-1.3/2-1.3:0 o scsi_host, DEVPATH=3D/class/scsi_host/host2 o scsi, DEVPATH=3D/devices/pci0000:00/0000:00:10.0/0000:02:07.0/ usb2/2-1/2-1.3/2-1.3:0/host2/2:0:0:0 o block, DEVPATH=3D/block/sda o block, DEVPATH=3D/block/sda/sda1 o scsi_device, DEVPATH=3D/class/scsi_device/2:0:0:0 These are all handled by stuff loading modules and creating device files (udev) which is all good. But when do I know when all messages for a device is sent? My understanding is that is doesn't make send to talk about hotplug start and hotplug end messages (though it would be nice), so I guess when receiving the second usb hotplug message I wait for a sec or two to received the first block message (since $DEVPATH/device points to the USB device). Or even better, a message from udev! (otherwise I would have to create my own device file with mknod?) Thanks, David ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ 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