init.qcom.rc 25.6 KB
Newer Older
Chirayu Desai's avatar
Chirayu Desai committed
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
# Copyright (c) 2009-2012, 2014-2015, The Linux Foundation. All rights reserved.
# Copyright (C) 2013 Sony Mobile Communications Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#     * Neither the name of The Linux Foundation nor
#       the names of its contributors may be used to endorse or promote
#       products derived from this software without specific prior written
#       permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# NOTE: This file has been modified by Sony Mobile Communications Inc.
# Modifications are licensed under the License.
#

import init.qcom.usb.rc

on early-init
    mount debugfs /sys/kernel/debug /sys/kernel/debug mode=755
    symlink /dev/pn54x /dev/pn547

    # Disable big cluster
    write /sys/module/msm_performance/parameters/num_clusters 2
    write /sys/module/msm_performance/parameters/managed_cpus 0-3
    write /sys/module/msm_performance/parameters/managed_cpus 4-7

on init
    mkdir /persist/data 0700 system system
Giulio Cervera's avatar
Giulio Cervera committed
45
46

    wait /dev/block/mmcblk0p1
47
    chown oem_2997 oem_2997 /dev/block/mmcblk0p1
Giulio Cervera's avatar
Giulio Cervera committed
48
    chmod 0770 /dev/block/mmcblk0p1
Chirayu Desai's avatar
Chirayu Desai committed
49

50
51
52
    # default is root radio 0440
    chmod 0644 /proc/cmdline

Chirayu Desai's avatar
Chirayu Desai committed
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
    write /sys/devices/soc.0/f98a4900.sdhci/mmc_host/mmc1/clkgate_delay 1
    # Avoid long waits for rcu grace periods
    write /sys/kernel/rcu_expedited 1

    # Enable ramdumps from subsystems to dump
    # adsp ssr
    write /sys/bus/msm_subsys/devices/subsys0/restart_level "SYSTEM"
    # modem ssr
    write /sys/bus/msm_subsys/devices/subsys1/restart_level "RELATED"
    # wcnss ssr
    write /sys/bus/msm_subsys/devices/subsys2/restart_level "RELATED"

    # Create a tmpfs for dynamic network mounting
    mkdir /storage/removable/remote 0700 root system
    mount tmpfs tmpfs /storage/removable/remote mode=0755,uid=0,gid=0

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
    # Panel backlight
    chown system system /sys/class/leds/lcd-backlight/brightness
    chmod 660 /sys/class/leds/lcd-backlight/brightness

    # RGB lights
    chown system system /sys/class/leds/red/pause_lo
    chown system system /sys/class/leds/green/pause_lo
    chown system system /sys/class/leds/blue/pause_lo

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

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

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

    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
    chmod 660 /sys/class/leds/red/start_idx
    chmod 660 /sys/class/leds/green/start_idx
    chmod 660 /sys/class/leds/blue/start_idx

106
107
108
109
    # ZRAM setup
    write /sys/block/zram0/comp_algorithm lz4
    write /proc/sys/vm/page-cluster 0

110
111
112
113
114
on early-boot
    # set RLIMIT_MEMLOCK to 64MB
    setrlimit 8 67108864 67108864
    write /sys/kernel/boot_adsp/boot 1

Chirayu Desai's avatar
Chirayu Desai committed
115
on fs
116
117
    wait /dev/block/platform/soc.0/${ro.boot.bootdevice}
    symlink /dev/block/platform/soc.0/${ro.boot.bootdevice} /dev/block/bootdevice
Chirayu Desai's avatar
Chirayu Desai committed
118
119
120
121
    mount_all fstab.qcom
    # Threshold for cma page reclaim
    write /proc/sys/vm/swap_thresh_cma_free_pages 7680

122
    chown oem_2987 oem_2987 /idd
Giulio Cervera's avatar
Giulio Cervera committed
123
124
125
    chmod 0751 /iddA
    exec /system/bin/rm -r /idd/lost+found
    symlink /idd /mnt/idd
126
    chown oem_2987 oem_2987 /rca
Giulio Cervera's avatar
Giulio Cervera committed
127
128
129
130
    chmod 0750 /rca
    exec /system/bin/rm -r /rca/lost+found
    symlink /rca /mnt/rca

Chirayu Desai's avatar
Chirayu Desai committed
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
on boot

    # execute script to set initial CPU settings
    # don't run as a service to avoid race conditions
    exec - root system -- /system/bin/init.qcom.power.sh

    # Bluetooth
    chown bluetooth net_bt /sys/class/rfkill/rfkill0/type
    chown bluetooth net_bt /sys/class/rfkill/rfkill0/state
    chmod 0660 /sys/class/rfkill/rfkill0/state
    chown bluetooth net_bt /dev/ttyHS0
    chmod 0660 /dev/ttyHS0
    chown bluetooth bluetooth /sys/devices/platform/msm_serial_hs.0/clock
    chmod 0660 /sys/devices/platform/msm_serial_hs.0/clock

    # Create QMUX deamon socket area
    mkdir /dev/socket/qmux_radio 0770 radio radio
    chmod 2770 /dev/socket/qmux_radio
    mkdir /dev/socket/qmux_audio 0770 media audio
    chmod 2770 /dev/socket/qmux_audio
    mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth
    chmod 2770 /dev/socket/qmux_bluetooth
    mkdir /dev/socket/qmux_gps 0770 gps gps
    chmod 2770 /dev/socket/qmux_gps

HaoZeke's avatar
HaoZeke committed
156
157
158
159
160
161
162
163
164
165
    # Required for fingerprint
    chown system system /sys/bus/spi/devices/spi0.1/clk_enable
    chmod 0660 /sys/bus/spi/devices/spi0.1/clk_enable
    chown system system /sys/bus/spi/devices/spi0.1/spi_prepare
    chmod 0660 /sys/bus/spi/devices/spi0.1/spi_prepare
    chown system system /sys/bus/spi/devices/spi0.1/wakeup_enable
    chmod 0660 /sys/bus/spi/devices/spi0.1/wakeup_enable
    chown system system /sys/bus/spi/devices/spi0.1/irq
    chmod 0660 /sys/bus/spi/devices/spi0.1/irq

166
167
168
169
170
171
172
173
174
    # add a cpuset for the camera daemon
    # we want all the little cores for camera
    mkdir /dev/cpuset/camera-daemon
    write /dev/cpuset/camera-daemon/cpus 0
    write /dev/cpuset/camera-daemon/mems 0 
    chown system system /dev/cpuset/camera-daemon
    chown system system /dev/cpuset/camera-daemon/tasks
    chmod 0664 /dev/cpuset/camera-daemon/tasks

Chirayu Desai's avatar
Chirayu Desai committed
175
176
177
178
179
180
181
    # update foreground cpuset now that processors are up
    # reserve CPU 3 for the top app and camera daemon
    write /dev/cpuset/foreground/cpus 0-2,4-7
    write /dev/cpuset/foreground/boost/cpus 4-7
    write /dev/cpuset/background/cpus 0
    write /dev/cpuset/system-background/cpus 0-2
    write /dev/cpuset/top-app/cpus 0-7
182
    write /dev/cpuset/camera-daemon/cpus 0-3
183
    write /dev/cpuset/restricted/cpus 0-3
Chirayu Desai's avatar
Chirayu Desai committed
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206

    write /proc/sys/kernel/sched_boost 1
    write /proc/sys/vm/dirty_ratio 5
    write /proc/sys/vm/dirty_background_ratio 1

    # Create NETMGR daemon socket area
    mkdir /dev/socket/netmgr 0750 radio radio

    # port-bridge
    chmod 0660 /dev/smd0
    chown system system /dev/smd0

    chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state

    # MDP idle notifier
    chown system graphics /sys/class/graphics/fb0/idle_time
    chmod 0664 /sys/class/graphics/fb0/idle_time

    # Remove write permissions to video related nodes
    chown system graphics /sys/class/graphics/fb1/hpd
    chown system system /sys/class/graphics/fb1/hdcp/tp
    chown system graphics /sys/class/graphics/fb1/vendor_name
    chown system graphics /sys/class/graphics/fb1/product_description
207
    chown system graphics /sys/class/graphics/fb1/res_info
Chirayu Desai's avatar
Chirayu Desai committed
208
209
210
211
    chmod 0664 /sys/class/graphics/fb1/hpd
    chmod 0664 /sys/class/graphics/fb1/hdcp/tp
    chmod 0664 /sys/class/graphics/fb1/vendor_name
    chmod 0664 /sys/class/graphics/fb1/product_description
212
    chmod 0664 /sys/class/graphics/fb1/res_info
Chirayu Desai's avatar
Chirayu Desai committed
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
    chmod 0664 /sys/class/graphics/fb1/video_mode
    chmod 0664 /sys/class/graphics/fb1/format_3d

    # create symlink for fb1 as HDMI
    symlink /dev/graphics/fb1 /dev/graphics/hdmi

    # Change owner and group to get adopter/device ids from MHL driver
    chown system system /sys/class/mhl/sii8334/adopter_id
    chown system system /sys/class/mhl/sii8334/device_id

    # Change permissions for fps_level nodes
    chown system graphics /sys/class/graphics/fb0/msm_fb_fps_level
    chown system graphics /sys/class/graphics/fb1/msm_fb_fps_level
    chown system graphics /sys/class/graphics/fb2/msm_fb_fps_level
    chmod 644 /sys/class/graphics/fb0/msm_fb_fps_level
    chmod 400 /sys/class/graphics/fb1/msm_fb_fps_level
    chmod 400 /sys/class/graphics/fb2/msm_fb_fps_level

    chown system system /sys/devices/virtual/graphics/fb0/rgb
    chmod 0660 /sys/devices/virtual/graphics/fb0/rgb

    #Remove SUID bit for iproute2 ip tool
    chmod 0755 /system/bin/ip

    chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state

#   Assign TCP buffer thresholds to be ceiling value of technology maximums
#   Increased technology maximums should be reflected here.
    write /proc/sys/net/core/rmem_max  8388608
    write /proc/sys/net/core/wmem_max  8388608

    #To allow interfaces to get v6 address when tethering is enabled
    write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet3/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet4/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet5/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet6/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet7/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet_sdio0/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet_sdio1/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet_sdio2/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet_sdio3/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet_sdio4/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet_sdio5/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet_sdio6/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet_sdio7/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet_usb0/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet_usb1/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet_usb2/accept_ra 2
    write /proc/sys/net/ipv6/conf/rmnet_usb3/accept_ra 2

    # To prevent out of order acknowledgements from making
    # connection tracking to treat them as not belonging to
    # the connection they belong to.
    # Otherwise, a weird issue happens in which some long
    # connections on high-throughput links get dropped when
    # an ack packet comes out of order
    write /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal 1

    # NFC local data and nfcee xml storage
    mkdir /data/nfc 0770 nfc nfc
    mkdir /data/nfc/param 0770 nfc nfc

278
    # Set the console loglevel to lt. KERN_INFO
Chirayu Desai's avatar
Chirayu Desai committed
279
280
281
    # Set the default message loglevel to KERN_INFO
    write /proc/sys/kernel/printk "6 6 1 7"

282
283
284
    # Disable audio jack impedance detection
    write /sys/module/snd_soc_wcd9xxx/parameters/impedance_detect_en 0

Chirayu Desai's avatar
Chirayu Desai committed
285
286
287
on post-fs

on post-fs-data
HaoZeke's avatar
HaoZeke committed
288
289
290
    # Fingerprint data folder
    mkdir /data/fpc 0770 system system

Chirayu Desai's avatar
Chirayu Desai committed
291
    #Secd
292
    mkdir /data/credmgr 0770 system oem_2996
Giulio Cervera's avatar
Giulio Cervera committed
293
294

    mkdir /idd/lost+found 0770 root root
295
296
    mkdir /idd/output 0755 oem_2987 oem_2987
    mkdir /idd/socket 0711 oem_2987 oem_2987
Giulio Cervera's avatar
Giulio Cervera committed
297
298
    mkdir /idd/startup-prober 0700 root root
    restorecon_recursive /idd
299
    mkdir /rca/plugins 0750 oem_2987 oem_2987
Giulio Cervera's avatar
Giulio Cervera committed
300
    restorecon_recursive /rca
Chirayu Desai's avatar
Chirayu Desai committed
301
302
303
304
305
306
307
308
309
310
311
312
313

    # KSM options
    write /sys/kernel/mm/ksm/pages_to_scan 100
    write /sys/kernel/mm/ksm/deferred_timer 1
    write /sys/kernel/mm/ksm/sleep_millisecs 999
    write /sys/kernel/mm/ksm/run 1

    # SONY: Import MiscTA to System properties
    mkdir /data/etc 0775 system system

    # Create directory for TZ Apps
    mkdir /data/misc/qsee 0770 system system

314
315
    #Create folder for mm-qcamera-daemon
    mkdir /data/misc/camera 0770 camera camera
316
    mkdir /data/vendor/qcam 0770 camera camera
317

Chirayu Desai's avatar
Chirayu Desai committed
318
319
320
321
322
323
324
325
    mkdir /data/media 0770 media_rw media_rw
    chown media_rw media_rw /data/media

    mkdir /data/misc/ipa 0700 net_admin net_admin

    mkdir /data/misc/bluetooth 0770 bluetooth bluetooth

    # Create the directories used by the Wireless subsystem
326
327
328
329
    mkdir /data/vendor/wifi 0770 wifi wifi
    mkdir /data/vendor/wifi/sockets 0770 wifi wifi
    mkdir /data/vendor/wifi/hostapd 0770 wifi wifi
    mkdir /data/vendor/wifi/hostapd/ctrl 0770 wifi wifi
Chirayu Desai's avatar
Chirayu Desai committed
330
331
332
    mkdir /data/misc/wifi 0770 wifi wifi
    mkdir /data/misc/wifi/sockets 0770 wifi wifi
    mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi
333
334
335
336
    mkdir /data/vendor/wifi/wpa_supplicant 0770 wifi wifi
    mkdir /data/vendor/wifi/wigig_hostapd 0770 wifi wifi
    mkdir /data/vendor/wifi/wpa 0770 wifi wifi
    mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
Chirayu Desai's avatar
Chirayu Desai committed
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
    mkdir /data/misc/dhcp 0770 dhcp dhcp
    chown dhcp system /data/misc/dhcp

    # Create directory used by audio subsystem
    mkdir /data/misc/audio 0770 audio audio

    # Create directory for audio delta files
    mkdir /data/misc/audio/acdbdata 0770 media audio
    mkdir /data/misc/audio/acdbdata/delta 0770 media audio

    # Create directory used by the DASH client
    mkdir /data/misc/dash 0770 media audio

    # Create directory used by display clients
    mkdir /data/misc/display 0770 system graphics
    mkdir /persist/display 0770 system graphics

354
355
356
    # Create directory used by LiveDisplay
    mkdir /data/vendor/display 0770 system graphics

Chirayu Desai's avatar
Chirayu Desai committed
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
    # QCOM Sensors
    mkdir /data/system 0775 system system
    mkdir /data/system/sensors 0775 system system
    mkdir /data/misc/sensors 0775 system system
    write /data/system/sensors/settings 1
    chmod 664 /data/system/sensors/settings
    chown system /data/system/sensors/settings

    # Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections
    # We chown/chmod /persist again so because mount is run as root + defaults
    chown system system /persist
    chmod 0771 /persist
    chmod 0664 /sys/devices/platform/msm_sdcc.1/polling
    chmod 0664 /sys/devices/platform/msm_sdcc.2/polling
    chmod 0664 /sys/devices/platform/msm_sdcc.3/polling
    chmod 0664 /sys/devices/platform/msm_sdcc.4/polling

    # Chown polling nodes as needed from UI running on system server
    chown system system /sys/devices/platform/msm_sdcc.1/polling
    chown system system /sys/devices/platform/msm_sdcc.2/polling
    chown system system /sys/devices/platform/msm_sdcc.3/polling
    chown system system /sys/devices/platform/msm_sdcc.4/polling

380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
    # PM8994 flash
    chown cameraserver camera /sys/class/misc/pmi8994-flash/device/current1
    chown cameraserver camera /sys/class/misc/pmi8994-flash/device/current2
    chown cameraserver camera /sys/class/misc/pmi8994-flash/device/fault_status
    chown cameraserver camera /sys/class/misc/pmi8994-flash/device/fine_current1
    chown cameraserver camera /sys/class/misc/pmi8994-flash/device/fine_current2
    chown cameraserver camera /sys/class/misc/pmi8994-flash/device/flash_timer
    chown cameraserver camera /sys/class/misc/pmi8994-flash/device/mask_clamp_current
    chown cameraserver camera /sys/class/misc/pmi8994-flash/device/mask_enable
    chown cameraserver camera /sys/class/misc/pmi8994-flash/device/max_current
    chown cameraserver camera /sys/class/misc/pmi8994-flash/device/mode
    chown cameraserver camera /sys/class/misc/pmi8994-flash/device/startup_delay
    chown cameraserver camera /sys/class/misc/pmi8994-flash/device/strobe
    chown cameraserver camera /sys/class/misc/pmi8994-flash/device/vph_pwr_droop

Chirayu Desai's avatar
Chirayu Desai committed
395
396
397
398
399
400
401
402
403
404
405
406
407
    # Cover mode
    chown system system /sys/devices/virtual/input/clearpad/cover_mode_enabled
    chown system system /sys/devices/virtual/input/clearpad/cover_win_bottom
    chown system system /sys/devices/virtual/input/clearpad/cover_win_left
    chown system system /sys/devices/virtual/input/clearpad/cover_win_right
    chown system system /sys/devices/virtual/input/clearpad/cover_win_top

    # Touchscreen
    chown system radio /sys/devices/virtual/input/clearpad/wakeup_gesture
    chmod 0660 /sys/devices/virtual/input/clearpad/wakeup_gesture
    chown system system /sys/devices/virtual/input/clearpad/glove
    chmod 0660 /sys/devices/virtual/input/clearpad/glove

Giulio Cervera's avatar
Giulio Cervera committed
408
409
410
411
412
413
    # Touchscreen Tab
    chown system radio /sys/devices/virtual/input/maxim_sti/gesture_wakeup
    chmod 0660 /sys/devices/virtual/input/maxim_sti/gesture_wakeup
    chown system system /sys/devices/virtual/input/maxim_sti/glove_en
    chmod 0660 /sys/devices/virtual/input/maxim_sti/glove_en

Chirayu Desai's avatar
Chirayu Desai committed
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
    #Create the symlink to qcn wpa_supplicant folder for ar6000 wpa_supplicant
    mkdir /data/system 0775 system system
    #symlink /data/misc/wifi/wpa_supplicant /data/system/wpa_supplicant

    #Create directories for Location services
    mkdir /data/misc/location 0770 gps gps
    mkdir /data/misc/location/mq 0770 gps gps
    mkdir /data/misc/location/xtwifi 0770 gps gps
    mkdir /data/misc/location/gpsone_d 0770 system gps
    mkdir /data/misc/location/quipc 0770 gps system
    mkdir /data/misc/location/gsiff 0770 gps gps

    #Create directory from IMS services
    mkdir /data/shared 0755
    chown system system /data/shared

    #Create directory for FOTA
    mkdir /data/fota 0771
    chown system system /data/fota

    #Create directory for hostapd
    mkdir /data/hostapd 0770 system wifi

    mkdir /data/audio/ 0770 media audio

    # Create a folder for audio delta files
    mkdir /data/audio/acdbdata 0770 media audio
    mkdir /data/audio/acdbdata/delta 0770 media audio

    #Create a folder for SRS to be able to create a usercfg file
    mkdir /data/data/media 0770 media media

    #Create PERFD deamon related dirs
    mkdir /data/misc/perfd 0755 root system
    chmod 2755 /data/misc/perfd
    mkdir /data/system/perfd 0770 root system
    chmod 2770 /data/system/perfd
451
452
    rm /data/system/perfd/default_values
    start perfd
Chirayu Desai's avatar
Chirayu Desai committed
453

454
455
456
457
458
459
460
    # SONY: Camera
    mkdir /data/camera 0770 media camera
    chown media camera /sys/devices/sony_camera_0/info
    chmod 0770 /sys/devices/sony_camera_0/info
    chown media camera /sys/devices/sony_camera_1/info
    chmod 0770 /sys/devices/sony_camera_1/info

Chirayu Desai's avatar
Chirayu Desai committed
461
462
    chown system /dev/block/bootdevice/by-name

andralex8's avatar
andralex8 committed
463
464
465
466
467
468
    # OTG switch
    chown system system /sys/module/qpnp_smbcharger_extension/parameters/start_id_polling
    chown system system /sys/module/qpnp_smbcharger_extension/parameters/force_id_polling_on
    chown system system /sys/module/qpnp_smbcharger_extension/parameters/id_polling_timeout
    chown system system /sys/module/qpnp_smbcharger_extension/parameters/id_polling_state

469
470
471
    # Wifi firmware reload path
    chown wifi wifi /sys/module/bcmdhd/parameters/firmware_path

Chirayu Desai's avatar
Chirayu Desai committed
472
473
474
475
476
477
478
479
480
481
482
    setprop vold.post_fs_data_done 1

on property:init.svc.wpa_supplicant=stopped
    stop dhcpcd

service irsc_util /system/bin/irsc_util "/etc/sec_config"
    class main
    user root
    oneshot

service sensors /system/bin/sensors.qcom
Quarx2k's avatar
Quarx2k committed
483
    class main
Chirayu Desai's avatar
Chirayu Desai committed
484
    user root
Quarx2k's avatar
Quarx2k committed
485
    group radio system
Chirayu Desai's avatar
Chirayu Desai committed
486
487
488
489
490
491
492
493
494

# Adjust socket buffer to enlarge TCP receive window for high bandwidth
# but only if ro.data.large_tcp_window_size property is set.
on property:ro.data.large_tcp_window_size=true
    write /proc/sys/net/ipv4/tcp_adv_win_scale  2

on property:sys.sysctl.tcp_adv_win_scale=*
    write /proc/sys/net/ipv4/tcp_adv_win_scale ${sys.sysctl.tcp_adv_win_scale}

495
496
497
498
499
500
service wpa_supplicant /vendor/bin/hw/wpa_supplicant \
    -O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface \
    -g@android:wpa_wlan0
    interface android.hardware.wifi.supplicant@1.0::ISupplicant default
    interface android.hardware.wifi.supplicant@1.1::ISupplicant default
    interface android.hardware.wifi.supplicant@1.2::ISupplicant default
Chirayu Desai's avatar
Chirayu Desai committed
501
502
503
504
505
506
507
508
509
510
511
512
513
514
    class main
    socket wpa_wlan0 dgram 660 wifi wifi
    disabled
    oneshot

service loc_launcher /system/bin/loc_launcher
    #loc_launcher will start as root and set its uid to gps
    class late_start
    group gps inet net_raw diag net_admin wifi

on property:ro.data.large_tcp_window_size=true
    # Adjust socket buffer to enlarge TCP receive window for high bandwidth (e.g. DO-RevB)
    write /proc/sys/net/ipv4/tcp_adv_win_scale  2

515
516
on property:dev.bootcomplete=1
    swapon_all fstab.qcom
517

Chirayu Desai's avatar
Chirayu Desai committed
518
519
520
521
522
523
524
service msm_irqbalance /system/bin/msm_irqbalance -f /system/vendor/etc/msm_irqbalance.conf
    socket msm_irqbalance seqpacket 660 root system
    class main
    user root
    group root
    writepid /dev/cpuset/system-background/tasks

525
526
527
528
529
530
service qcamerasvr /system/bin/mm-qcamera-daemon
    class late_start
    user camera
    group camera system inet input graphics
    writepid /dev/cpuset/camera-daemon/tasks

Chirayu Desai's avatar
Chirayu Desai committed
531
532
533
534
535
536
service qseecomd /system/bin/qseecomd
    class core
    user root
    group root
    writepid /dev/cpuset/system-background/tasks

537
538
539
540
on property:sys.listeners.registered=*
    setprop sys.keymaster.loaded ${vendor.sys.listeners.registered}
    setprop vendor.sys.keymaster.loaded ${vendor.sys.listeners.registered}

541
service perfd /vendor/bin/perfd
Chirayu Desai's avatar
Chirayu Desai committed
542
543
    class main
    user root
544
    group system
Chirayu Desai's avatar
Chirayu Desai committed
545
    disabled
546
    socket perfd seqpacket 0666 root system
Chirayu Desai's avatar
Chirayu Desai committed
547
548
    writepid /dev/cpuset/system-background/tasks

549
550
551
552
553
554
555
service thermal-engine /system/vendor/bin/thermal-engine
   class main
   user root
   group root
   socket thermal-send-client stream 0666 system system
   socket thermal-recv-client stream 0660 system system
   socket thermal-recv-passive-client stream 0666 system system
Chirayu Desai's avatar
Chirayu Desai committed
556
557
558
559
560
561
562

service adsprpcd /system/bin/adsprpcd
   class main
   user media 
   group media drmrpc

# SONY misc
563
service tad /system/bin/tad_static /dev/block/bootdevice/by-name/TA 0,16
Chirayu Desai's avatar
Chirayu Desai committed
564
    class core
565
566
    user oem_2997
    group oem_2997 root
Quarx2k's avatar
Quarx2k committed
567
    socket tad stream 0660 system oem_2993
Chirayu Desai's avatar
Chirayu Desai committed
568
569
570
571
572
573
    writepid /dev/cpuset/system-background/tasks

# SONY misc
service ta_qmi_service /system/bin/ta_qmi_service
    class main
    user root
Quarx2k's avatar
Quarx2k committed
574
    group wakelock
Chirayu Desai's avatar
Chirayu Desai committed
575
576
577
578
579
    writepid /dev/cpuset/system-background/tasks

# SONY prop
service sct_service /system/bin/sct_service
    class main
580
    user root
Chirayu Desai's avatar
Chirayu Desai committed
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
    writepid /dev/cpuset/system-background/tasks

# SONY prop
service mlog_qmi_service /system/bin/mlog_qmi_service
    class main
    user root
    group system wakelock drmrpc
    writepid /dev/cpuset/system-background/tasks

# QCOM prop
service rmt_storage /system/bin/rmt_storage
    class core
    user root
    group system wakelock drmrpc
    writepid /dev/cpuset/system-background/tasks
596
    shutdown critical
Chirayu Desai's avatar
Chirayu Desai committed
597
598

# DSDS second ril
599
service ril-daemon2 /vendor/bin/hw/rild -c 2
Chirayu Desai's avatar
Chirayu Desai committed
600
601
    class main
    socket rild2 stream 660 root radio
Quarx2k's avatar
Quarx2k committed
602
    socket sap_uim_socket2 stream 660 bluetooth bluetooth
Chirayu Desai's avatar
Chirayu Desai committed
603
604
    socket rild-debug2 stream 660 radio system
    user root
605
    group radio cache inet misc audio log readproc wakelock oem_2993
Chirayu Desai's avatar
Chirayu Desai committed
606
607
    disabled

Quarx2k's avatar
Quarx2k committed
608
609
610
611
612
613
614
615
service ril-daemon /vendor/bin/hw/rild
    class main
    socket rild stream 660 root radio
    socket sap_uim_socket1 stream 660 bluetooth bluetooth
    socket rild-debug stream 660 radio system
    user root
    group radio cache inet misc audio log readproc wakelock oem_2950 oem_2993

Chirayu Desai's avatar
Chirayu Desai committed
616
617
618
619
# QCOM prop
service qmuxd /system/bin/qmuxd
    class main
    user radio
Quarx2k's avatar
Quarx2k committed
620
    group radio audio bluetooth gps diag drmrpc oem_2950
Chirayu Desai's avatar
Chirayu Desai committed
621
622
623
624
625
    writepid /dev/cpuset/system-background/tasks

# QCOM prop
service netmgrd /system/bin/netmgrd
    class main
Quarx2k's avatar
Quarx2k committed
626
    group root wifi wakelock radio inet oem_2950
Chirayu Desai's avatar
Chirayu Desai committed
627
628
629
630
631
632
633
634
635
636
    writepid /dev/cpuset/system-background/tasks

service taimport /system/bin/taimport
    class late_start
    user root
    group system drmrpc
    oneshot

service updatemiscta /system/bin/updatemiscta
    class main
637
638
    user oem_2991
    group oem_2993
Chirayu Desai's avatar
Chirayu Desai committed
639
640
    oneshot

641
service charger /system/bin/charger
Chirayu Desai's avatar
Chirayu Desai committed
642
    class charger
643
    group log system graphics
644
    capabilities SYS_BOOT
645
    seclabel u:r:charger:s0
Chirayu Desai's avatar
Chirayu Desai committed
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663

service per_mgr /system/bin/pm-service
    class core
    user system
    group system net_raw

service per_proxy /system/bin/pm-proxy
    class core
    user system
    group system net_raw
    disabled

on property:init.svc.per_mgr=running
    start per_proxy

on property:sys.shutdown.requested=*
    stop per_proxy

664
665
666
667
668
service ppd /system/vendor/bin/mm-pp-daemon
    class hal
    user system
    socket pps stream 0660 system system
    group system graphics
669
    writepid /dev/cpuset/system-background/tasks
670

Chirayu Desai's avatar
Chirayu Desai committed
671
# brcm-uim-sysfs (BT/FM/ANT+)
672
673
674
675
676
#service uim /system/vendor/bin/brcm-uim-sysfs
#    class late_start
#    user root
#    group bluetooth net_bt_admin net_bt
#    writepid /dev/cpuset/system-background/tasks
Chirayu Desai's avatar
Chirayu Desai committed
677
678
679
680
681
682
683
684
685
686

on property:persist.radio.multisim.config=dsds
    enable ril-daemon2

on property:init.svc.fuse_sdcard1=running
    write /sys/class/block/mmcblk1/queue/scheduler cfq
    write /sys/class/block/mmcblk1/bdi/max_ratio 1

service secd /system/bin/secd
    class main
Giulio Cervera's avatar
Giulio Cervera committed
687
688
    user system
    group system
689
690
691
    socket secd_ebl_sock stream 0660 system oem_2996
    socket secd_devsec_sock stream 0660 system oem_2996
    socket secd_credmgr_sock stream 0660 system oem_2996
Chirayu Desai's avatar
Chirayu Desai committed
692

Quarx2k's avatar
Quarx2k committed
693
694
695
696
service iddd /system/bin/iddd
    class core
    user oem_2987
    group oem_2987 log inet oem_2993
697
    disabled
andralex8's avatar
andralex8 committed
698
699
700
701
702
703
704

on property:service.usb.otg.switch=check
    write /sys/module/qpnp_smbcharger_extension/parameters/start_id_polling 1
    setprop service.usb.otg_switch check_done

on property:service.usb.otg.switch.timeout=*
    write /sys/module/qpnp_smbcharger_extension/parameters/id_polling_timeout ${service.usb.otg.switch.timeout}
HaoZeke's avatar
HaoZeke committed
705

706
707
on property:apexd.status=ready
    mount none /system/etc/swcodec/ld.config.txt /apex/com.android.media.swcodec/etc/ld.config.txt bind