android_device_xiaomi_sdm66.../sepolicy/vendor/vendor_init.te
Chenyang Zhong 851d88070e
sdm660-common: create and symlink a dummy /metadata/apex
Google moved apex sessions directory from /data/apex/sessions to
/metadata/apex/sessions after commit:

"Move apex sessions directory to /metadata"
36cf4bbac6

Devices with a mounted metadata partition will have the needed
directories set up by system/core/rootdir/init.rc. Xiaomi devices
on sm6125 do not have a metadata partition out of the box, so things
like "Google Play system update" will fail to install the update.

Therefore, create a dummy directory under /data/vendor/metadata_apex
and symlink it to /metadata/apex.

The reason why the old /data/apex/sessions directory is not used
for the symlink is that apexd will call migrateSessionsDirIfNeeded()
to recursively copy things from the old directory to the new one.
Creating the symlink from /data/apex/sessions may result in
unintended behaviors.

Signed-off-by: OdSazib <odsazib@gmail.com>
2021-02-09 20:53:35 +06:00

38 lines
1.2 KiB
Text

#============= vendor_init ==============
typeattribute vendor_init data_between_core_and_vendor_violators;
allow vendor_init {
media_rw_data_file
system_data_file
tombstone_data_file
camera_data_file
}:dir { create search getattr open read setattr ioctl write add_name remove_name rmdir relabelfrom };
allow vendor_init apex_metadata_file:dir create_dir_perms;
allow vendor_init fingerprint_data_file:dir {setattr create};
allow vendor_init media_rw_data_file:file { getattr relabelfrom };
allow vendor_init persist_debug_prop:file read;
allow vendor_init rootfs:dir { add_name create setattr write };
allow vendor_init rootfs:lnk_file setattr;
allow vendor_init unlabeled:{ dir file } { getattr relabelfrom };
allow vendor_init blkio_dev:file { open read write create };
allow vendor_init proc_dirty:file write;
allow vendor_init {
audio_prop
bservice_prop
persist_debug_prop
vendor_persist_dpm_prop
qcom_ims_prop
reschedule_service_prop
thermal_engine_prop
vendor_ssr_prop
vendor_fp_prop
}:property_service set;
set_prop(vendor_init, camera_prop)
set_prop(vendor_init, exported_camera_prop)
set_prop(vendor_init, vendor_camera_prop)
set_prop(vendor_init, freq_prop)
set_prop(vendor_init, fm_prop)
set_prop(vendor_init, vendor_power_prop)