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
|
import init.semc.usb.rc
on early-init
export EXTERNAL_STORAGE /storage/sdcard0
mkdir /storage 0050 system sdcard_r
mkdir /storage/sdcard0 0000 system system
# for backwards compatibility
symlink /storage/sdcard0 /sdcard
symlink /storage/sdcard0 /mnt/sdcard
on fs
mount_all /fstab.lt26
setprop ro.crypto.state unsupported
setprop ro.emmc 1
# SEMC, TA Daemon
class_start trimarea
exec /system/bin/wait4tad
on post-fs
mkdir /system/etc/firmware/misc 0771 system system
mkdir /data/tombstones 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
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
# set RLIMIT_MEMLOCK to 64MB
setrlimit 8 67108864 67108864
# 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
# 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
# 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
# USB Host support
mkdir /dev/bus 0711 system system
mkdir /dev/bus/usb 0711 system system
setprop ro.wifi.wps_enable true
write /proc/sys/kernel/sysrq 0
write /proc/sys/kernel/watchdog_thresh 5
exec /system/bin/cal_data_manager
# Enable Wifi EAP SIM
setprop ro.wifi.eap_sim_enabled true
chown system system /sys/module/sco/parameters/disable_esco
chmod 0660 /sys/devices/platform/msm_serial_hs.0/clock
#Set SUID bit for diag_mdlog
chmod 4755 /system/bin/diag_mdlog
# LM35xx/cameralight
chown system camera /sys/devices/i2c-3/3-0053/torch_enable
chown system camera /sys/devices/i2c-3/3-0053/torch_current
chown system camera /sys/devices/i2c-3/3-0053/privacy_enable
chown system camera /sys/devices/i2c-3/3-0053/privacy_current
chown system camera /sys/devices/i2c-3/3-0053/flash_enable
chown system camera /sys/devices/i2c-3/3-0053/flash_duration
chown system camera /sys/devices/i2c-3/3-0053/flash_synchronization
chown system camera /sys/devices/i2c-3/3-0053/flash_current
chown system camera /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
# 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
mount debugfs /sys/kernel/debug /sys/kernel/debug
insmod /system/lib/modules/bcmdhd.ko nvram_path=/system/etc/wifi/calibration iface_name=wlan0
on init
# create mountpoint
mkdir /storage/usbdisk 0000 system system
# Create symlink
symlink /storage/usbdisk /usbdisk
symlink /storage/usbdisk /mnt/usbdisk
# setup the global environment
export SECONDARY_STORAGE /storage/usbdisk
on post-fs-data
mkdir /data/misc/wifi 0770 wifi wifi
mkdir /data/misc/wifi/sockets 0770 wifi wifi
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
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
# Start suntrold
service suntrold /system/bin/suntrold
class main
user system
group system
oneshot
service secchan /system/bin/secchand
class main
user system
group system
service time_daemon /system/bin/time_daemon
class main
user root
group root
oneshot
disabled
on property:persist.timed.enable=true
mkdir /data/time/ 0700 system system
start time_daemon
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
class main
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service updatemiscta /system/bin/updatemiscta
class core
user root
disabled
oneshot
service rmt_storage /system/bin/rmt_storage
class main
user root
# SEMC, TA rmt service
service ta_rmt_service /system/bin/ta_rmt_service
class main
user root
# Copy calibration data from NV to kernel drivers
service nvimport /system/bin/nvimport
class main
user root
oneshot
service p2p_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -N \
-ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf -e/data/misc/wifi/entropy.bin -puse_p2p_group_interface=1
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service wpa_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service dhcpcd_wlan0 /system/bin/dhcpcd -aABKL
class main
disabled
oneshot
service dhcpcd_p2p /system/bin/dhcpcd -aABKL
class main
disabled
oneshot
service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL
class main
disabled
oneshot
service iprenew_wlan0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service iprenew_p2p /system/bin/dhcpcd -n
class main
disabled
oneshot
service iprenew_bnep0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service qmuxd /system/bin/qmuxd
class late_start
user radio
group radio audio bluetooth gps
service netmgrd /system/bin/netmgrd
class late_start
# SEMC, TA Daemon
service tad /system/bin/tad /dev/block/mmcblk0p1 0,16,256
class trimarea
user root
group root
socket tad stream 0660 system system
service hw_config /system/bin/sh /system/etc/hw_config.sh
class main
user root
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
class main
user root
disabled
service thermald /system/bin/thermald -c /system/etc/thermald-lt26.conf
class main
socket thermald stream 0666 root root
user root
disabled
on property:init.svc.bootanim=stopped
start mpdecision
start thermald
service nvcustomizer /system/bin/nvcustomizer
class late_start
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 late_start
socket hdmid stream 0660 root system graphics
disabled
on property:ro.hdmi.enable=true
start hdmid
on property:sys.radio.shutdown=true
exec /system/bin/sh /system/etc/init.qcom.efs.sync.sh
|