init.target.rc文件中文件夾一直創建不成功


最近改了一個bug,是device/*/*/init.target.rc(6.0.1)文件中創建的文件夾,一直沒有被創建成功。

on early-boot

mkdir /data/min 0755 root root

這句命令在之前的版本的手機上是一直成功的,然后這一期的平板突然不對了。

修改成以下的命令,就對了。

on post-fs-data

mkdir /data/min 0755 root root

究其原因,是因為google在這方面做了以下修改。

https://source.android.com/security/encryption/

【3.Mount /data 】

vold then mounts the decrypted real /data partition and then prepares the new partition.

It sets the property vold.post_fs_data_done to 0 and then sets vold.decrypt to trigger_post_fs_data.

This causes init.rc to run its post-fs-data commands.

They will create any necessary directories or links and then set vold.post_fs_data_done to 1.

所以想在/data/目錄下創建文件夾的話,要在on post-fs-data的時候進行。

下面是init.rc執行的順序。

  1. on early-init
  2. on init
  3. on early-fs
  4. on fs
  5. on post-fs
  6. on post-fs-data
  7. on early-boot
  8. on boot


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM