From: Sascha Wildner Date: Mon, 27 Aug 2012 18:00:46 +0000 (+0200) Subject: kernel: Turn the delay before mounting root into a tunable. X-Git-Url: https://gitweb.dragonflybsd.org/~mihaic/dragonfly.git/commitdiff_plain/5a82ae89fa47622130cbc12d4869b3f080a93046 kernel: Turn the delay before mounting root into a tunable. Submitted-by: Francis Gudin Dragonfly-bug: --- diff --git a/sys/boot/common/loader.8 b/sys/boot/common/loader.8 index f20b656539..2d691f67ab 100644 --- a/sys/boot/common/loader.8 +++ b/sys/boot/common/loader.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD: src/sys/boot/common/loader.8,v 1.57 2003/06/29 20:57:55 brueffer Exp $ .\" -.Dd October 16, 2011 +.Dd August 27, 2012 .Dt LOADER 8 .Os .Sh NAME @@ -723,6 +723,9 @@ Overrides the compile-time set value of .Va TCBHASHSIZE or the preset default of 512. Must be a power of 2. +.It Va vfs.root.wakedelay +Specify an additional delay (default is 2 seconds if unspecified) +before trying to mount root. .It Va vfs.root.mountfrom Specify root file system. A semicolon separated list of file systems to try diff --git a/sys/boot/dloader/loader.conf b/sys/boot/dloader/loader.conf index df3aeadf22..d8dfb85275 100644 --- a/sys/boot/dloader/loader.conf +++ b/sys/boot/dloader/loader.conf @@ -94,6 +94,8 @@ bitmap_type="splash_image_data" # and place it on the module_path #kern.ipc.nmbufs="" # Set the maximum number of mbufs #kern.vm.kmem.size="" # Sets the size of kernel memory (bytes) #net.inet.tcp.tcbhashsize="" # Set the value of TCBHASHSIZE +#vfs.root.wakedelay="" # Delay in seconds before trying to mount the + # root #vfs.root.mountfrom="" # Specify root partition in a way the # kernel understands. You can specify a # semicolon separated device list which will diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c index 2795314cd5..b38bc8bfd0 100644 --- a/sys/kern/vfs_conf.c +++ b/sys/kern/vfs_conf.c @@ -102,7 +102,10 @@ char *rootdevnames[2] = {NULL, NULL}; static int setrootbyname(char *name); SYSINIT(mountroot, SI_SUB_MOUNT_ROOT, SI_ORDER_SECOND, vfs_mountroot, NULL); - + +static int wakedelay = 2; /* delay before mounting root in seconds */ +TUNABLE_INT("vfs.root.wakedelay", &wakedelay); + /* * Find and mount the root filesystem */ @@ -121,12 +124,12 @@ vfs_mountroot(void *junk) * Messages can fly around here so get good synchronization * coverage. * - * XXX - Delay an additional 2 seconds to help drivers which pickup + * XXX - Delay some more (default: 2s) to help drivers which pickup * devices asynchronously and are not caught by CAM's initial * probe. */ sync_devs(); - tsleep(&dummy, 0, "syncer", hz*2); + tsleep(&dummy, 0, "syncer", hz * wakedelay); /*