Re: [2.5.51+] kernel not honoring init= bootparm? (fwd)

Rusty Russell (rusty@rustcorp.com.au)
Mon, 23 Dec 2002 13:08:57 +1100


In message <Pine.LNX.4.43.0212201540160.3821-100000@morpheus> you write:
> I think this might be due to the changes you made.

Indeed it was. Looks like overzealous patch cropping on my part.

This works for me. Linus, please apply.

Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

Name: init= boot command line fix Author: Rusty Russell Status: Tested on 2.5.52

D: Restores the accidentally dropped code to handle init=.

diff -urNp --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.52/init/main.c working-2.5.52-noexit/init/main.c --- linux-2.5.52/init/main.c Tue Dec 17 08:11:00 2002 +++ working-2.5.52-noexit/init/main.c Mon Dec 23 12:49:41 2002 @@ -259,6 +259,22 @@ static int __init unknown_bootoption(cha return 0; } +static int __init init_setup(char *str) +{ + unsigned int i; + + execute_command = str; + /* In case LILO is going to boot us with default command line, + * it prepends "auto" before the whole cmdline which makes + * the shell think it should execute a script with such name. + * So we ignore all arguments entered _before_ init=... [MJ] + */ + for (i = 1; i < MAX_INIT_ARGS; i++) + argv_init[i] = NULL; + return 1; +} +__setup("init=", init_setup); + extern void setup_arch(char **); extern void cpu_idle(void); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/