From 37a0cb7547b1dfb66f52f538bf7ce841dff7501c Mon Sep 17 00:00:00 2001 From: Adam Shih Date: Fri, 15 Oct 2021 10:44:37 +0800 Subject: [PATCH] review sys file nodes Bug: 203025336 Test: check if the paths exist Change-Id: I5141545211e19d3c18b2c3bb315c10d33d5e3774 --- legacy/file.te | 9 --------- legacy/genfs_contexts | 37 ---------------------------------- whitechapel_pro/file.te | 5 +++++ whitechapel_pro/genfs_contexts | 14 +++++++++++++ 4 files changed, 19 insertions(+), 46 deletions(-) diff --git a/legacy/file.te b/legacy/file.te index 8a414f10..9641c879 100644 --- a/legacy/file.te +++ b/legacy/file.te @@ -16,10 +16,6 @@ type vendor_page_pinner_debugfs, fs_type, debugfs_type, sysfs_type; type vendor_mali_debugfs, fs_type, debugfs_type; type vendor_dri_debugfs, fs_type, debugfs_type; -# Exynos sysfs -type sysfs_exynos_bts, sysfs_type, fs_type; -type sysfs_exynos_bts_stats, sysfs_type, fs_type; - # Sensors type nanohub_lock_file, file_type, data_file_type; type sensor_vendor_data_file, file_type, data_file_type, mlstrustedobject; @@ -40,7 +36,6 @@ type per_boot_file, file_type, data_file_type, core_data_file_type; # Touch type proc_touch, proc_type, fs_type, mlstrustedobject; -type sysfs_touch, sysfs_type, fs_type; # Wireless type sysfs_wlc, sysfs_type, fs_type; @@ -56,10 +51,6 @@ type persist_display_file, file_type, vendor_persist_type; # Charger type sysfs_chargelevel, sysfs_type, fs_type; -# bcl -type sysfs_bcl, sysfs_type, fs_type; - -type sysfs_chip_id, sysfs_type, fs_type; type sysfs_spi, sysfs_type, fs_type; # Memory diff --git a/legacy/genfs_contexts b/legacy/genfs_contexts index 91bf2d17..bde1116f 100644 --- a/legacy/genfs_contexts +++ b/legacy/genfs_contexts @@ -1,24 +1,3 @@ -# Tethering -genfscon sysfs /devices/platform/11210000.usb/11210000.dwc3/gadget/net u:object_r:sysfs_net:s0 - -# Vibrator -genfscon sysfs /devices/platform/10970000.hsi2c/i2c-4/4-005a u:object_r:sysfs_vibrator:s0 -genfscon sysfs /devices/platform/10970000.hsi2c/i2c-4/i2c-cs40l25a u:object_r:sysfs_vibrator:s0 -genfscon sysfs /devices/platform/10970000.hsi2c/i2c-5/5-0042 u:object_r:sysfs_vibrator:s0 -genfscon sysfs /devices/platform/10970000.hsi2c/i2c-5/i2c-cs40l25a u:object_r:sysfs_vibrator:s0 - -# Fingerprint -genfscon sysfs /devices/platform/odm/odm:fp_fpc1020 u:object_r:sysfs_fingerprint:s0 - -# Touch -genfscon sysfs /devices/platform/10d40000.spi/spi_master/spi11/spi11.0 u:object_r:sysfs_touch:s0 -genfscon sysfs /devices/platform/10950000.spi/spi_master/spi6/spi6.0 u:object_r:sysfs_touch:s0 -genfscon sysfs /devices/virtual/sec/tsp u:object_r:sysfs_touch:s0 - -# TODO(b/184768835): remove this once the bug is fixed -# Display / LHBM (Local High Brightness Mode) -genfscon sysfs /devices/platform/1c2c0000.drmdsim/1c2c0000.drmdsim.0/backlight/panel0-backlight/local_hbm_mode u:object_r:sysfs_lhbm:s0 - # Bluetooth genfscon sysfs /devices/platform/175b0000.serial/serial0/serial0-0/bluetooth/hci0/rfkill0/state u:object_r:sysfs_bluetooth_writable:s0 genfscon sysfs /devices/platform/odm/odm:btbcm/rfkill/rfkill0/state u:object_r:sysfs_bluetooth_writable:s0 @@ -28,22 +7,6 @@ genfscon proc /bluetooth/sleep/btwrite genfscon proc /bluetooth/sleep/btwake u:object_r:proc_bluetooth_writable:s0 genfscon proc /bluetooth/timesync u:object_r:proc_bluetooth_writable:s0 -# bcl sysfs files -genfscon sysfs /devices/virtual/pmic/mitigation u:object_r:sysfs_bcl:s0 - -genfscon sysfs /devices/system/chip-id/ap_hw_tune_str u:object_r:sysfs_chip_id:s0 -genfscon sysfs /devices/system/chip-id/evt_ver u:object_r:sysfs_chip_id:s0 -genfscon sysfs /devices/system/chip-id/lot_id u:object_r:sysfs_chip_id:s0 -genfscon sysfs /devices/system/chip-id/product_id u:object_r:sysfs_chip_id:s0 -genfscon sysfs /devices/system/chip-id/revision u:object_r:sysfs_chip_id:s0 -genfscon sysfs /devices/system/chip-id/raw_str u:object_r:sysfs_chip_id:s0 - -genfscon sysfs /devices/platform/10d40000.spi/spi_master u:object_r:sysfs_spi:s0 - -# Exynos -genfscon sysfs /devices/platform/exynos-bts u:object_r:sysfs_exynos_bts:s0 -genfscon sysfs /devices/platform/exynos-bts/bts_stats u:object_r:sysfs_exynos_bts_stats:s0 - # Devfreq current frequency genfscon sysfs /devices/platform/17000010.devfreq_mif/devfreq/17000010.devfreq_mif/cur_freq u:object_r:sysfs_devfreq_cur:s0 genfscon sysfs /devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int/cur_freq u:object_r:sysfs_devfreq_cur:s0 diff --git a/whitechapel_pro/file.te b/whitechapel_pro/file.te index 85835699..4e815ee0 100644 --- a/whitechapel_pro/file.te +++ b/whitechapel_pro/file.te @@ -25,6 +25,11 @@ type sysfs_scsi_devices_0000, sysfs_type, fs_type; type sysfs_fabric, sysfs_type, fs_type; type sysfs_acpm_stats, sysfs_type, fs_type; type sysfs_wifi, sysfs_type, fs_type; +type sysfs_exynos_bts, sysfs_type, fs_type; +type sysfs_exynos_bts_stats, sysfs_type, fs_type; +type sysfs_bcl, sysfs_type, fs_type; +type sysfs_chip_id, sysfs_type, fs_type; +type sysfs_touch, sysfs_type, fs_type; # debugfs type debugfs_f2fs, debugfs_type, fs_type; diff --git a/whitechapel_pro/genfs_contexts b/whitechapel_pro/genfs_contexts index 29f91a18..8b76c4da 100644 --- a/whitechapel_pro/genfs_contexts +++ b/whitechapel_pro/genfs_contexts @@ -1,4 +1,18 @@ +# Exynos +genfscon sysfs /devices/platform/exynos-bts u:object_r:sysfs_exynos_bts:s0 +genfscon sysfs /devices/platform/exynos-bts/bts_stats u:object_r:sysfs_exynos_bts_stats:s0 + genfscon sysfs /firmware/devicetree/base/chosen u:object_r:sysfs_chosen:s0 +genfscon sysfs /devices/virtual/pmic/mitigation u:object_r:sysfs_bcl:s0 +genfscon sysfs /devices/system/chip-id/ap_hw_tune_str u:object_r:sysfs_chip_id:s0 +genfscon sysfs /devices/system/chip-id/evt_ver u:object_r:sysfs_chip_id:s0 +genfscon sysfs /devices/system/chip-id/lot_id u:object_r:sysfs_chip_id:s0 +genfscon sysfs /devices/system/chip-id/product_id u:object_r:sysfs_chip_id:s0 +genfscon sysfs /devices/system/chip-id/revision u:object_r:sysfs_chip_id:s0 +genfscon sysfs /devices/system/chip-id/raw_str u:object_r:sysfs_chip_id:s0 + +# Touch +genfscon sysfs /devices/virtual/sec/tsp u:object_r:sysfs_touch:s0 # tracefs genfscon tracefs /events/dmabuf_heap/dma_heap_stat u:object_r:debugfs_tracing:s0