sdm710-common: Build KProfiles

- Inherit KProfiles.
- Address sepolicy.
- Define sysfs_kprofiles as a domain.
- Fix permission of nodes relevant to KProfiles at boot.

Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
This commit is contained in:
Cyber Knight 2022-06-17 02:12:27 +08:00 committed by CakesTwix
parent fc8d340024
commit f8e389999a
Signed by: CakesTwix
GPG key ID: 7B11051D5CE19825
6 changed files with 22 additions and 0 deletions

View file

@ -100,6 +100,12 @@ on boot
write /dev/cpuset/background/cpus 0-7
write /dev/cpuset/system-background/cpus 0-7
# Allow system to manipulate KProfiles modes and parameters
chown system system /sys/module/kprofiles/parameters/auto_kprofiles
chmod 0660 /sys/module/kprofiles/parameters/auto_kprofiles
chown system system /sys/module/kprofiles/parameters/kp_mode
chmod 0660 /sys/module/kprofiles/parameters/kp_mode
####Regionalization config and prop files####
chmod 0644 /persist/speccfg/spec
chmod 0644 /persist/speccfg/devicetype

View file

@ -261,6 +261,10 @@ PRODUCT_PACKAGES += \
vendor.lineage.livedisplay@2.0-service-sdm
endif
# KProfiles
PRODUCT_PACKAGES += \
KProfiles
# Media
PRODUCT_PACKAGES += \
libavservices_minijail \

View file

@ -10,3 +10,6 @@ type sysfs_msm_subsys, sysfs_type, fs_type;
type sysfs_rpm, sysfs_type, fs_type;
type sysfs_system_sleep_stats, sysfs_type, fs_type;
type sysfs_tp, fs_type, sysfs_type;
# KProfiles
type sysfs_kprofiles, sysfs_type, fs_type;

View file

@ -6,3 +6,7 @@ genfscon proc /sys/kernel/sched_boost u:object_r:proc_sysctl_sch
# DT2W
genfscon sysfs /devices/virtual/touch/tp_dev/gesture_on u:object_r:sysfs_tp:s0
# KProfiles
genfscon sysfs /module/kprofiles/parameters/auto_kprofiles u:object_r:sysfs_kprofiles:s0
genfscon sysfs /module/kprofiles/parameters/kp_mode u:object_r:sysfs_kprofiles:s0

View file

@ -1,3 +1,6 @@
allow init self:netlink_route_socket rw_socket_perms_no_ioctl;
allow init self:rawip_socket create_socket_perms_no_ioctl;
allow init socket_device:sock_file { unlink setattr create };
# Allow init to set attribute to sysfs_kprofiles
allow init sysfs_kprofiles:file { setattr };

2
sepolicy/vendor/system_app.te vendored Normal file
View file

@ -0,0 +1,2 @@
# Allow KProfiles to be adjusted by a system app
allow system_app sysfs_kprofiles:file rw_file_perms;