Skip to content

Commit

Permalink
init: set ownership of cycle_counts_bins at early-boot
Browse files Browse the repository at this point in the history
Bug: 183127349
Test: no Permission denied for read/write cycle_counts_bins
Signed-off-by: Jack Wu <wjack@google.com>
Change-Id: I89f0258b4bbfd9e60a06f7dcd55823b68a27ed8c
  • Loading branch information
Jack Wu committed Mar 19, 2021
1 parent 5673322 commit 47c462c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions init.hardware.rc
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,12 @@ on early-boot
chown system system /sys/devices/platform/soc/a88000.i2c/i2c-0/0-0061/txlen
chown system system /sys/devices/platform/soc/a88000.i2c/i2c-0/0-0061/ccreset

# FG cycle counts read from dumpstate + backup restore from health HAL
chown system system /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pm660@0:qpnp,fg/cycle_counts_bins

# HardwareInfo needs to be able to read CC bins
chmod 644 /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pm660@0:qpnp,fg/cycle_counts_bins

# Permission for Pixelstats
chown system system /sys/devices/platform/soc/7c4000.sdhci/mmc_host/mmc0/slowio_read_cnt
chown system system /sys/devices/platform/soc/7c4000.sdhci/mmc_host/mmc0/slowio_write_cnt
Expand Down Expand Up @@ -513,12 +519,6 @@ on property:sys.boot_completed=1
chown system system /d/fg/sram/count
chown system system /d/fg/sram/address

# Dump QCOM FG cycle counts for dumpstate
chown system system /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pm660@0:qpnp,fg/cycle_counts_bins

# HardwareInfo needs to be able to read CC bins
chmod 644 /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pm660@0:qpnp,fg/cycle_counts_bins

# dumpstate needs to read, vendor.health-hal needs to be able to RW
chown system system /sys/devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-00/c440000.qcom,spmi:qcom,pm660@0:qpnp,fg/power_supply/bms/charge_full

Expand Down

0 comments on commit 47c462c

Please sign in to comment.