Skip to contentSkip to conversation

udev/hotplug success story

DISCUSSION Daniel Drake 4 participants 5 messages Feb 8, 2004 – Mar 3, 2004

lore
Share & tools
lore
#0 lore raw

Hi Greg,

Thought you might be interested to know that I've got my setup working great with udev controlling /dev.

I'm running a gentoo based system, kernel 2.6.2-mm1, udev 016, hotplug 20040105

A few comments:

With the default devfs-like config, udev correctly places a symlink to /dev/hdc as /dev/cdroms/cdrom0.
With devfs, I had it setup so that I could also use /dev/dvd there. Writing a rule for udev to do that is no problem. I told it to name the device "hdc" and SYMLINK "dvd". The only thing there, is that it then overwrote the devfs-like rule, and /dev/cdroms/cdrom0 no longer existed. In the end I just added another SYMLINK to cdroms/cdrom0, but I was wondering, is there a better way - are there rules that I can pass that append SYMLINKs onto other ones?

Hotplug is doing a good job of managing my usb modules. When I plug my camera in, it loads usb-storage as expected. However, it doesnt load sd_mod, meaning that no /dev/sda1 is created, and I can't access my pictures.

I could easily get around this by writing a script to "modprobe sd_mod", and then adding a line to /etc/hotplug/usb.usermap.

To better fit in with the purpose of hotplugging, I would think that this module should be loaded automatically after usb-storage. Is this a bug/missing-feature, or intentional?

Final comment: I think that the documentation for hotplug is a little lacking. In particular, I had trouble finding out what the match_flags column in usb.usermap does, I eventually found the answer by looking through the code of usb.agent

cheers,

Daniel

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 4 lines · Daniel Drake

Hotplug is doing a good job of managing my usb modules. When I plug my camera in, it loads usb-storage as expected. However, it doesnt load sd_mod, meaning that no /dev/sda1 is created, and I can't access my pictures.

It used to load sd-mod automatically for me, but stopped some time around 2.6.2-rc1.

Quoted 6 lines

I could easily get around this by writing a script to "modprobe sd_mod", and then adding a line to /etc/hotplug/usb.usermap.

To better fit in with the purpose of hotplugging, I would think that this module should be loaded automatically after usb-storage. Is this a bug/missing-feature, or intentional?

Hacking modprobe.conf to get that behavior is trivial.

Signature · 14 lines
Måns Rullgård
[email protected]



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#2 lore raw
In reply to Daniel Drake
Quoted 9 lines · Måns Rullgård
Quoted 4 lines · Daniel Drake

Hotplug is doing a good job of managing my usb modules. When I plug my camera in, it loads usb-storage as expected. However, it doesnt load sd_mod, meaning that no /dev/sda1 is created, and I can't access my pictures.

It used to load sd-mod automatically for me, but stopped some time around 2.6.2-rc1.

We could race looking for the sys attribute type in scsi.agent.

That is scsi attributes are added after the hotplug is invoked.

Is there anything in your log file from scsi.agent? Like this one:

mesg "how to add device type=$TYPE at $DEVPATH ??"

If so, try adding a sleep 1 in scsi.agent just before the cat of type, i.e.:

	sleep 1
	TYPE=$(cat /sys/$DEVPATH/type)

-- Patrick Mansfield

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Daniel Drake
Quoted 5 lines · Daniel Drake

Final comment: I think that the documentation for hotplug is a little lacking. In particular, I had trouble finding out what the match_flags column in usb.usermap does, I eventually found the answer by looking through the code of usb.agent

I agree, although a user should never have to muck around with those files, use the automatically generated ones :)

But if you want to write something up, I'd be glad to add it to the package.

thanks,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Daniel Drake
Quoted 5 lines · Daniel Drake

Hotplug is doing a good job of managing my usb modules. When I plug my camera in, it loads usb-storage as expected. However, it doesnt load sd_mod, meaning that no /dev/sda1 is created, and I can't access my pictures.

This is bug in the current release of the hotplug scripts. A fix for this has been posted to the mailing list.

thanks,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel