sdm660: Add Hardware Info permssions and sepolicy rules

This commit is contained in:
Max Weffers 2019-08-13 18:38:26 +02:00
parent b71343b029
commit 187b868fcc
No known key found for this signature in database
GPG key ID: 795F73D22FB93FAE
6 changed files with 22 additions and 0 deletions

View file

@ -269,6 +269,19 @@ on boot
# Create pa-cal driver directory lct-20180914 # Create pa-cal driver directory lct-20180914
mkdir /mnt/vendor/persist/audio 0770 root root mkdir /mnt/vendor/persist/audio 0770 root root
# zhitongze@huaqin.com add sensor hardware info 20180207 begin
chmod 0664 /sys/devices/platform/HardwareInfo/gsensor
chmod 0664 /sys/devices/platform/HardwareInfo/msensor
chmod 0664 /sys/devices/platform/HardwareInfo/alsps
chmod 0664 /sys/devices/platform/HardwareInfo/gyro
# zhitongze@huaqin.com add sensor hardware info 20180207 end
chown system system /sys/devices/platform/HardwareInfo/alsps
chown system system /sys/devices/platform/HardwareInfo/gsensor
chown system system /sys/devices/platform/HardwareInfo/msensor
chown system system /sys/devices/platform/HardwareInfo/gyro
chown system system /sys/devices/platform/HardwareInfo/sar_sensor_1
chown system system /sys/devices/platform/HardwareInfo/sar_sensor_2
# msm specific files that need to be created on /data # msm specific files that need to be created on /data
on post-fs-data on post-fs-data
mkdir /data/vendor/misc 01771 system system mkdir /data/vendor/misc 01771 system system

View file

@ -2,6 +2,7 @@ type ir_dev_file, file_type;
type proc_dt2w, fs_type, proc_type; type proc_dt2w, fs_type, proc_type;
type fingerprint_data_file, file_type, data_file_type, core_data_file_type; type fingerprint_data_file, file_type, data_file_type, core_data_file_type;
type fingerprint_sysfs, fs_type, sysfs_type; type fingerprint_sysfs, fs_type, sysfs_type;
type sysfs_info, fs_type, sysfs_type;
allow ueventd ir_dev_file:chr_file { create setattr }; allow ueventd ir_dev_file:chr_file { create setattr };

View file

@ -18,6 +18,10 @@
# HVDCP # HVDCP
/sys/devices(/platform)?/soc/[a-z0-9]+\.i2c/i2c-[0-9]+/[0-9]+-[a-z0-9]+/[a-z0-9]+\.i2c:qcom,[a-z0-9]+@[a-z0-9]:qcom,smb[a-z0-9]+-parallel-slave@[0-9]+/power_supply/parallel(/.*)? u:object_r:sysfs_usb_supply:s0 /sys/devices(/platform)?/soc/[a-z0-9]+\.i2c/i2c-[0-9]+/[0-9]+-[a-z0-9]+/[a-z0-9]+\.i2c:qcom,[a-z0-9]+@[a-z0-9]:qcom,smb[a-z0-9]+-parallel-slave@[0-9]+/power_supply/parallel(/.*)? u:object_r:sysfs_usb_supply:s0
# HW Info
/sys/devices/platform/HardwareInfo(/.*)? u:object_r:sysfs_info:s0
/sys/devices/platform/HardwareInfo/gsensor u:object_r:sysfs_info:s0
# IR # IR
/dev/spidev7.1 u:object_r:spidev_device:s0 /dev/spidev7.1 u:object_r:spidev_device:s0

1
sepolicy/vendor/hal_audio_default.te vendored Normal file
View file

@ -0,0 +1 @@
allow hal_audio_default sysfs_info:file { open getattr read };

View file

@ -1 +1,2 @@
allow hal_sensors_default sysfs:file { read open }; allow hal_sensors_default sysfs:file { read open };
allow hal_sensors_default sysfs_info:file { read write };

View file

@ -5,3 +5,5 @@ allow init property_socket:sock_file write;
allow init sysfs_dm:file { open write }; allow init sysfs_dm:file { open write };
allow init tee_device:chr_file { write ioctl }; allow init tee_device:chr_file { write ioctl };
allow init vendor_default_prop:property_service set; allow init vendor_default_prop:property_service set;
allow init sysfs_info:file { open read };
allow init sysfs:file setattr;