/
init.semc.rc
executable file
·598 lines (470 loc) · 18.7 KB
/
init.semc.rc
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
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
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
## Disabled by CBUT - it doesn't work with Fuji
##on init
## # start master reset
## exec /sbin/mr
## # Check if flash was aborted
## exec /sbin/checkabortedflash
on early-fs
# Do some post work for dump before used
# by the system.
# exec /sbin/grabramdump
on post-fs
mkdir /data/tombstones 0755 system system
mkdir /data/crashsms 0711 system system
mkdir /data/crashsms/crashes 0755 system system
mkdir /data/mediaserver 0740 media media
# Change to socket location on libkeyctrl/suntory for /data encryption
mkdir /dev/socket/suntory 0755 system system
on early-boot
# Start the offline charging (This blocks booting further in some cases)
exec /system/bin/chargemon
# Make sure the crashsms/crashes are writable by crashmonitor
service updatemiscta /system/bin/updatemiscta
class main
user root
oneshot
service iddd /system/bin/iddd
class main
user idd
group idd log
# Set the startup flag to boot complete, run on property change
service setssflagbc /system/bin/startupflag bootcomplete
user root
oneshot
disabled
# AT+CTSA and AT+CKPD support
service semc-atfwd-d /system/bin/semc-atfwd-d
user root
oneshot
disabled
class main
service fota-snoop /system/bin/fota-snoop
group cache
oneshot
disabled
on property:dev.bootcomplete=1
start setssflagbc
start semc-atfwd-d
start fota-snoop
# Ramdumper post processing
exec /sbin/grabramdump
# Start suntrold
service suntrold /system/bin/suntrold
class main
user system
group system
oneshot
on property:persist.sys.kernel.log=logcat
start klogrouterd
on property:persist.sys.kernel.log=default
stop klogrouterd
service klogrouterd /system/bin/klogrouter logcat
oneshot
disabled
# Fast Dormancy
service fast-dormancy /system/bin/fast-dormancy
class main
on property:ro.semc.enable.fast_dormancy=false
stop fast-dormancy
on boot
# Optimized browser caching and connection handling
setprop net.http.idle_cache.size 40
setprop net.http.threads 10
setprop net.webkit.cache.size 12582912
setprop net.nw.cache.prioadvstep 86400000
setprop net.nw.cache.weightadvstep 3600000
setprop net.nw.cache.orderby weight
setprop net.http.idle_cache.shutdown true
setprop net.webkit.cache.mindeadsize 4194304
setprop net.webkit.cache.maxdeadsize 4194304
service secchan /system/bin/secchand
class main
user system
group system
on init
write /sys/class/android_usb/android0/iSerial $ro.serialno
write /sys/class/android_usb/android0/f_rndis/manufacturer $ro.product.manufacturer
write /sys/class/android_usb/android0/f_rndis/vendorID 0fce
write /sys/class/android_usb/android0/f_rndis/wceis 1
# setup the global environment
export EXTERNAL_STORAGE /mnt/sdcard
export EXTERNAL_STORAGE_USB /mnt/usbdisk
# create mountpoint
mkdir /mnt/usbdisk 0000 system system
# Create symlink
symlink /mnt/sdcard /sdcard
symlink /mnt/usbdisk /usbdisk
on post-fs
# Run pre_hw_config.sh before entering Charge only mode.
exec /system/bin/sh /system/etc/pre_hw_config.sh
on post-fs-data
# Clear dalvik cache
exec /init.clrdex.sh
chown system system /sys/devices/platform/msm_hsusb/gadget/lun1/file
chmod 0660 /sys/devices/platform/msm_hsusb/gadget/lun1/file
write /sys/class/android_usb/f_mass_storage/inquiry_string "SONY Mass Storage 0100"
write /sys/class/android_usb/f_cdrom/cdrom_inquiry_string "SONY CD-ROM 0100"
write /sys/class/android_usb/f_mass_storage/serial_number $ro.serialno
write /sys/class/android_usb/f_mass_storage/eui64_id 000AD90000000000
write /sys/devices/platform/msm_hsusb/gadget/lun0/nofua 1
write /sys/devices/platform/msm_hsusb/gadget/lun1/nofua 1
setprop vold.post_fs_data_done 1
on early-boot
# set RLIMIT_MEMLOCK to 64MB
setrlimit 8 67108864 67108864
# Touch firmware update
exec /system/bin/sh /system/etc/clearpad_fwloader.sh
# Remove write permissions to video related nodes
chmod 0660 /sys/devices/virtual/graphics/fb1/video_mode
chmod 0440 /sys/devices/virtual/graphics/fb1/video_mode_str
chmod 0440 /sys/devices/virtual/graphics/fb1/connected
chmod 0440 /sys/devices/virtual/graphics/fb1/edid_modes
chmod 0440 /sys/devices/virtual/graphics/fb1/hdcp
chmod 0660 /sys/devices/virtual/graphics/fb1/hpd
chmod 0440 /sys/devices/virtual/graphics/fb1/3d_present
chmod 0440 /sys/devices/virtual/graphics/fb1/hdcp_present
chmod 0660 /sys/devices/virtual/graphics/fb1/format_3d
chmod 0660 /sys/devices/virtual/graphics/fb1/edid_3d_modes
chmod 0440 /sys/devices/virtual/graphics/fb1/underscan
chmod 0440 /sys/devices/virtual/graphics/fb1/dvi
chmod 0440 /sys/devices/virtual/graphics/fb1/pa
chmod 0660 /sys/devices/virtual/graphics/fb1/cec
chmod 0660 /sys/devices/virtual/graphics/fb1/cec_logical_addr
chmod 0660 /sys/devices/virtual/graphics/fb1/cec_wr_frame
chmod 0660 /sys/devices/virtual/graphics/fb1/product_description
chmod 0660 /sys/devices/virtual/graphics/fb1/vendor_name
# Change owner and group for system server and surface flinger
chown system graphics /sys/devices/virtual/graphics/fb1/video_mode
chown system graphics /sys/devices/virtual/graphics/fb1/video_mode_str
chown system graphics /sys/devices/virtual/graphics/fb1/connected
chown system graphics /sys/devices/virtual/graphics/fb1/edid_modes
chown system graphics /sys/devices/virtual/graphics/fb1/hdcp
chown system graphics /sys/devices/virtual/graphics/fb1/hpd
chown system graphics /sys/devices/virtual/graphics/fb1/3d_present
chown system graphics /sys/devices/virtual/graphics/fb1/hdcp_present
chown system graphics /sys/devices/virtual/graphics/fb1/format_3d
chown system graphics /sys/devices/virtual/graphics/fb1/edid_3d_modes
chown system graphics /sys/devices/virtual/graphics/fb1/underscan
chown system graphics /sys/devices/virtual/graphics/fb1/dvi
chown system graphics /sys/devices/virtual/graphics/fb1/pa
chown system graphics /sys/devices/virtual/graphics/fb1/cec
chown system graphics /sys/devices/virtual/graphics/fb1/cec_logical_addr
chown system graphics /sys/devices/virtual/graphics/fb1/cec_wr_frame
chown system graphics /sys/devices/virtual/graphics/fb1/product_description
chown system graphics /sys/devices/virtual/graphics/fb1/vendor_name
# Configurate TCP/IP kernel settings
exec /system/bin/sh /system/etc/init.netconfig.sh
on boot
exec /system/bin/usbeng
# Disable C_A_D
exec system/bin/ctrlaltdel soft
# USB Host support
mkdir /dev/bus 0711 system system
mkdir /dev/bus/usb 0711 system system
write /sys/class/android_usb/android0/iManufacturer $ro.product.manufacturer
write /sys/class/android_usb/android0/iProduct $ro.product.model
setprop ro.wifi.wps_enable true
# To use non-Google assistance server
setprop ro.gps.agps_provider customized
write /proc/sys/kernel/sysrq 0
write /proc/sys/kernel/watchdog_thresh 5
exec /system/bin/cal_data_manager
service illumination /system/bin/illumination_service
class main
user root
group system
service time_daemon /system/bin/time_daemon
user root
group root
oneshot
disabled
on property:persist.timed.enable=true
mkdir /data/time/ 0700 system system
start time_daemon
on property:sys.usb.config=mass_storage
exec /init.usbmode.sh
stop adbd
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=mass_storage,adb
exec /init.usbmode.sh
start adbd
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=mtp
exec /init.usbmode.sh
stop adbd
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=mtp,adb
exec /init.usbmode.sh
start adbd
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=mtp,cdrom
exec /init.usbmode.sh
stop adbd
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=mtp,cdrom,adb
exec /init.usbmode.sh
stop adbd
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=rndis
exec /init.usbmode.sh
stop adbd
setprop sys.usb.state $sys.usb.config
on property:sys.usb.config=rndis,adb
exec /init.usbmode.sh
start adbd
setprop sys.usb.state $sys.usb.config
on fs
# mount mmc partitions
# mount /system, set up links to the modem, and remount r/o
wait /dev/block/mmcblk0p12
mount ext4 /dev/block/mmcblk0p12 /system rw barrier=1
mkdir /system/etc/firmware/misc 0771 system system
mount ext4 /dev/block/mmcblk0p12 /system remount ro barrier=1
# mount other partitions
wait /dev/block/mmcblk0p14
exec /system/bin/e2fsck -p /dev/block/mmcblk0p14
setprop ro.crypto.state unsupported
mount ext4 /dev/block/mmcblk0p14 /data nosuid nodev noatime barrier=1 noauto_da_alloc
mount ext4 /dev/block/mmcblk0p13 /cache nosuid nodev noatime barrier=1
# FOTA must be started after partitions are mounted
# and property service is initialized
exec /sbin/fota-ua c
setprop ro.emmc 1
# SEMC, TA Daemon
class_start trimarea
exec /system/bin/wait4tad
exec /sbin/mr
exec /sbin/checkabortedflash
on post-fs
chmod 0664 /sys/devices/platform/msm_sdcc.1/polling
chmod 0664 /sys/devices/platform/msm_sdcc.3/polling
chmod 0664 /sys/devices/platform/msm_sdcc.4/polling
mkdir /data/radio 0770 radio radio
mkdir /data/idd 0755 idd idd
mount ext4 /dev/block/mmcblk0p10 /data/idd nosuid nodev noatime barrier=0
chown idd idd /data/idd
chmod 0755 /data/idd
# Camera
mkdir /data/camera 0771 root camera
#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
on early-boot
# Touch firmware update
exec /system/bin/sh /system/etc/clearpad_fwloader.sh
# Permissions for AKM897x sensor
chown system system /data/misc/akm_set.txt
chown system system /sys/class/compass/akm8972/interval
chown system system /sys/class/compass/akm8972/single
chown system system /sys/class/compass/akm8972/registers
chown system system /sys/class/compass/akm8975/interval
chown system system /sys/class/compass/akm8975/single
chown system system /sys/class/compass/akm8975/registers
on boot
chown system system /sys/module/sco/parameters/disable_esco
chmod 0660 /sys/devices/platform/msm_serial_hs.0/clock
mkdir /data/misc/wifi 0770 wifi wifi
mkdir /data/misc/wifi/sockets 0771 wifi wifi
chmod 0660 /data/misc/wifi/wpa_supplicant.conf
mkdir /data/misc/dhcp 0770 dhcp system
#Set SUID bit for diag_mdlog
chmod 4755 /system/bin/diag_mdlog
# LM35xx/cameralight
chown system system /sys/devices/i2c-3/3-0053/torch_enable
chown system system /sys/devices/i2c-3/3-0053/torch_current
chown system system /sys/devices/i2c-3/3-0053/privacy_enable
chown system system /sys/devices/i2c-3/3-0053/privacy_current
chown system system /sys/devices/i2c-3/3-0053/flash_enable
chown system system /sys/devices/i2c-3/3-0053/flash_duration
chown system system /sys/devices/i2c-3/3-0053/flash_synchronization
chown system system /sys/devices/i2c-3/3-0053/flash_current
chown system system /sys/devices/i2c-3/3-0053/status
# Owner for the proximity sensor
chown system system /sys/devices/i2c-3/3-0054/threshold
chown system system /sys/devices/i2c-3/3-0054/nburst
# Default tcp buffersizes for hsdpa
setprop net.tcp.buffersize.hsdpa 4094,87380,1220608,4096,16384,1220608
setprop net.tcp.buffersize.hspa 4094,87380,1220608,4096,16384,1220608
# Permissions for Liblights.
chown system system /sys/class/leds/green/brightness
chown system system /sys/class/leds/green/trigger
chown system system /sys/class/leds/red/brightness
chown system system /sys/class/leds/red/trigger
chown system system /sys/class/leds/blue/brightness
chown system system /sys/class/leds/blue/trigger
chown system system /sys/class/leds/button-backlight/brightness
chown system system /sys/class/leds/button-backlight/trigger
chown system system /sys/class/leds/lcd-backlight/brightness
chown system system /sys/class/leds/lcd-backlight/als/curve
chown system system /sys/class/leds/keyboard-backlight/brightness
chown system system /sys/devices/i2c-3/3-0040/adc_als_value
# bluetooth power up/down interface
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/state
# bluetooth address programming
setprop ro.bt.bdaddr_path data/etc/bluetooth_bdaddr
# power-management
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ondemand
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor ondemand
write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 50000
write /sys/devices/system/cpu/cpufreq/ondemand/up_threshold 90
write /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy 1
write /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor 4
write /sys/devices/system/cpu/cpufreq/ondemand/down_differential 10
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 384000
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 384000
write /sys/module/rpm_resources/enable_low_power/L2_cache 1
write /sys/module/rpm_resources/enable_low_power/pxo 1
write /sys/module/rpm_resources/enable_low_power/vdd_dig 2
write /sys/module/rpm_resources/enable_low_power/vdd_mem 2
write /sys/module/rpm_resources/enable_low_power/rpm_cpu 1
write /sys/module/pm_8x60/modes/cpu0/power_collapse/suspend_enabled 1
write /sys/module/pm_8x60/modes/cpu1/power_collapse/suspend_enabled 1
write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/suspend_enabled 1
write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/suspend_enabled 1
write /sys/module/pm_8x60/modes/cpu0/power_collapse/idle_enabled 1
write /sys/module/pm_8x60/modes/cpu1/power_collapse/idle_enabled 1
write /sys/module/pm_8x60/modes/cpu0/standalone_power_collapse/idle_enabled 1
write /sys/module/pm_8x60/modes/cpu1/standalone_power_collapse/idle_enabled 1
chown root.system /sys/devices/system/cpu/mfreq
chmod 220 /sys/devices/system/cpu/mfreq
chown root.system /sys/devices/system/cpu/cpu1/online
chmod 664 /sys/devices/system/cpu/cpu1/online
# Create the directories and files expected by the lcatp service
# only found in eng builds.
# Preferably the ONLY_IN_VARIANT macro should be used but
# seems like the build system does not parse this file properly.
mkdir /data/misc/tsce 0770 system system
write /data/misc/tsce/userfile.txt 0
write /data/misc/tsce/userfile2.txt 0
write /data/misc/tsce/logfile.txt 0
chown system system /data/misc/tsce/userfile.txt
chown system system /data/misc/tsce/userfile2.txt
chown system system /data/misc/tsce/logfile.txt
chmod 0660 /data/misc/tsce/userfile.txt
chmod 0660 /data/misc/tsce/userfile2.txt
chmod 0660 /data/misc/tsce/logfile.txt
insmod /res/bcm4330.ko nvram_path=/system/etc/wifi/calibration iface_name=wlan0
service btld /system/bin/btld -lpm 1
user root
group bluetooth net_bt_admin
disabled
oneshot
service hciattach /system/bin/brcm_patchram_plus --enable_hci --enable_lpm \
--use_baudrate_for_download --tosleep 20000 --scopcm 0,4,0,0,0,0,0,0,3,0 \
--no2bytes --baudrate 3000000 --patchram /system/etc/firmware/BCM4330.hcd \
/dev/ttyHS0
user bluetooth
group bluetooth net_bt_admin
disabled
class main
service cnd /system/bin/cnd
class main
socket cnd stream 660 root radio
service rmt_storage /system/bin/rmt_storage
user root
disabled
service updatemiscta /system/bin/updatemiscta
user root
disabled
oneshot
# SEMC, TA rmt service
service ta_rmt_service /system/bin/ta_rmt_service
user root
disabled
on property:ro.emmc=1
start updatemiscta
start rmt_storage
start ta_rmt_service
# Copy calibration data from NV to kernel drivers
service nvimport /system/bin/nvimport
class main
user root
oneshot
service wpa_supplicant /system/bin/wpa_supplicant -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service dhcpcd_wlan0 /system/bin/dhcpcd -B -t 30
disabled
oneshot
service iprenew_wlan0 /system/bin/dhcpcd -n
disabled
oneshot
service dhcpcd_p2p /system/bin/dhcpcd -BKLG
disabled
oneshot
service iprenew_p2p /system/bin/dhcpcd -n
disabled
oneshot
service dhcpcd_bnep0 /system/bin/dhcpcd -B -t 30
disabled
oneshot
service iprenew_bnep0 /system/bin/dhcpcd -n
disabled
oneshot
service qmuxd /system/bin/qmuxd
class main
service netmgrd /system/bin/netmgrd
class main
# SEMC, TA Daemon
service tad /system/bin/tad /dev/block/mmcblk0p1 0,16,256
user root
group root
socket tad stream 0660 system system
class trimarea
service hw_config /system/bin/sh /system/etc/hw_config.sh
class main
user root
oneshot
# Local Connectivity service only present in engineer builds
# Preferably the ONLY_IN_VARIANT macro should be used but
# seems like the build system does not parse this file properly.
service lcatp /system/bin/lcatp
disabled
oneshot
on property:ro.use_data_netmgrd=false
# netmgr not supported on specific target
stop netmgrd
service mpdecision /system/bin/mpdecision --no_sleep --avg_comp
user root
disabled
service thermald /system/bin/thermald -c /system/etc/thermald-semc.conf
socket thermald stream 0666 root root
user root
disabled
on property:init.svc.bootanim=stopped
start mpdecision
start thermald
service media /system/bin/mediaserver
class main
user media
group system audio camera graphics inet net_bt net_bt_admin net_raw radio
ioprio rt 4
service nvcustomizer /system/bin/nvcustomizer
user root
oneshot
disabled
on property:ro.nvcust=1
start nvcustomizer
on property:vold.decrypt=trigger_post_fs_data
mkdir /data/idd 0755 idd idd
mount ext4 /dev/block/mmcblk0p10 /data/idd nosuid nodev noatime barrier=0
chown idd idd /data/idd
service hdmid /system/bin/hdmid
class main
user system
group system inet graphics
on init
# create mountpoint
mkdir /mnt/sdcard 0000 system system
# setup the global environment
export SECONDARY_STORAGE /mnt/usbdisk
on boot
# Enable Wifi EAP SIM
setprop ro.wifi.eap_sim_enabled true