common: Label thermal nodes and give thermal HAL access
authorAndreas Schneider <asn@cryptomilk.org>
Tue, 21 Jul 2020 14:34:57 +0000 (16:34 +0200)
committerJan Altensen <info@stricted.net>
Wed, 12 Aug 2020 16:14:11 +0000 (18:14 +0200)
Change-Id: I0d27ccbe8cef4247e4655abbbb482ed3cb8a3182

common/vendor/genfs_contexts
common/vendor/hal_thermal_default.te [new file with mode: 0644]

index 0dcb7d160c3624ea4c5e2bf2eab1679a4f609156..68f3cecd63b5f1572ec64bbd299c5f582e2f7136 100644 (file)
@@ -15,6 +15,7 @@ genfscon sysfs /class/sec/sensors                                         u:obje
 genfscon sysfs /class/sec/tsp                                             u:object_r:sysfs_sec_touchscreen:s0
 genfscon sysfs /class/sensor_event                                        u:object_r:sysfs_sensors:s0
 genfscon sysfs /class/sensors                                             u:object_r:sysfs_sensors:s0
+genfscon sysfs /class/thermal                                             u:object_r:sysfs_thermal:s0
 genfscon sysfs /class/timed_output/vibrator/intensity                     u:object_r:sysfs_vibrator:s0
 genfscon sysfs /class/timed_output/vibrator/multi_freq                    u:object_r:sysfs_vibrator:s0
 
@@ -39,6 +40,7 @@ genfscon sysfs /devices/virtual/sensors                                   u:obje
 genfscon sysfs /devices/virtual/sensors/hidden_hole/hh_check_coef         u:object_r:sysfs_sensors_writable:s0
 genfscon sysfs /devices/virtual/sensors/ssp_sensor/enable                 u:object_r:sysfs_sensors_writable:s0
 genfscon sysfs /devices/virtual/sensors/ssp_sensor/ssp_flush              u:object_r:sysfs_sensors_writable:s0
+genfscon sysfs /devices/virtual/thermal                                   u:object_r:sysfs_thermal:s0
 genfscon sysfs /devices/virtual/timed_output/vibrator/cp_trigger_index    u:object_r:sysfs_vibrator:s0
 genfscon sysfs /devices/virtual/timed_output/vibrator/intensity           u:object_r:sysfs_vibrator:s0
 genfscon sysfs /devices/virtual/timed_output/vibrator/multi_freq          u:object_r:sysfs_vibrator:s0
diff --git a/common/vendor/hal_thermal_default.te b/common/vendor/hal_thermal_default.te
new file mode 100644 (file)
index 0000000..7cd9ba0
--- /dev/null
@@ -0,0 +1,8 @@
+# hal_thermal_default.te
+
+# /acct/tasks
+allow hal_thermal_default cgroup:file getattr;
+
+# /sys/devices/virtual/thermal/
+allow hal_thermal_default sysfs_thermal:dir r_dir_perms;
+allow hal_thermal_default sysfs_thermal:file r_file_perms;