summaryrefstree
path: root/boot/ramdisk/init.oem.rc
blob: c2f6af1513d8a957ef0c8b933f214060c0e348f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
##################################################################################
### VENDOR_EDIT, OEM All rights reserved.
###
### File: - init.oem.rc
### Author: jiangyonggao
### all oem triger & init are here
### ------------------------------- Revision History: ----------------------------
### <author>                        <data>       <version>   <desc>
### ------------------------------------------------------------------------------
### jiangyg@PM                     2013-10-21                Create this file
##################################################################################

#ifdef VENDOR_EDIT
on init
# ic, Slow Motion Scheduling Group (SMSG), in order to intercept the very first app/service, must be this section
    mkdir /dev/cpuctl/smsg
    chown system system /dev/cpuctl/smsg/tasks
    chown system system /dev/cpuctl/smsg/cpu.cfs_period_us
    chown system system /dev/cpuctl/smsg/cpu.cfs_quota_us
    chown system system /dev/cpuctl/smsg/cpu.cfs_quota_us_per_task
    chmod 0666 /dev/cpuctl/smsg/tasks
    write /dev/cpuctl/smsg/cpu.shares 52
#endif

#ifdef VENDOR_EDIT
#Add for fpc fingerprints permission
on boot
    chmod -h 777 /dev/qseecom
    chown system system /dev/fpc1020
    chmod 0660 /dev/fpc1020
    mkdir /data/oemnvitems  0771 radio radio

    chown system system /sys/bus/spi/drivers/fpc1020/spi12.0/diag/spi_register
    chown system system /sys/bus/spi/drivers/fpc1020/spi12.0/diag/spi_data
    chown system system /sys/bus/spi/drivers/fpc1020/spi12.0/setup/adc_gain
    chown system system /sys/bus/spi/drivers/fpc1020/spi12.0/setup/adc_shift
    chown system system /sys/bus/spi/drivers/fpc1020/spi12.0/setup/capture_col_groups
    chown system system /sys/bus/spi/drivers/fpc1020/spi12.0/setup/capture_col_start
    chown system system /sys/bus/spi/drivers/fpc1020/spi12.0/setup/capture_count
    chown system system /sys/bus/spi/drivers/fpc1020/spi12.0/setup/capture_mode
    chown system system /sys/bus/spi/drivers/fpc1020/spi12.0/setup/capture_row_count
    chown system system /sys/bus/spi/drivers/fpc1020/spi12.0/setup/capture_row_start
    chown system system /sys/bus/spi/drivers/fpc1020/spi12.0/setup/capture_settings_mux
    chown system system /sys/bus/spi/drivers/fpc1020/spi12.0/setup/pxl_ctrl
    chown system system /sys/devices/virtual/fpsensor/fpc1020/clock_enable
	chown system system /sys/devices/virtual/fpsensor/fpc1020/ap_tz_switch
# 2015.3.26 Likelong@camera chmod /dev/stmvl6180_ranging to test Laser AF in factory mode
    chown system system /dev/stmvl6180_ranging
#endif
	write /sys/bus/i2c/devices/2-0020/tp_fw_update 0

#ifdef VENDOR_EDIT
#added by zhangxiaowei@camera 20150325 for leds permission
    chown system system /sys/class/leds/led:flash_0/brightness
    chown system system /sys/class/leds/led:flash_1/brightness
    chown system system /sys/class/leds/led:torch_0/brightness
    chown system system /sys/class/leds/led:torch_1/brightness
#endif /*VENDOR_EDIT*/
#ifdef VENDOR_EDIT
#added by zhangxiaowei@camera 20150413  for product mode flashlight
    chown system system /proc/qcom_flash
#endif /*VENDOR_EDIT*/
 #ifdef VENDOR_EDIT
    #shankai@bsp , 2015/03/26, Modify for RGB light support
    chown system system /sys/class/leds/red/blink
    chown system system /sys/class/leds/blue/blink
    chown system system /sys/class/leds/green/blink
 #endif /*VENDOR_EDIT*/

 #ifdef VENDOR_EDIT
   #shankai@bsp , 2015/04/26,modify for RGB breath effect control support
    chown system system /sys/class/leds/red/ramp_step_ms
    chown system system /sys/class/leds/blue/ramp_step_ms
    chown system system /sys/class/leds/green/ramp_step_ms

    chown system system /sys/class/leds/red/duty_pcts
    chown system system /sys/class/leds/blue/duty_pcts
    chown system system /sys/class/leds/green/duty_pcts

    chmod 660 /sys/class/leds/red/ramp_step_ms
    chmod 660 /sys/class/leds/green/ramp_step_ms
    chmod 660 /sys/class/leds/blue/ramp_step_ms


    chmod 660 /sys/class/leds/red/duty_pcts
    chmod 660 /sys/class/leds/green/duty_pcts
    chmod 660 /sys/class/leds/blue/duty_pcts

 #endif /*VENDOR_EDIT*/

#ifdef VENDOR_EDIT
#add access permission for torch, longxiaowu@camera 2016/07/14
	chmod 666 /sys/class/leds/led:flash_torch/brightness
#endif

 #ifdef VENDOR_EDIT
 #liuhuisheng@framework add for enginerr app for sys/class selinux recon
    restorecon /sys/class/leds/keyboard-backlight/brightness
    restorecon /sys/class/leds/button-backlight/brightness
    restorecon /sys/class/leds/red/brightness
    restorecon /sys/class/leds/green/brightness
    restorecon /sys/class/leds/blue/brightness
    restorecon /sys/class/leds/red/blink
    restorecon /sys/class/leds/green/blink
    restorecon /sys/class/leds/blue/blink
#endif /*VENDOR_EDIT*/



#ifdef VENDOR_EDIT
#/* wifi ftm test */
    chown system system /system/bin/wifi_ftm
    chmod 0777  /system/bin/wifi_ftm
    chown system system /system/bin/wifi_single
    chmod 0777  /system/bin/wifi_single
    chown system system /system/bin/iwpriv
    chmod 0777  /system/bin/iwpriv
    chown system system /system/bin/iwlist
    chmod 0777  /system/bin/iwlist
    chown system system /system/xbin/tcpdump
    chmod 0777  /system/xbin/tcpdump
#endif
    write /sys/module/printk/parameters/print_wall_time 1

    # add for nfc
    setprop ro.nfc.port "I2C"
    chmod 0666 /dev/pn544
    chown nfc nfc /dev/pn544

#ifdef VENDOR_EDIT
#huruihuan@android add for enable cgroup_freezer
on init
    mkdir /sys/fs/cgroup/freezer 0750 root system
    mount cgroup none /sys/fs/cgroup/freezer  freezer
    chmod 777 /sys/fs/cgroup/freezer
#endif


#erik.yang, 2015/3/20, add for property self-adaptive
service self-init /sbin/self-init
    class core
    user root
    oneshot
    seclabel u:r:self-init:s0

service copy_wifi_nv /system/bin/copy_wifi_nv
    class late_start
    oneshot

service wififtmserver /system/bin/sh system/bin/wifi_ftm
    class late_start
    user root
    group root
    disabled
    #oneshot

service wifisingle /system/bin/sh system/bin/wifi_single
    class late_start
    user root
    group root
    disabled
    oneshot

on property:wlan.WifiSgle=1
    start wifisingle

on property:wlan.WifiSgle=0
    stop wifisingle

#endif /* VENDOR_EDIT */

# Adb over Network
on property:service.adb.tcp.port=5555
    stop adbd
    start adbd
on property:service.adb.tcp.port=-1
    stop adbd
    start adbd

#ifdef VENDOR_EDIT
#niejianan@oneplus.framework , 2015/04/25, add for mmi charging test
on property:sys.fastcharger=true
	write /sys/class/power_supply/battery/charging_enabled 1

on property:sys.fastcharger=false
	write /sys/class/power_supply/battery/charging_enabled 0
#endif /* VENDOR_EDIT */


#changhua.li Add for [alipay ta upate], {
service updateTA /system/bin/sh /updateTA.sh
	class main
    user root
    disabled
    oneshot
#} add end for [alipay ta upate].

#ifdef VENDOR_EDIT
#liuhuisheng@framework 2015-05-06 Add begin for OTG switch
on property:persist.sys.oem.otg_support=true
    write /sys/module/dwc3/parameters/otg_switch 1
on property:persist.sys.oem.otg_support=false
    write /sys/module/dwc3/parameters/otg_switch 0
#endif



#ifdef VENDOR_EDIT
#added by wuaijun@system
service engineermode-sh /system/bin/sh /init.oem.engineermode.sh
    class late_start
    user root
    oneshot

on post-fs
    chown system system /d/qpnp-smbcharger/ship_mode
    chown system system /dev/param
    chmod 660 /dev/param
    chown system system /sys/class/leds/led:flash_torch/brightness
    chown system system /dev/SN3193

    restorecon /sys/class/leds/led:flash_torch/brightness
#endif /*VENDOR_EDIT*/

#ifdef VENDOR_EDIT
#hefaxi@bsp, 2015/11/06
on post-fs-data
    chmod 0660 /dev/block/mmcblk0p23
    chown root system /dev/block/mmcblk0p23
    # add for nfc
    mkdir /data/nfc
#endif /*VENDOR_EDIT*/

on property:persist.sys.adbroot=1
    setprop selinux.reload_policy 1

#ifdef VENDOR_EDIT
#hieu@oneplus.net, 2015/10/30, SND-10768, add service for bugreport
service bugreport /system/bin/dumpstate -d -p -B \
        -o /data/data/com.android.shell/files/bugreports/bugreport
    class main
    disabled
    oneshot
#endif

#ifdef VENDOR_EDIT
#lifei@oneplus.media, 2016/02/14,  add service for CTS and engineer app
service oem_audio_device /system/bin/chcon u:object_r:oem_audio_device:s0 /dev/snd
    class late_start
    oneshot
#endif

#ifdef VENDOR_EDIT
#WayneChang, 2015/12/29, add for control virtual key feature
on property:persist.sys.oem.region=OverSeas
    write /proc/s1302/virtual_key 0

on property:persist.sys.oem.region=CN
    write /proc/s1302/virtual_key 1
#endif