June 2017
Intermediate to advanced
478 pages
13h 14m
English
We saw in Chapter 4, Configuring and Building the Kernel, how the kernel bootstrap code seeks to find a root filesystem, either initramfs or a filesystem specified by root= on the kernel command line, and then to execute 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.
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 -gninit(1)-+-syslogd(63) |-klogd(66) |-dropbear(99) `-sh(100)---pstree(109)
Read now
Unlock full access