linux-mips
[Top] [All Lists]

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

To: Steven Liu <stevenliu@psdc.com>
Subject: Re: Could not find the source code for "/sbin/init".
From: Pete Popov <ppopov@pacbell.net>
Date: Tue, 07 Aug 2001 10:49:28 -0700
Cc: linux-mips@oss.sgi.com
References: <84CE342693F11946B9F54B18C1AB837B0A2257@ex2k.pcs.psdc.com>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801
Steven Liu wrote:
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.

/sbin/init is part of the SysVInit package.

Your problem is most likely NOT with /sbin/init itself. I would start by loading sash first; if that works, try a static bash; if that works, try a dynamically linked bash.

Pete



<Prev in Thread] Current Thread [Next in Thread>