miatoll: Fixup sensors list

* With MIUI 13, Xiaomi deleted sensor_temperature from its sensor list
* Let's use a simple script that clears out the long gone sensor entry from the list

Change-Id: I7d1ba1aeb40627f5732422a4135cc5394be83703
This commit is contained in:
Giovanni Ricca 2023-08-20 19:42:54 +02:00 committed by Alexander Winkowski
parent 265a57d6b3
commit 1d56ce6642
No known key found for this signature in database
GPG Key ID: 72762A66704CDE44
6 changed files with 29 additions and 1 deletions

View File

@ -349,7 +349,8 @@ PRODUCT_PACKAGES += \
PRODUCT_PACKAGES += \
init.qcom.early_boot.sh \
init.qcom.sh \
init.qti.chg_policy.sh
init.qti.chg_policy.sh \
init.sensors_fixup.sh
PRODUCT_PACKAGES += \
init.device.rc \

View File

@ -23,6 +23,12 @@ sh_binary {
vendor: true,
}
sh_binary {
name: "init.sensors_fixup.sh",
src: "bin/init.sensors_fixup.sh",
vendor: true,
}
// fstab
prebuilt_etc {
name: "fstab.qcom",

View File

@ -0,0 +1,8 @@
#!/vendor/bin/sh
#
# Copyright (C) 2023 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
sed -i '/sensor_temperature/d' /mnt/vendor/persist/sensors/sensors_list.txt

View File

@ -81,6 +81,8 @@ on fs
mkdir /mnt/vendor/persist/subsys 0770 root system
mkdir /mnt/vendor/persist/audio 0755 system system
mkdir /mnt/vendor/persist/haptics 0755 system system
# Clean out sensor_temperature from the sensor list
start vendor.sensors_fixup
on post-fs
write /dev/ipa 1
@ -156,6 +158,12 @@ service vendor.thermal-engine /vendor/bin/thermal-engine -c /vendor/etc/thermal-
user root
group root
service vendor.sensors_fixup /vendor/bin/init.sensors_fixup.sh
class main
user system
group system
oneshot
on property:init.svc.vendor.per_mgr=running
start vendor.per_proxy

View File

@ -53,6 +53,9 @@
/vendor/lib64/libxmi_high_dynamic_range\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/libxml2_vendor\.so u:object_r:same_process_hal_file:s0
# Sensors
/vendor/bin/init\.sensors_fixup\.sh u:object_r:vendor_init-qcom-sensors-sh_exec:s0
# Thermal
/vendor/bin/hw/android\.hardware\.thermal@2\.0-service\.pixel u:object_r:hal_thermal_default_exec:s0
/vendor/bin/thermal_symlinks u:object_r:init-thermal-symlinks-sh_exec:s0

View File

@ -0,0 +1,2 @@
allow vendor_init-qcom-sensors-sh vendor_persist_sensors_file:dir rw_dir_perms;
allow vendor_init-qcom-sensors-sh vendor_persist_sensors_file:file create_file_perms;