Problem with init= parameter when starting kernel

Oliver Elphick (
Fri, 27 Sep 1996 12:31:57 +0100

This is a multi-part message in MIME format.

Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Oliver Elphick                            
Isle of Wight            

--------------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:


the kernel calls the specified program but seems to execute it wrongly. 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


This worked, but echo $0 printed:


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.