diff --git a/rootdir/init.rc b/rootdir/init.rc index 1e0fa9a82..bf34a9e66 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -1361,3 +1361,16 @@ on property:persist.device_config.mglru_native.lru_gen_config=core_and_nonleaf_y write /sys/kernel/mm/lru_gen/enabled 5 on property:persist.device_config.mglru_native.lru_gen_config=all write /sys/kernel/mm/lru_gen/enabled 7 + +# Allow other processes to run `snapshotctl` through `init`. This requires +# `set_prop` permission on `snapshotctl_prop`. +on property:sys.snapshotctl.map=requested + # "root" is needed to talk to gsid and pass its check on uid. + # "system" is needed to write to "/dev/socket/snapuserd" to talk to + # snapuserd. + exec - root root system -- /system/bin/snapshotctl map + setprop sys.snapshotctl.map "finished" + +on property:sys.snapshotctl.unmap=requested + exec - root root system -- /system/bin/snapshotctl unmap + setprop sys.snapshotctl.unmap "finished"