device_google_gs201/conf/init.debug.rc
Kostya Yarmash 9826c8d092 init.gs201.rc: change permission of SJTAG writable files
On userdebug & eng builds, change permission of SJTAG writable sysfs files that need to be written to 'system'. This became necessary after HSUM separated main user from the SYSTEM user

Bug: 374645181
Flag: EXEMPT bugfix
Test: Ensure that there is "Privileged Debugging" item in BetterBug settings.

Signed-off-by: Kostya Yarmash <kyarmash@google.com>
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:cfde8e50cc66c22ca44da58f4a35c0b3e055646f)
Change-Id: I12857abcb94b4a7e6a068ea712c7f21c3de205ff
2024-10-24 09:48:55 +00:00

60 lines
2.7 KiB
Text

# SJTAG
on init
chown system system /sys/devices/platform/sjtag_ap/interface/access_lvl
chown system system /sys/devices/platform/sjtag_ap/interface/auth
chown system system /sys/devices/platform/sjtag_ap/interface/begin
chown system system /sys/devices/platform/sjtag_ap/interface/dbg_domain
chown system system /sys/devices/platform/sjtag_ap/interface/dbg_itvl
chown system system /sys/devices/platform/sjtag_ap/interface/end
chown system system /sys/devices/platform/sjtag_ap/interface/pubkey
chown system system /sys/devices/platform/sjtag_gsa/interface/access_lvl
chown system system /sys/devices/platform/sjtag_gsa/interface/auth
chown system system /sys/devices/platform/sjtag_gsa/interface/begin
chown system system /sys/devices/platform/sjtag_gsa/interface/dbg_domain
chown system system /sys/devices/platform/sjtag_gsa/interface/dbg_itvl
chown system system /sys/devices/platform/sjtag_gsa/interface/end
chown system system /sys/devices/platform/sjtag_gsa/interface/pubkey
# HSUM separated main user from the SYSTEM user, granting write permissions
# for write only SJTAG sysfs files
chmod 220 /sys/devices/platform/sjtag_ap/interface/auth
chmod 220 /sys/devices/platform/sjtag_ap/interface/begin
chmod 220 /sys/devices/platform/sjtag_ap/interface/end
chmod 220 /sys/devices/platform/sjtag_gsa/interface/auth
chmod 220 /sys/devices/platform/sjtag_gsa/interface/begin
chmod 220 /sys/devices/platform/sjtag_gsa/interface/end
on property:vendor.debug.ramdump.force_crash=true
write /sys/kernel/pixel_debug/trigger "null"
on property:power.battery_input.suspended=true
write /sys/kernel/debug/google_charger/input_suspend 1
on property:power.battery_input.suspended=false
write /sys/kernel/debug/google_charger/input_suspend 0
# Bluetooth
on post-fs-data
chown bluetooth system /dev/logbuffer_btlpm
chown bluetooth system /dev/logbuffer_btpower
chown bluetooth system /dev/logbuffer_tty18
# pKVM performance is different on A0 and B0 chips.
# Add extra tag to metrics collected on A0 to separate the results.
on property:ro.revision=PROTO1.0
setprop debug.hypervisor.metrics_tag "hwrev_a0"
on property:ro.revision=PROTO1.1
setprop debug.hypervisor.metrics_tag "hwrev_a0"
on property:ro.revision=EVT1.0
setprop debug.hypervisor.metrics_tag "hwrev_a0"
service vendor.check_ap_pd_auth_sh /vendor/bin/init.check_ap_pd_auth.sh
class main
user root
group root system
oneshot
# Enable etm/etm2dram when ramdump is enabled, and ap-sjtag is unlocked.
on property:ro.boot.ramdump=enabled && property:ro.vendor.sjtag_ap_is_unlocked=true
write /sys/devices/platform/exynos-etm/etm_on 1
write /sys/devices/platform/etm2dram/arm 1