Inside initrd.img

If we look at the initrd folder, we can see the following contents:

$ cd bootable/newinstaller/initrd $ ls -1F bin/ init* lib/ sbin/ scripts/ 

The content of initrd.img consists of a minimal Linux environment based on busybox. We can find busybox at bin/busybox and shared libraries required by busybox at lib/. There is an executable init file and a few folders inside the initrd folder. We know that the init process is the first process invoked by the kernel when the system starts. Android-x86 provides a separate init process to start the system inside initrd.img. This version of init is actually a shell script instead of a binary executable file:

This shell script will perform the tasks shown in the preceding figure: ...

Get Android System Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.