最近改了一個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執行的順序。
- on early-init
- on init
- on early-fs
- on fs
- on post-fs
- on post-fs-data
- on early-boot
- on boot