檔案系統
編譯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