Search code examples
androidandroid-source

Where do events in init.rc are initiated?


I have been trying to understand where do events in init.rc are initiated.
on fs
   mount yaffs2 mtd@system /system

on property:vold.decrypt=trigger_reset_main
   class_reset main

One thing I know is that events can be triggered using trigger in init.rc itself. Where do these events are initiated outside init.rc?


Solution

  • This is all managed in init.c

    The property system is a little bit complex.

    There is a property service resident in init process. Init process maintains several name spaces of the properties. E.g. ro.xx, system.xx, persist.xx.

    Property setter set the property via notifying the unix socket message. So init process knows every setting action and you can see from the code that there is a callback "property_changed" called every time when a property is set.