Be more flexible wrt when to fix Samsung backlight selinux context

This commit is contained in:
Pierre-Hugues Husson 2021-12-19 16:27:18 -05:00
parent bf333ce566
commit 4b86b1ccb5

View File

@ -920,7 +920,7 @@ fi
if getprop ro.vendor.build.fingerprint |grep -qiE '^samsung/';then
for f in /sys/class/lcd/panel/actual_mask_brightness /sys/class/lcd/panel/mask_brightness /sys/class/lcd/panel/device/backlight/panel/brightness /sys/class/backlight/panel0-backlight/brightness;do
if [ "$(stat -c '%U' "$f")" == "root" ];then
if [ "$(stat -c '%U' "$f")" == "root" ] || [ "$(ls -lZ "$f" | grep -oE 'u:object_r:[^:]*:s0')" == "u:object_r:sysfs:s0" ];then
chcon u:object_r:sysfs_lcd_writable:s0 $f
chmod 0644 $f
chown system:system $f