-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Mastering Embedded Linux Development
By :

In Chapter 4, we saw how the kernel bootstrap code looks for a root filesystem, either initramfs
or a filesystem specified by root=
on the kernel command line. The kernel bootstrap code then executes a program, which, by default, is /init
for initramfs
and /sbin/init
for a regular filesystem. The init
program has root
privilege, and since it is the first process to run, it has a process ID (PID) of 1. If, for some reason, init
cannot be started, the kernel will panic and the system will fail to boot.
The init
program is the ancestor of all other processes, as shown here by the pstree
command running on a simple embedded Linux system:
# pstree -gn
init(1)-+-syslogd(63)
|-klogd(66)
|-dropbear(99)
`-sh(100)---pstree(109)
The job of the init
program is to take control of the boot process in user space and set it running. It may be as simple as a shell command running a shell script—there is an example of this at the...