Skip to content

Commit

Permalink
[PATCH] Add warning `init=' to init/main.c
Browse files Browse the repository at this point in the history
I passed init=/mylinuxrc to the kernel on the command line.  The kernel
silently dropped down to exec /sbin/init.  It turned out that /mylinuxrc
had improper permissions.  Without any warning message from the kernel that
something was wrong it took awhile to find the issue.  The patch below adds
a warning.

Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Avery, Brian authored and Linus Torvalds committed Sep 7, 2005
1 parent 8fc2751 commit c1d7ef7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -708,10 +708,11 @@ static int init(void * unused)
* The Bourne shell can be used instead of init if we are
* trying to recover a really broken machine.
*/

if (execute_command)
if (execute_command) {
run_init_process(execute_command);

printk(KERN_WARNING "Failed to execute %s. Attempting "
"defaults...\n", execute_command);
}
run_init_process("/sbin/init");
run_init_process("/etc/init");
run_init_process("/bin/init");
Expand Down

0 comments on commit c1d7ef7

Please sign in to comment.