Hi ALL:
As we know, the function init( ) in main.c is
static int init(void * unused)
{
lock_kernel();
do_basic_setup();
free_initmem();
unlock_kernel();
if (open("/dev/console", O_RDWR, 0) < 0)
printk("Warning: unable to open an initial console.\n");
(void) dup(0);
(void) dup(0);
if (execute_command)
execve(execute_command,argv_init,envp_init);
execve("/sbin/init",argv_init,envp_init); //<--- problem
execve("/etc/init",argv_init,envp_init);
execve("/bin/init",argv_init,envp_init);
execve("/bin/sh",argv_init,envp_init);
panic("No init found. Try passing init= option to kernel.");
}
The system call execve("/sbin/init",argv_init,envp_init) will start a
background process.
In my case, it could not start the process, that is, system hangs there
and
execve("/etc/init",argv_init,envp_init) could not be executed.
Could you tell me where could I find the source code for the executable
/sbin/init?
Thank you very much for your help.