lkml.org 
[lkml]   [1996]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectProblem with init= parameter when starting kernel
-- 
Oliver Elphick olly@enterprise.net
Isle of Wight http://homepages.enterprise.net/olly
At kernel 2.0.13 and 2.0.21 (and probably others), if the argument init=...
is given to the kernel, as for example:

init=/sbin/init.new

the kernel calls the specified program but seems to execute it wrongly.
init.new failed with the message

Usage: sh 0123456SsQqAaBbCc

repeated continually.

I rebooted with the existing /sbin/init, so I copied /sbin/init to
/sbin/init.old and tried rebooting with init=/sbin/init.old - I got the
same error.

I then tried

init=/bin/bash

This worked, but echo $0 printed:

-/bin/sh

I think the problem is probably in the code at the end of init/main.c, but
I cannot see what's wrong with it. The line that I think must be
introducing the 'sh' into arg[0] is

pid = kernel_thread(do_shell,
execute_command ? execute_command : "/bin/sh",
SIGCHLD);

However, execute_command is set or else this code shouldn't get
executed, so how does the second parameter evaluate to "/bin/sh"?

The advice to try a new version of init in this manner was given in the
release notes for sysvinit-2.62, but this problem makes it impossible
to test it in this way.
\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.056 / U:2.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site