Android 文件系统

来源:互联网 发布:mysql降序 编辑:程序博客网 时间:2024/06/15 16:48

文件系统

编译android源码之后,在out/target/product/generic一些文件:ramdisk.img、system.img、userdata.img、 system、 data、root

其中root、system、data三个目录分别是目标根文件系统、主文件系统和数据文件系统的目录。

ramdisk.img 根文件系统映像
system.img 主文件系统映像
userdata.img数据映像


其中,system.img是由 system打包压缩得到的, userdata.img是由 data打包压缩得到的。
系统启动时先挂载ramdisk.img,接着分别把system.img和userdata.img挂载到 ramdisk下的system和data目录。

根文件系统:系统启动时第一个mount的文件系统,其下可能会继续挂载其他的文件系统。
/out/target/product/generic/root包括以下目录: data、dev、proc、sbin、sys、system、init/init.rc等。

主文件系统
/out/target/product/generic/system包括以下目录:app、bin、etc、fonts、framework、lib、usr、xbin

=> ramdisk.img is gziped archive. ramdisk.img is a small partition image that is mounted read-only by the kernel at boot time. It only contains /init and a few config files. It is used to start init which will mount the rest of the system images properly and run the init procedure. A Ramdisk is a standard Linux feature. It is made just for the Android and do special things to start up the Android system.

=> system.img is a partition image that will be mounted as /system and thus contains all system binaries.

=> userdata.img is a partition image that can be mounted as /data and thus contains all application-specific and user-specific data

obj 是中间目标文件目录,其下面的APPS是java应用程序包的目录,EXECUTABLES 是可执行程序的目录,SHARED_LIBRARIES STATIC_LIBRARIEs分别是动态库和静态库的目录。

编译出来的应用程序就是放在system/app下的;用户安装的程序则是放在data/app下。

AN
原创粉丝点击