a5xelte: ramdisk: save/restore the batt_capacity_max value on boot to preserve batter...
[GitHub/LineageOS/android_device_samsung_a5xelte.git] / ramdisk / etc / init.target.rc
CommitLineData
b7e14c05
DW
1on boot
2 # Assign TCP buffer thresholds to be ceiling value of technology maximums
3 # Increased technology maximums should be reflected here.
4 write /proc/sys/net/core/rmem_max 2097152
5 write /proc/sys/net/core/wmem_max 2097152
6
7on fs
8 # Permissions for LCD
9 chown system system /sys/class/lcd/panel/ldu_correction
10 chown system system /sys/class/lcd/panel/lux
11 chown system media_rw /sys/class/lcd/panel/adaptive_control
12
13 # Permissions for Touchkey
14 chown system radio /sys/class/sec/sec_touchkey/sar_enable
15 chown system radio /sys/class/sec/sec_touchkey/sw_reset
16 chown system radio /sys/class/sec/sec_touchkey/touchkey_earjack
562312cb
CH
17 chmod 0660 /dev/i2c-0
18 chown audio audio /dev/i2c-0
b7e14c05
DW
19
20 # Accelerometer_sensor
21 chown system radio /sys/class/sensors/accelerometer_sensor/mcu_rev
22 chown system radio /sys/class/sensors/accelerometer_sensor/mcu_name
23
24 # Fingerprint_sensor
25 chown system radio /sys/class/fingerprint/fingerprint/type_check
26 chown system radio /sys/class/fingerprint/fingerprint/name
27 chown system radio /sys/class/fingerprint/fingerprint/vendor
28
29 # BHY
30 chown system radio /sys/devices/13870000.hsi2c/i2c-0/0-0028/iio:device0/event_shealth_int
31 chown system radio /sys/devices/13870000.hsi2c/i2c-0/0-0028/iio:device0/pedometer_steps
32 chown system radio /sys/devices/13870000.hsi2c/i2c-0/0-0028/iio:device0/shealth_cadence
33 chown system radio /sys/devices/13870000.hsi2c/i2c-0/0-0028/iio:device0/shealth_cadence_enable
34 chown system radio /sys/devices/13870000.hsi2c/i2c-0/0-0028/iio:device0/shealth_enable
35 chown system radio /sys/devices/13870000.hsi2c/i2c-0/0-0028/iio:device0/shealth_flush_cadence
36 chmod 660 /sys/devices/13870000.hsi2c/i2c-0/0-0028/iio:device0/event_shealth_int
37 chmod 660 /sys/devices/13870000.hsi2c/i2c-0/0-0028/iio:device0/pedometer_steps
38 chmod 660 /sys/devices/13870000.hsi2c/i2c-0/0-0028/iio:device0/shealth_cadence_enable
39 chmod 660 /sys/devices/13870000.hsi2c/i2c-0/0-0028/iio:device0/shealth_enable
40 chmod 660 /sys/devices/13870000.hsi2c/i2c-0/0-0028/iio:device0/shealth_flush_cadence
41
8eeae784
DW
42 # Restore the previous batt_capacity_max (if it exists)
43 copy /efs/Battery/prev_batt_capacity_max /sys/class/power_supply/battery/batt_capacity_max
44
b7e14c05
DW
45on property:sys.boot_completed=1
46 write /proc/sys/vm/dirty_bytes 41943040
47 write /proc/sys/vm/dirty_background_bytes 20971520
48
49 # Set best cache size for internal and external storages
50 write /sys/block/mmcblk0/bdi/read_ahead_kb 128
51 write /sys/block/mmcblk1/bdi/read_ahead_kb 2048
52
8eeae784
DW
53on shutdown
54 # Fix permissions then store the current batt_capacity_max value in the EFS partition
55 chmod 600 /sys/class/power_supply/battery/batt_capacity_max
56 copy /sys/class/power_supply/battery/batt_capacity_max /efs/Battery/prev_batt_capacity_max
57