Android source code after compiling to get system.img,ramdisk.img,userdata.img image file. Among them, ramdisk.img is the emulator (simulator) file system, System.img includes the main package, library and other files, Userdata.img includes some user data, emulator is responsible for loading these 3 image files.
Let's take a brief look at these three image files.
The associated files are generated after compilation, as shown.
The folders for the three images are also very clear. When the Android system starts, the SYSTEM.IMG and userdata.img are loaded separately into the system and UserData directories in the RAMDisk filesystem.
Init.rc part of the content
Here to emphasize, from the name can be seen that the RAMDisk file system is a memory-based file system, so using the ADB shell and so on to modify its content,
Once the system restarts, the modified content will be restored.
As I said before, ramdisk.img is the root folder, and the file system made with BusyBox under Linux, Init.rc is a configuration file to be parsed first,
It contains the creation of folders, permissions, and rules for launching important Android services. To modify the contents of the init.rc, re-package the image after the change.
The following is the compile command when compiling these images:
1.system.img
Make Systemimage
2.userdata.img
Make Userdataimage
3.ramdisk.img
Make RAMDisk
4.boot.img
Make Bootimage
5.system Packaging
Make Snod
This does not check for dependencies, just packages the Out\target\product\xxx\system directory into system.img for simple replacement files.
Of course the Execute make command generates all the system images, and in addition, BOOT.IMG is actually a mirror of the ramdisk.img and kernel, which is mirrored in the real product and is not needed in the simulator.
Android System image file