On 06/20/2014 03:33 PM, Pankaj Kushwaha wrote: > Hi, > > I have a question regarding restorecon recursive method. > Do we have a need to call this on first boot ? We call it after every > OTA which is fine, but I didn't understand the need of running it on > first boot.
To be clear, the restorecon is called on every boot, but it first checks whether there has been a change in the relevant policy files since the last time it was called and if not, it immediately skips processing. On first boot with a fresh userdata, it shouldn't be necessary for /data but may be needed for partitions such as /persist or /factory. The device-specific init.<board>.rc files call restorecon_recursive /persist or /factory to ensure that those are labeled correctly, but as with the restorecon_recursive /data call by init.rc, this will only truly perform relabeling if the configuration has changed since the last time the partition was labeled. The way we track whether the policy files have changed is by storing a hash of the relevant policy file, either as an xattr on the root directory of the partition (for /data outside of /data/data or /persist) or as a separate file (for the /data/data/* directories, stored in /data/system/seapp_hash, managed by the PackageManagerService and installd). _______________________________________________ Seandroid-list mailing list [email protected] To unsubscribe, send email to [email protected]. To get help, send an email containing "help" to [email protected].
