Monday, February 1, 2010

uClinux rc and inittab files

There are two files playing key roles in system startup, rc and inittab. They are referenced by the first user space process "init", which is spawned by the kernel afte completion of the boot process.

/etc/inittab contains system configurations and directives for each run level, as well as directives that apply to all run levels. For a standard Linux system, the entries in inittab will always like this:

id:runlevel:action:process

For example:
l1:1:wait:/etc/rc.d/rc 0 ----> at runlevel 1, wait until /etc/rc.d/rc 0 start and finish
x:5:respawn:/etc/X11/prefdm -nodaemon ----> start xdm at level 5

However, since uClinux has only one runlevel, the inittab usually is very simple. (An example shows there is no "action" field". Am I right?)

The rc file contains all the scripts to run at system startup. This is where different file system are mounted, network interfaces are configured, etc. We can add our own scripts to start specific applications.

It's simple once they are understood. But they can turn to be complex in a real live system I believe.

No comments:

Post a Comment