Messages in this thread |  | | Date | Fri, 27 Sep 1996 12:31:57 +0100 | From | Oliver Elphick <> | Subject | Problem 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.
|  |