Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#3919 - Hotplugging USB devices doesn't work with udev-084

Attached to Project: Arch Linux
Opened by Michal Krenek (Mikos) - Tuesday, 07 February 2006, 03:25 GMT
Last edited by arjan timmerman (blaasvis) - Saturday, 11 February 2006, 13:43 GMT
Task Type Feature Request
Category Packages: Testing
Status Closed
Assigned To Judd Vinet (judd)
Architecture not specified
Severity High
Priority Normal
Reported Version 0.7.1 Noodle
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I am using udev from 'testing' (whole system is 'testing') and starting with udev-081, hotplugging of USB devices (like Bluetooth adapter or my digitam camera) doesn't work anymore. For example if I plug in USB Bluetooth adapter, hci_usb module isn't automatically loaded. Same for my digital camera (usb_storage module isn't loaded). But it has worked without problems in the past (with udev-079).

Today I discovered some weird thing. If I change MOD_AUTOLOAD in /etc/rc.conf to "yes", then it works again! If I plug in my digital camera or Bluetooth adapter to USB, proper module is loaded immediately. But I don't want to use module autoloading at bootup. I want only live hotplugging of USB devices. How is this possible? According to comments in /etc/rc.conf, MOD_AUTOLOAD is only for scanning hardware and loading required modules at bootup.
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Saturday, 10 June 2006, 10:34 GMT
Reason for closing:  Won't implement
Comment by Tobias Powalowski (tpowa) - Tuesday, 07 February 2006, 06:25 GMT
well as you discovered, MOD_AUTOLOAD does everything, loading modules for coldplug and hotplug, if you decide to not use MOD_AUTOLOAD, load the stuff you need in modules, write own udev rules for it, or blacklist the stuff you don't need, you see quite a ton of possibilities to solve your issue.
greetings
tpowa
Comment by Michal Krenek (Mikos) - Tuesday, 07 February 2006, 12:13 GMT
Isn't it possible to add some new variable to /etc/rc.conf? For example MOD_HOTPLUGGING or something like that. I think there is a lot of people who doesn't want to use module autoloading at bootup, but want to use USB hotplugging.

Yes it is possible to add somthing like this to /etc/rc.local:
sed -i 's/MOD_AUTOLOAD="no"/MOD_AUTOLOAD="yes"/' /etc/rc.conf

And this to /etc/rc.local.shutdown:
sed -i 's/MOD_AUTOLOAD="yes"/MOD_AUTOLOAD="no"/' /etc/rc.conf

But this is not clean solution.
Comment by Tobias Powalowski (tpowa) - Tuesday, 07 February 2006, 12:29 GMT
not possible, as i stated use the blacklist feature that will give you the same, else you get real problems with coldplugging of devices.
Comment by Michal Krenek (Mikos) - Tuesday, 07 February 2006, 15:53 GMT
I still dont't understand why... Coldplugging and hotplugging should be two different things, like in the past.
MOD_BLACKLIST have one great disadvantage - if I for example add ppp_generic to blacklist only because I don't want it to be loaded at bootup, now ppp_generic is blacklisted also for hotplugging (but I want it to work automagically for hotplugging new devices). This is only for example, but it can be applied for any other module. Like I said, coldplugging and hotplugging (and module blacklisting for coldplugging and/or hotplugging) should be IMHO two different things.
Comment by Michal Krenek (Mikos) - Tuesday, 07 February 2006, 16:20 GMT
I can think of one easy solution. You can export some variable (for example SYSINIT_BOOTUP=1) in /etc/rc.sysinit and add variable MOD_HOTPLUGGING to /etc/rc.conf. Then you change this line in /lib/udev/load-modules.sh:

-if [ "$MOD_AUTOLOAD" = "yes" -o "$MOD_AUTOLOAD" = "YES" -a "$load_modules" != "off" ]; then
+if [ "$MOD_AUTOLOAD" = "yes" -o "$MOD_AUTOLOAD" = "YES" -a "$load_modules" != "off" -a $SYSINIT_BOOTUP -eq 1 ] || [ "$MOD_HOTPLUGGING" = "yes" -o "$MOD_HOTPLUGGING" = "YES" -a "$load_modules" != "off" -a $SYSINIT_BOOTUP -ne 1 ]; then

I don't know if this is clean solution, perhaps there is some better solution, but it should work.
Comment by Alexander Baldeck (kth5) - Tuesday, 07 February 2006, 18:14 GMT
well, i cannot seem to understand what the problem is here. udev probes modules as the hardware becomes available wether it's on boot or runtime. if your usb stick is not sticking in its slot it won't be detected so it'll work just like you want: on runtime only. if it sticks in the slot, i understand that you want to have the appropriate modules loaded, eh? what's your point?

if you don't use ppp blacklist it, if you do what's the problem? it's not like it's going to waste more than a couple of Kbytes in our days where >512M is the defacto standard. adding complexity just for serving this tiny purpose doesn't seem realistic to me.
Comment by Michal Krenek (Mikos) - Tuesday, 07 February 2006, 19:13 GMT
One example - I have some USB hard drive connected to computer at bootup, but I don't want it to be loaded at boot. So I add usb_storage to blacklist. But then at runtime I plug in some another USB key. Now driver for this USB key won't be autoloaded, because usb_storage is in blacklist. It is only example, but this is the point. I don't want coldplugging, but I want hotplugging. This is how it has worked in the past (with udev-079).

Don't get me wrong, UEVENT is great thing, but I still want coldplugging and hotplugging to be separated (so I can disable only one of it).

Well, maybe it looks really useless for you, but I am still convinced that it's good to have this option. But if I am the only one who want it, then let it go...
Comment by Aaron Griffin (phrakture) - Tuesday, 07 February 2006, 23:55 GMT
Ok, let's look at this from the top down. First off, I need to point out that the variable is named "Module Autoload" not "Do Coldplugging" or anything similar.

When you set MOD_AUTOLOAD to "yes" you are saying "Yes, autoload my modules" - you are not giving it a time (at boot) or anything like that. When you set it to "no" you are saying "Do NOT autload modules". With MOD_AUTOLOAD set to "no", it is expected that the user knows what they are doing and has loaded the appropriate modules themselves.

This is intentional. This is not a bug. So as not to make anyone angry, I will switch this to a 'feature request' and leave it open.
Comment by Paul Mattal (paul) - Thursday, 02 March 2006, 13:04 GMT
This discussion devolves to one about what hotplugging exactly is: is it the detection of devices that appear only after a certain point in time when you turned on hotplugging? What if you unplug and replug that device? What if the bus just decides to reset the device? What if the device gets power cycled? This definition results in something very hard to understand and predict what the behavior should be.

I prefer the unified version of what hotplugging means; it's the detection of all devices you have on your computer and the attempt to keep your system always ready to use all the hardware you have connected to it. This definition seems easier to understand and I don't see how it's bad.

Mikos, I think if you really want to blacklist just your USB hard drive, you can do this by writing a custom udev rule that matches the vendor or model of the drive and ignores it. Some udev guru correct me if I'm wrong.

Loading...