After searching for information about the android file system on the Internet over the past few days, we found that many experts have analyzed the android file system, these experts analyze the structure and operating principle of their file systems from different aspects. I will write down my understanding here.
The first is the structure of the root directory of the android File System:
# PWD & LS-a-l
/
Drwxrwxrwt Root sqlite_stmt_journals
Drwxrwx --- system cache Cache
D --- rwxrwx system 1970-01-01 08:00 sdcard
Lrwxrwxrwx Root etc->/system/etc
Drwxr-XR-x Root 2008-09-06 System
Drwxr-XR-x Root 1970-01-01 08:00 sys
Drwxr-x --- Root 1970-01-01 sbin
-RW-r -- root Root 117 runme. Sh
Dr-XR-x Root 1970-01-01 08:00 proc
-Rwxr-x --- Root 1704 init. Trout. RC
-Rwxr-x --- Root 9329 init. RC
-Rwxr-x --- Root 1677 init. Goldfish. RC
-Rwxr-x --- Root 106636 init
-RW-r -- root Root 118 default. Prop
Drwxrwx -- X system 2008-09-06 data
Drwx ------ Root
Drwxr-XR-x Root Dev
Sqlite_stmt_journals: A tmpfs File System under the root directory, used to store temporary file data.
Cache: it is a temporary cache folder. It is said that it is useless except for T-Mobile's OTA update.
Sdcard: Directory mounted to the FAT32 File System on the SD card
ETC: Point to/system/etc, a well-known configuration file storage directory
System: it is a very important directory. Most of the items in the system are here. The following is the directory structure:
# Ls-a-l/System
Drwxr-XR-x root 208 xbin
Drwxr-XR-x Root modules
Drwxr-XR-x Root 2008-08-01 20:00 framework
Drwxr-XR-x Root 2008-08-01 20:00 Fonts
Drwxr-XR-x Root 2008-08-01 20:00 etc
-RW-r -- root Root 2197 build. Prop
Drwxr-XR-x Root 2008-08-01 20:00 Media
Drwxr-XR-x root shell 2008-08-01 20:00 Bin
Drwxr-XR-x Root 2008-08-01 20:00 USR
Drwxr-XR-x Root 2008-08-01 20:00 app
Drwxr-XR-x Root 2008-09-06 lost + found
Drwxr-XR-x Root 2008-08-01 20:00 lib
Drwxr-XR-x Root 2008-08-01 20:00 SD
-RW-r -- root Root 145 init. RC
SYS: used to mount the sysfs file system. In the device model, the sysfs file system is used to represent the structure of the device. It reflects the layered image of the device to the user space. The user space can modify the File Attribute in sysfs to modify the property value of the device.
Sbin: Only one adbd program is put for debugging.
Proc:/Proc
The system information provided by various files in a file system is not specific to a specific process, but can be used in the context of the entire system.
Data: stores software installed by users and various data.
Root: Nothing.
Dev: Needless to say, the location where the device node files are stored.
The following describes non-directory files:
Runme. Sh is the script used to automatically mount the ext2 File System in the SD card.
Init. Trout. RC, init. RC, init. Goldfish. RC is the initialization file.
Init is the first program to run when the system starts to the file system.
According to the above root directory analysis, the android root file system is not a standard Linux file system, so we have to carefully analyze the startup process in order to understand the Android system.
I will analyze the system directory in detail tomorrow.