Could not find the source code for "/sbin/init".

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Regards,

Steven Liu


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux