Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 56599 - /etc/hotplug/usb.rc fails to see that /proc/bus/usb is already mounted
Summary: /etc/hotplug/usb.rc fails to see that /proc/bus/usb is already mounted
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High trivial (vote)
Assignee: Greg Kroah-Hartman (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-10 05:56 UTC by Remy Blank
Modified: 2004-09-20 15:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Blank 2004-07-10 05:56:49 UTC
When usb.rc is started by hotplug on system startup, it checks to see if /proc/bus/usb is already mounted by checking for the file /proc/bus/usb/devices.

On my system, /proc/bus/usb is mounted by /etc/init.d/localmount right after modprobing for usbcore. This allows the mount to succeed, but the file /proc/bus/usb/devices doesn't exist yet. It only appears after modprobing one of the host controller modules, ehci_hcd in my case.

However, the host controller modules are only inserted by usb.rc *after* trying to re-mount /proc/bus/usb, therefore mount gives an error about it already being mounted:

mount: usbfs already mounted or /proc/bus/usb busy
mount: according to mtab, usbfs is already mounted on /proc/bus/usb

The problem is rather cosmetic, as there is no loss of functionality. However, I find it nice not to have any errors on boot ;-)

The following patch to usb.rc solves the problem for me:

--- usb.rc.orig 2004-07-10 14:12:04.256260496 +0200
+++ usb.rc      2004-07-10 14:24:23.372897688 +0200
@@ -147,7 +147,8 @@
     modprobe -q usbcore >/dev/null 2>&1
     if [ -d /proc/bus/usb ]; then
        # if it's not mounted, try to mount it
-       if [ ! -f /proc/bus/usb/devices ]; then
+        if [ -z "`grep " /proc/bus/usb " /proc/mounts`" ]; then
+#        if [ ! -f /proc/bus/usb/devices ]; then
            if grep -q -E "^[^#][^[:space:]]+[[:space:]]+/proc/bus/usb/?[[:space:]]" /etc/fstab; then
                mount /proc/bus/usb
            else


Reproducible: Always
Steps to Reproduce:




# uname -a
Linux morpheus 2.6.7-gentoo-r8 #3 Wed Jul 7 02:55:40 CEST 2004 i686 Intel(R) Celeron(R) CPU 
1.80GHz GenuineIntel GNU/Linux

sys-apps/baselayout-1.9.4-r2
sys-apps/hotplug-20040401
Comment 1 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-09-20 15:26:40 UTC
Thanks, this has now been fixed upstream and will show up in the next release
(within a day or so.)