]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] honour init= bootparm
authorRusty Russell <rusty@rustcorp.com.au>
Sun, 22 Dec 2002 10:57:11 +0000 (02:57 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 22 Dec 2002 10:57:11 +0000 (02:57 -0800)
Restore the accidentally dropped code to handle "init=xxx"

init/main.c

index b6d4d4e103d38d5156037387df341e1954a3c2f1..6770292ed29a26f3411c7eec6a4bab2130124998 100644 (file)
@@ -259,6 +259,22 @@ static int __init unknown_bootoption(char *param, char *val)
        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);