Replying to myself. Same patch with a local variable for argv_sh. It should apply to both 2.4 and 2.5. > If init cannot be executed, the init(.) function in init/main.c falls back > to sh and calls execve("/bin/sh", argv_init, envp_init). > > But if there is no "init=" in the command line, argv_init can contain > something (most likely the "auto" preprended by lilo) and the shell will > terminate immediately. (parse_options(.) does not handle this case since it > does not find "init="). --- linux-2.4.18/init/main.c Mon Feb 25 20:38:13 2002 +++ linux/init/main.c Wed Feb 27 23:12:40 2002 @@ -544,6 +544,8 @@ static int init(void * unused) { + static char * argv_sh[] = { "sh", NULL, }; + lock_kernel(); do_basic_setup(); @@ -575,6 +577,6 @@ execve("/sbin/init",argv_init,envp_init); execve("/etc/init",argv_init,envp_init); execve("/bin/init",argv_init,envp_init); - execve("/bin/sh",argv_init,envp_init); + execve("/bin/sh",argv_sh,envp_init); panic("No init found. Try passing init= option to kernel."); } 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/