文件系统
编译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目录。
/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
本文介绍了Android编译后的关键文件系统,包括ramdisk.img、system.img和userdata.img的作用及挂载过程,并阐述了这些文件系统如何构成Android设备的整体软件环境。
3366

被折叠的 条评论
为什么被折叠?



