View previous topic :: View next topic |
Author |
Message |
Atom2 Apprentice

Joined: 01 Aug 2011 Posts: 185
|
Posted: Sun Mar 16, 2014 1:22 pm Post subject: modules usbcore and usbcommon |
|
|
Hallo Forum,
I am running a system without any USB hardware present. USB support is nevertheless compiled as a module (usbcore and usbcommon and a few others). This is because I am using the same kernel version and environment for various systems and a few of these do actually have USB hardware (before you ask: those various systems are all XEN guests running on the same host as virtual machines and currently there's only one domU guests which gets USB-hardware passed through).
Nevertheless, all virtual machines automatically load the USB support modules 'usbcommon' and 'usbcore'. Upon investigation it turned out that the startup script /etc/init.d/procfs Code: | [... snip ...]
start()
{
# Make sure we insert usbcore if it's a module
if [ -f /proc/modules -a ! -d /sys/module/usbcore -a ! -d /proc/bus/usb ]; then
modprobe -q usbcore
fi
[... snip ...] | unconditionally loads the 'usbcore' module which in turn seems to autoload 'usbcommon'.
It would be easy to comment those lines out, but I wonder what's the rational for loading usb support modules even if no USb hardware is present in the system?
Also: Is there a recommended approach to prevent those modules from being autloaded if no USB hardware is present? Creating a file /etc/modprobe.d/usb.blacklist.conf Code: | blacklist usbcore
blacklist usbcommon | did not change anything - i.e. the modules are still being loaded during system startup.
Thanks Atom2 |
|
Back to top |
|
 |
Ant P. Watchman

Joined: 18 Apr 2009 Posts: 6014
|
Posted: Mon Mar 17, 2014 9:42 pm Post subject: |
|
|
It looks like they hardcode it to make sure the usbfs code near the bottom succeeds... which is pretty useless, because that's an ancient and obsolete thing itself. |
|
Back to top |
|
 |
Atom2 Apprentice

Joined: 01 Aug 2011 Posts: 185
|
Posted: Mon Mar 17, 2014 10:59 pm Post subject: |
|
|
Ant P. wrote: | It looks like they hardcode it to make sure the usbfs code near the bottom succeeds... which is pretty useless, because that's an ancient and obsolete thing itself. |
But that code would only succeed if /proc/bus/usb were created by usbcommon and/or usbcore - but that's not the case on my system even for the one XEN guest to which I pass through the USB hardware. I guess the part of the code you are referring to is never being executed.
BTW if the presence of USB hardware would be indicated by the existence of /proc/bus/usb it had been very easy to solve the issue by just adding a modprobe -r after the initial loading of the module in case there's no /proc/bus/usb.
My solution currently is to have the loading of the module completely commented out and - and that's even for the guest that has USB hardware passed through. For that guest nevertheless usbcommon and usbcore somehow get loaded automatically - obviously from somewhere else.
I currently tend to consider this as a bug in the script. What are your thoughts? |
|
Back to top |
|
 |
Ant P. Watchman

Joined: 18 Apr 2009 Posts: 6014
|
Posted: Tue Mar 18, 2014 12:02 pm Post subject: |
|
|
I think it's more likely just bit-rotted code than a mistake, the copyright header on that file still says 2009. Either way I'd agree all the USB stuff in that file can go away. |
|
Back to top |
|
 |
Atom2 Apprentice

Joined: 01 Aug 2011 Posts: 185
|
Posted: Wed Mar 19, 2014 12:31 am Post subject: |
|
|
I have searched the bugzilla as I intended to report "an issue" - and there was already a bug filed: https://bugs.gentoo.org/show_bug.cgi?id=480312. I have added my observations as my issues were not really covered by the initial bug report, but have yet to hear back from those guys dealing with the bug ... |
|
Back to top |
|
 |
|