LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   A question about system booting (https://www.linuxquestions.org/questions/linux-general-1/a-question-about-system-booting-312776/)

perfect_circle 04-13-2005 08:58 AM

A question about system booting
 
I have a question about how a linux or Unix box boots.
The bootloader points to the kernel, and the kernel loads.
The root partition is specified as kernel parameter in the boot loader.
Then the kernel loads, utilizes some stuff, mounts the root filesystem (read only in the beginning)and then init (mother of all processes) reads the /etc/inittab to determine what comes next (start up script and the suitable script for the specified runlevel). How does init know that it should read /etc/inittab. Is it hard coded? I tried to grep for inittab in the kernel source tree and nothing appeared. Does the boot loader specify this to the kernel as a parameter, like the root partition? Is it possible to tell the kernel to read another file?

JZL240I-U 04-13-2005 09:12 AM

Um, as far as I remember one is calling the other. Try searching for inittab in /sbin/init, I think you'll find it there...

perfect_circle 04-13-2005 11:07 AM

I've been using the init command for years, and still i was looking for inittab inside the kernel.
Actually the path to init is what is hard-coded inside the kernel, in the file /init/main.c in the kernel tree:
Code:

skalkoto@darkstar:/usr/src/linux-2.4.29/init$ grep "/sbin/init" main.c
run_init_process("/sbin/init");
skalkoto@darkstar:/usr/src/linux-2.4.29/init$

And the inittab path is hardcoded inside the /sbin/init file:
Code:

skalkoto@darkstar:~$ grep "/etc/inittab" /sbin/init
Binary file /sbin/init matches
skalkoto@darkstar:~$

thanks for helping me clear this out.

JZL240I-U 04-13-2005 11:13 AM

In case you don't know them yet:

http://axiom.anu.edu.au/~okeefe/p2b/...ower2bash.html
http://www-106.ibm.com/developerwork.../l-config.html

perfect_circle 04-13-2005 01:21 PM

Thanx. I 'll look at them


All times are GMT -5. The time now is 11:37 PM.