--------------31056A073AE001F12353C255
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
-- Oliver Elphick olly@enterprise.net Isle of Wight http://homepages.enterprise.net/olly--------------31056A073AE001F12353C255 Content-Type: text/plain; charset=us-ascii; name="init.bug" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="init.bug"
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.
--------------31056A073AE001F12353C255--