1# Cloudripper specific init.rc
2import /vendor/etc/init/hw/init.gs201.rc
3
4on init
5    # NFC streset tool name
6    setprop persist.vendor.nfc.streset libstreset21
7    setprop persist.vendor.se.streset libstreset21
8
9# When ro.build.flavor=factory_cloudripper-userdebug, add vendor/bin/factory to default path
10on init && property:ro.build.flavor=factory_cloudripper-userdebug
11    export PATH /product/bin:/apex/com.android.runtime/bin:/apex/com.android.art/bin:/system_ext/bin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin:/vendor/bin/factory
12
13on early-boot
14    # Wait for insmod_sh to finish all common modules
15    wait_for_prop vendor.common.modules.ready 1
16    start insmod_sh_cloudripper
17
18service insmod_sh_cloudripper /vendor/bin/insmod.sh /vendor/etc/init.insmod.cloudripper.cfg
19    class main
20    user root
21    group root system
22    disabled
23    oneshot
24
25on boot && property:ro.build.flavor=factory_cloudripper-userdebug
26    # FTM log folder
27    mkdir /data/ftmlog 0775 system system
28
29    # Audio test folder
30    mkdir /data/AudioTest 0775 system system
31
32on property:sys.boot_completed=1
33    # BCL
34    setprop vendor.disable.bcl.control 1
35
36on property:vendor.mfgapi.touchpanel.permission=1
37    chmod 0600 /sys/devices/virtual/sec/tsp/cmd
38    chown system system /sys/devices/virtual/sec/tsp/cmd
39
40# Bluetooth
41on post-fs-data
42    chown bluetooth system /proc/bluetooth/timesync
43
44# Fingerprint
45on post-fs-data
46    chown system system /dev/goodix_fp
47    exec_background - system shell -- /vendor/bin/trusty_apploader /vendor/firmware/g6.app
48
49# WiFi
50on post-fs-data
51    setprop wifi.direct.interface p2p-dev-wlan0
52    setprop wifi.aware.interface aware_nmi0
53
54# Haptics
55on property:vendor.all.modules.ready=1
56    mkdir /mnt/vendor/persist/haptics 0770 system system
57    chmod 770 /mnt/vendor/persist/haptics
58    chmod 440 /mnt/vendor/persist/haptics/cs40l26.cal
59    chmod 440 /mnt/vendor/persist/haptics/cs40l26_dual.cal
60    chown system system /mnt/vendor/persist/haptics
61    chown system system /mnt/vendor/persist/haptics/cs40l26.cal
62    chown system system /mnt/vendor/persist/haptics/cs40l26_dual.cal
63
64    chown system system /sys/bus/i2c/devices/8-0043/calibration/f0_stored
65    chown system system /sys/bus/i2c/devices/8-0043/calibration/q_stored
66    chown system system /sys/bus/i2c/devices/8-0043/calibration/redc_stored
67    chown system system /sys/bus/i2c/devices/8-0043/default/vibe_state
68    chown system system /sys/bus/i2c/devices/8-0043/default/num_waves
69    chown system system /sys/bus/i2c/devices/8-0043/default/f0_offset
70    chown system system /sys/bus/i2c/devices/8-0043/default/owt_free_space
71    chown system system /sys/bus/i2c/devices/8-0043/default/f0_comp_enable
72    chown system system /sys/bus/i2c/devices/8-0043/default/redc_comp_enable
73    chown system system /sys/bus/i2c/devices/8-0043/default/delay_before_stop_playback_us
74
75    chown system system /sys/bus/i2c/devices/8-0042/calibration/f0_stored
76    chown system system /sys/bus/i2c/devices/8-0042/calibration/q_stored
77    chown system system /sys/bus/i2c/devices/8-0042/calibration/redc_stored
78    chown system system /sys/bus/i2c/devices/8-0042/default/vibe_state
79    chown system system /sys/bus/i2c/devices/8-0042/default/num_waves
80    chown system system /sys/bus/i2c/devices/8-0042/default/f0_offset
81    chown system system /sys/bus/i2c/devices/8-0042/default/owt_free_space
82    chown system system /sys/bus/i2c/devices/8-0042/default/f0_comp_enable
83    chown system system /sys/bus/i2c/devices/8-0042/default/redc_comp_enable
84    chown system system /sys/bus/i2c/devices/8-0042/default/delay_before_stop_playback_us
85
86    enable vendor.vibrator.cs40l26
87    enable vendor.vibrator.cs40l26-dual
88