Disable root mount waiting for USB
Olivier SMEDTS
olivier at gid0.org
Tue Jul 28 16:26:44 UTC 2009
On Tue, Jul 28, 2009 at 05:18:54PM +0300, Andriy Gapon wrote:
> on 28/07/2009 16:52 Robert Noland said the following:
> > Ok, Apparently I'm incorrect here... The man page is misleading... It
> > seems that you do need to declare the TUNABLE_INT as well as change the
> > CTLFLAG_RW to CTLFLAG_RDTUN.
Attached patch tested, works as expected.
>
> Yes, the former change is "cosmetics" (very useful variety) that turns the sysctl
> into read-only one (because changing it after boot would have no effect either
> way) and provides a hint to sysctl(1) to print much friendlier and useful error
> message when a user would attempt to change the value.
>
> --
> Andriy Gapon
--
Olivier Smedts _
ASCII ribbon campaign ( )
e-mail: olivier at gid0.org - against HTML email & vCards X
www: http://www.gid0.org - against proprietary attachments / \
"Il y a seulement 10 sortes de gens dans le monde :
ceux qui comprennent le binaire,
et ceux qui ne le comprennent pas."
-------------- next part --------------
Index: sys/dev/usb/controller/usb_controller.c
===================================================================
--- sys/dev/usb/controller/usb_controller.c (r?vision 195918)
+++ sys/dev/usb/controller/usb_controller.c (copie de travail)
@@ -79,6 +79,11 @@
"Debug level");
#endif
+static int usb_no_boot_wait = 0;
+SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, &usb_no_boot_wait, 0,
+ "No device enumerate waiting at boot.");
+TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wait);
+
static uint8_t usb_post_init_called = 0;
static devclass_t usb_devclass;
@@ -132,8 +137,10 @@
return (ENXIO);
}
- /* delay vfs_mountroot until the bus is explored */
- bus->bus_roothold = root_mount_hold(device_get_nameunit(dev));
+ if (usb_no_boot_wait == 0) {
+ /* delay vfs_mountroot until the bus is explored */
+ bus->bus_roothold = root_mount_hold(device_get_nameunit(dev));
+ }
if (usb_post_init_called) {
mtx_lock(&Giant);
More information about the freebsd-current
mailing list