From: Willy Tarreau <willy@w.ods.org>
To: Bill Catlan <wcatlan@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Possible to delay boot process to boot from USB subsystem?
Date: Mon, 3 May 2004 07:34:18 +0200 [thread overview]
Message-ID: <20040503053418.GB10228@alpha.home.local> (raw)
In-Reply-To: <003201c4309c$fd93cd90$0202a8c0@boxa>
Hi,
I include the following patch in all my kernels. It adds a "setuptime" boot
option which allows one to specify how many milliseconds to wait before
mounting the root FS. I usually wait 2500 ms to boot on USB flash, but I
once saw a machine which required a bit more (4 sec). The advantage is that
if it isn't enough, just reboot and change the paramter.
Regards,
Willy
diff -urN linux-2.4.23-rc3/init/main.c linux-2.4.23-rc3-setuptime/init/main.c
--- linux-2.4.23-rc3/init/main.c Fri Oct 10 08:47:16 2003
+++ linux-2.4.23-rc3-setuptime/init/main.c Sun Nov 23 18:12:19 2003
@@ -127,6 +127,7 @@
static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, };
char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, };
+static int setuptime; /* time(ms) to let devices set up before root mount */
static int __init profile_setup(char *str)
{
@@ -137,6 +138,15 @@
__setup("profile=", profile_setup);
+static int __init setuptime_setup(char *str)
+{
+ int par;
+ if (get_option(&str,&par)) setuptime = par;
+ return 1;
+}
+
+__setup("setuptime=", setuptime_setup);
+
static int __init checksetup(char *line)
{
struct kernel_param *p;
@@ -553,12 +563,26 @@
extern void prepare_namespace(void);
+static int finish_setup()
+{
+ int tleft;
+ if (setuptime) {
+ printk("Waiting %d ms for devices to set up.\n", setuptime);
+ tleft = setuptime * HZ / 1000;
+ while (tleft) {
+ set_current_state(TASK_INTERRUPTIBLE);
+ tleft = schedule_timeout(tleft);
+ }
+ }
+}
+
static int init(void * unused)
{
struct files_struct *files;
lock_kernel();
do_basic_setup();
+ finish_setup();
prepare_namespace();
/*
next prev parent reply other threads:[~2004-05-03 5:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-02 23:27 Bill Catlan
2004-05-03 1:27 ` Randy.Dunlap
2004-05-03 5:17 ` Bill Catlan
2004-05-03 20:31 ` Bill Catlan
2004-05-04 18:53 ` Paulo Marques
2004-05-05 14:18 ` Bill Catlan
2004-05-03 5:34 ` Willy Tarreau [this message]
2004-05-03 20:44 ` Bill Catlan
2004-05-03 21:05 ` Willy TARREAU
2004-05-04 2:32 Randy.Dunlap
2004-05-04 4:51 ` Willy Tarreau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040503053418.GB10228@alpha.home.local \
--to=willy@w.ods.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wcatlan@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®