Modify

Opened 7 years ago

Closed 5 years ago

Last modified 4 years ago

#9329 closed defect (obsolete)

usbfs mounted too late during startup

Reported by: af+openwrt@… Owned by: developers
Priority: high Milestone: Barrier Breaker 14.07
Component: base system Version: Trunk
Keywords: usb, boot, workaround Cc:

Description

During system startup, usbfs (/proc/bus/usb) is only mounted after the hotplug events have already been generated during boot. Hotplug events happen when modules (including USB modules) are loaded at the end of /etc/init.d/boot, way before the usbfs is mounted by /etc/init.d/usb.

Since some USB tools integrated into the hotplug system (like usb_modeswitch) really need to access usbfs, they fail, so it appears as if some USB devices are completely ignored during startup. This means for example that 3G interfaces connected via USB are not brought up during system boot, which is very bad if your OpenWRT router happens to be installed in a remote location with only 3G network access for example.

If you insert the following lines in /etc/init.d/boot just before the start of the hotplug2 daemon, everything starts to work fine:

        insmod nls_base
        insmod usbcore
        mount -t usbfs usbfs /proc/bus/usb

This is however only a hackish workaround, a more well-designed solution is needed here.

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by bots@…

late mount of usbfs causes also usb storage devices not to be mounted automatically at startup as fstab does not create entries in /etc/fstab for them: my /etc/config/fstab file looks like this:

config 'global' 'automount'
	option 'from_fstab' '1'
	option 'anon_mount' '1'

config 'global' 'autoswap'
	option 'from_fstab' '1'
	option 'anon_swap' '0'

config 'swap'
	option 'device' '/dev/sda2'
	option 'enabled' '1'

config 'mount'
	option 'enabled' '1'
	option 'device' '/dev/sda1'
	option 'target' '/mnt/tmp'
	option 'fstype' 'ext4'

but the resulting /etc/fstab looks like this:

# WARNING: this is an auto generated file, please use uci to set defined filesystems

comment:2 Changed 6 years ago by bots@…

it turned out that the problem with automatic mounting of USB devices is unrelated to this: it was caused basically by the fact that usb subsystem was not ready yet when /etc/init.d/fstab was doing its work. adding

sleep 5

in the beginning of start() function solved the issue.
sorry for the confusion...

comment:3 Changed 5 years ago by nbd

  • Resolution set to obsolete
  • Status changed from new to closed

usbfs is obsolete

comment:4 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.