What should be in the root filesystem?
The kernel will get a root filesystem, either as an initramfs
passed as a pointer from the bootloader or by mounting the block device given on the kernel command line by the root=
parameter. Once it has a root filesystem, the kernel will execute the first program, by default named init
, as described in the Early user space section in Chapter 4, Configuring and Building the Kernel. Then, as far as the kernel is concerned, its job is complete. It is up to the init
program to begin starting other programs and bring the system to life.
To make a minimal root filesystem, you need these components:
- init: This is the program that starts everything off, usually by running a series of scripts. I will describe how
init
works in much more detail in Chapter 13, Starting Up – The init Program. - Shell: You need a shell to give you a command prompt but, more importantly, also to run the shell scripts called by
init
and other programs.
...