-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.n1.rc
executable file
·504 lines (429 loc) · 18.1 KB
/
init.n1.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
on early-init
mount debugfs debugfs /sys/kernel/debug
write /sys/class/firmware/timeout 5
mkdir /efs 0771 system system
write /sys/block/mmcblk0/queue/iosched/slice_idle 0
# ko files for bthid
insmod /lib/modules/bthid.ko
on fs
mount ext4 /dev/block/mmcblk0p2 /system wait rw
exec check_filesystem /dev/block/mmcblk0p1 ext4
mount ext4 /dev/block/mmcblk0p1 /efs nosuid nodev noatime wait journal_checksum
chown system radio /efs
chmod 0775 /efs
chmod 0775 /efs/bluetooth
# SEC_DMCRYPT efs or cache or lfs partition required
exec apply_sec_devenc_init
# SEC_DMCRYPT mount with crypt option
exec check_filesystem /dev/block/mmcblk0p6 ext4
mount ext4 /dev/block/mmcblk0p6 /data nosuid nodev noatime wait crypt discard,noauto_da_alloc,journal_checksum
mount ext4 /dev/block/mmcblk0p3 /cache nosuid nodev noatime wait
#add booting sound property
setprop audioflinger.bootsnd 1
# create fota delta dir
mkdir /data/fota 0777 root root
chmod 1777 /data/fota
on boot
mkdir /data/misc/wifi 0770 wifi system
mkdir /data/misc/wifi/sockets 0770 wifi wifi
mkdir /data/misc/radio 0775 radio radio
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
mkdir /data/wifi 0770 wifi wifi
# create data/gps for GPS demon
# UART device
chmod 0660 /dev/ttyHS0
chown root system /dev/ttyHS0
mkdir /data/gps 0771 system system
chown system system /data/gps
chown root system /sys/class/sec/gps/GPS_PWR_EN/value
chmod 0664 /sys/class/sec/gps/GPS_PWR_EN/value
chown root system /sys/class/sec/gps/GPS_nRST/value
chmod 0664 /sys/class/sec/gps/GPS_nRST/value
# battery sysfile
chown radio radio /sys/class/power_supply/battery/batt_vol
chown radio radio /sys/class/power_supply/battery/batt_vol_adc
chown radio radio /sys/class/power_supply/battery/batt_vol_adc_cal
chown radio radio /sys/class/power_supply/battery/batt_vol_adc_aver
chown radio radio /sys/class/power_supply/battery/batt_vol_aver
chown radio radio /sys/class/power_supply/battery/batt_temp
chown radio radio /sys/class/power_supply/battery/batt_temp_adc
chown radio radio /sys/class/power_supply/battery/batt_temp_adc_cal
chown radio radio /sys/class/power_supply/battery/batt_temp_adc_aver
chown radio radio /sys/class/power_supply/battery/batt_temp_aver
chown radio radio /sys/class/power_supply/battery/batt_soc
chown radio radio /sys/class/power_supply/battery/batt_reset_soc
chown radio radio /sys/class/power_supply/battery/batt_fg_soc
chown radio radio /sys/class/power_supply/battery/batt_test_mode
chown radio radio /sys/class/power_supply/battery/batt_vibrator
chown radio radio /sys/class/power_supply/battery/batt_camera
chown radio radio /sys/class/power_supply/battery/batt_mp3
chown radio radio /sys/class/power_supply/battery/batt_video
chown radio radio /sys/class/power_supply/battery/batt_voice_call_2g
chown radio radio /sys/class/power_supply/battery/batt_voice_call_3g
chown radio radio /sys/class/power_supply/battery/batt_data_call
chown radio radio /sys/class/power_supply/battery/batt_wifi
chown radio radio /sys/class/power_supply/battery/batt_gps
chown radio radio /sys/class/power_supply/battery/batt_temp_check
chown radio radio /sys/class/power_supply/battery/batt_full_check
chown radio radio /sys/class/power_supply/battery/batt_v_f_adc
chown radio radio /sys/class/power_supply/battery/batt_chg_current
chown radio radio /sys/class/power_supply/battery/batt_type
chown radio radio /sys/class/power_supply/battery/batt_dev_state
chown radio radio /sys/class/power_supply/battery/batt_compensation
chown radio radio /sys/class/power_supply/battery/batt_booting
chown radio radio /sys/class/power_supply/battery/charging_source
chown radio radio /sys/class/power_supply/battery/batt_lp_charging
# EMC DVFS on/off
chown radio system /sys/module/tegra2_emc/parameters/emc_enable
chmod 0660 /sys/module/tegra2_emc/parameters/emc_enable
# sensor
chown root system /dev/mpu
chown root system /dev/mpuirq
chown root system /dev/accelirq
chown root system /dev/timerirq
chown root system /sys/class/proximity/proximity/proximity_avg
chmod 0660 /dev/mpu
chmod 0660 /dev/mpuirq
chmod 0660 /dev/accelirq
chmod 0660 /dev/timerirq
# bluetooth
# UART device
chmod 0660 /dev/ttyHS2
chown bluetooth bluetooth /dev/ttyHS2
# power up/down interface
chmod 0660 /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/type
chmod 0660 /sys/class/rfkill/rfkill1/state
chmod 0660 /sys/class/rfkill/rfkill1/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill1/state
chown bluetooth bluetooth /sys/class/rfkill/rfkill1/type
chmod 6777 /system/bin/bcm_dut
# bluetooth MAC address programming
setprop ro.bt.bdaddr_path "/efs/bluetooth/bt_addr"
chown bluetooth bluetooth ro.bt.bdaddr_path
# UART/USB path switching
chown system radio /sys/devices/platform/i2c-gpio.11/i2c-11/11-0025/uartsel
chown system radio /sys/devices/platform/i2c-gpio.11/i2c-11/11-0025/usbsel
# Cypress touchkey
chown system radio /sys/devices/virtual/sec/sec_touchkey/touchkey_autocal_start
chown system radio /sys/devices/virtual/misc/melfas_touchkey/touch_version
chown system radio /sys/devices/virtual/misc/melfas_touchkey/touch_update
chown system radio /sys/devices/virtual/misc/melfas_touchkey/brightness
chown system radio /sys/devices/virtual/misc/melfas_touchkey/enable_disable
# STMPE QWERTY backlight
chown system radio /sys/devices/virtual/sec/sec_stmpe_bl/backlight
# backlight
chown system system /sys/class/backlight/pwm-backlight/brightness
chown system radio /sys/devices/platform/cmc623_pwm_bl/acl_set
chown system radio /sys/devices/platform/cmc623_pwm_bl/gamma_mode
chown system radio /sys/devices/virtual/sec/sec_tune_lcd/lcdtype
chown system radio /sys/devices/virtual/sec/sec_tune_lcd/lcd_onoff
# Sensor
chmod 666 /dev/nvhost-ctrl
chmod 666 /dev/nvhost-display
chmod 666 /dev/nvhost-dsi
chmod 666 /dev/nvhost-gr2d
chmod 666 /dev/nvhost-gr3d
chmod 666 /dev/nvhost-isp
chmod 666 /dev/nvhost-mpe
chmod 666 /dev/nvhost-vi
# Power management settings
# write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 216000
# write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1000000
# write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
# write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 216000
# write /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq 1000000
# write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
# write /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load 80
# permissions for MTP device node_temporary permission_will be changed 0660
chmod 0666 /dev/usb_mtp_gadget
# permissions for USB Accessory device(ADK) node_temporary permission_will be changed 0660
chown root usb /dev/usb_accessory
chmod 0660 /dev/usb_accessory
chown root system /sys/devices/virtual/usb_composite/accessory/enable
chmod 0664 /sys/devices/virtual/usb_composite/accessory/enable
# Define TCP buffer sizes for various networks
# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
setprop net.tcp.buffersize.default 4096,87380,704512,4096,16384,110208
setprop net.tcp.buffersize.wifi 4095,87380,393216,4096,16384,110208
setprop net.tcp.buffersize.umts 4094,87380,288768,4096,16384,110208
setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
setprop net.tcp.buffersize.evdo_b 4094,87380,262144,4096,16384,262144
setprop net.tcp.buffersize.hspa 4092,87380,704512,4096,16384,110208
# emmc checksum
chown system radio /sys/class/sec/sec_misc/emmc_checksum_done
chown system radio /sys/class/sec/sec_misc/emmc_checksum_pass
#SISO-PLAYREADY-CHANGES
#DRM directory creation
mkdir /system/etc/security/.drm 0775
chown system media /system/etc/security/.drm
chmod 0775 /system/etc/security/.drm
#Added for CLMA certs for Manufacturing app in OMADRM Version2
mkdir /data/mrd 0744
mkdir /data/mrd/almc 0744
mkdir /data/mrd/almc/adabip 0744
chown radio radio /data/mrd/almc/adabip/
chmod 0744 /data/mrd/almc/adabip/
# Added for Playready DRM Support
mkdir /data/data/.drm 0775
chown media system /data/data/.drm
chmod 0775 /data/data/.drm
mkdir /data/data/.drm/.playready 0775
chown media system /data/data/.drm/.playready
chmod 0775 /data/data/.drm/.playready
# Added for DIVX DRM
mkdir /efs/.files 0775
mkdir /efs/.files/.dx1 0775
mkdir /efs/.files/.dm33 0775
mkdir /efs/.files/.mp301 0775
chown media system /efs/.files/.dx1
chown media system /efs/.files/.dm33
chown media system /efs/.files/.mp301
chmod 0775 /efs/.files/.dx1
chmod 0775 /efs/.files/.dm33
chmod 0775 /efs/.files/.mp301
#SISO-PLAYREADY-CHANGES
# permissions for NFC
setprop ro.nfc.port "I2C"
chmod 0600 /dev/pn544
chown nfc nfc /dev/pn544
# Permissions for Camera
chown system system /sys/class/sec/sec_cam/camerafw
chown system system /sys/class/sec/sec_cam/cameraflash
chown system system /sys/class/sec/sec_cam/camtype
chown system system /sys/class/sec/sec_s5k6aafx/camtype
# HDMI_CURRENT_STATE
chown system system /sys/devices/virtual/switch/tegradc.1/hdmi_current_state
chmod 0664 /sys/devices/virtual/switch/tegradc.1/hdmi_current_state
chown system radio /sys/devices/virtual/switch/tegradc.0/hdmi_current_state
chmod 0664 /sys/devices/virtual/switch/tegradc.0/hdmi_current_state
# HDMI_CAMERA_STATUS
chown system system /sys/devices/virtual/switch/tegradc.1/hdmi_camera_status
chmod 0664 /sys/devices/virtual/switch/tegradc.1/hdmi_camera_status
chown system radio /sys/devices/virtual/switch/tegradc.0/hdmi_camera_status
chmod 0664 /sys/devices/virtual/switch/tegradc.0/hdmi_camera_status
#HDCP LIBRARY FILES
chmod 0440 /system/etc/hdmi/dectable.dat
chmod 0440 /system/etc/hdmi/dectable1.dat
chown system system /system/etc/hdmi/dectable.dat
chown system system /system/etc/hdmi/dectable1.dat
# MHL
chown system radio /sys/devices/platform/mhl/MHD_file
chmod 0644 /sys/devices/platform/mhl/MHD_file
# Vibrator
chmod 0666 /dev/tspdrv
# Hdcp
chown system system /dev/nvhdcp1
chmod 0660 /dev/nvhdcp1
# OTG Test
chown system radio /sys/class/host_notify/usb_otg/booster
chmod 0664 /sys/class/host_notify/usb_otg/booster
# disable_vbus
chown system radio /sys/devices/platform/android_usb/disable_vbus
chmod 0664 /sys/devices/platform/android_usb/disable_vbus
# UsbMenuSel ownership change - for setting.
chown system radio /sys/devices/platform/android_usb/UsbMenuSel
# Debug_Level
chown system radio /sys/devices/platform/sec_debug_level
chmod 664 /sys/devices/platform/sec_debug_level
chown system radio /sys/devices/virtual/misc/level/control
chmod 664 /sys/devices/virtual/misc/level/control
# for only N1_USA_ATT
write /proc/sys/kernel/printk 7
service playsound /system/bin/playsound
user media
group system
disabled
oneshot
service immvibed /system/bin/immvibed_n1
user shell
group shell
oneshot
# for datarouter
chown system system /dev/ttyGS0
chown system system /dev/dun
service wpa_supplicant /system/bin/wpa_supplicant \
-Dwext -ieth0 -c/data/wifi/bcm_supp.conf
class main
socket wpa_eth0 dgram 660 wifi wifi
disabled
oneshot
#for WiFi MFG(TestMode)
service mfgloader /system/bin/mfgloader
disabled
oneshot
service wlandutservice /system/bin/wlandutservice
user system
group wifi net_raw net_admin system inet
disabled
oneshot
service macloader /system/bin/macloader
oneshot
# end of wifi
service dhcpcd /system/bin/dhcpcd
disabled
oneshot
service iprenew_eth0 /system/bin/dhcpcd -n
disabled
oneshot
# bugreport is triggered by the VOLUME-DOWN and VOLUME-UP keys
service bugreport /system/bin/dumpstate -d -v -o /data/storage/bugreports/bugreport
disabled
oneshot
keycodes 115 114
service audiotunemode /system/bin/audiotunemode
oneshot
# Bluetooth
service btld /system/bin/logwrapper /system/bin/btld -hb 3000000 -hp /dev/ttyHS2 -lpm 1
user root
group bluetooth net_bt_admin
disabled
oneshot
service mtpd /system/bin/mtpd
socket mtpd stream 600 system system
user vpn
group vpn net_admin net_raw
disabled
oneshot
service ril-daemon /system/bin/rild
socket rild stream 660 root radio
socket rild-debug stream 660 radio system
user root
group radio cache inet misc audio sdcard_rw log
service DR-deamon /system/bin/drexe
user root
group system radio inet net_raw
service mobex-daemon /system/bin/npsmobex
user system
group system inet
service tvout /system/bin/tvoutserver
user system
group graphics
# start btld if soft_onoff is enabled
on property:service.brcm.bt.soft_onoff=1
start btld
# stop btld if soft_onoff is disabled
on property:service.brcm.bt.soft_onoff=0
stop btld
# Samsung USB Mode : system properties are linked with sysfs
# write /sys/class/sec/switch/UsbMenuSel 0
on property:persist.service.usb.setting=0
write /sys/devices/platform/android_usb/UsbMenuSel 0
on property:persist.service.usb.setting=1
write /sys/devices/platform/android_usb/UsbMenuSel 1
on property:persist.service.usb.setting=2
write /sys/devices/platform/android_usb/UsbMenuSel 2
on property:persist.service.usb.setting=3
write /sys/devices/platform/android_usb/UsbMenuSel 3
on property:persist.service.usb.setting=4
write /sys/devices/platform/android_usb/UsbMenuSel 4
# Power management settings
on property:sys.boot_completed=1
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 216000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1000000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 216000
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq 1000000
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpufreq/interactive/go_maxspeed_load 80
# adbd is controlled by the persist.service.adb.enable system property
service adbd /sbin/adbd
disabled
# adbd on at boot in emulator
on property:ro.kernel.qemu=1
start adbd
on property:persist.service.adb.enable=1
start adbd
#HCI_ENABLE_BT_DEV_UNDER_TEST_MODE
service bt_dut_cmd /system/bin/bcm_dut
group bluetooth net_bt_admin
disabled
oneshot
on property:encryption.bootmode=remount
exec check_encrypted_filesystem /data ext4
stop mobex-daemon
stop DR-daemon
stop tvout
stop media
stop immvibed
stop zygote
# do not add here, "on property" tag area
# verfiy filesystem (UMS)
exec apply_system_policy /dev/block/mmcblk0p4 vfat
mount ext4 /dev/block/mmcblk0p6 /data nosuid nodev noatime wait usedm discard,noauto_da_alloc,journal_checksum
# do not add here, "on property" tag area
chown system system /data
chmod 0771 /data
# do not add here, "on property" tag area
# We chown/chmod /data again so because mount is run as root + defaults
chown system system /data
chmod 0771 /data
# do not add here, "on property" tag area
# Create dump dir and collect dumps.
# Do this before we mount cache so eventually we can use cache for
# storing dumps on platforms which do not have a dedicated dump partition.
# do not add here, "on property" tag area
mkdir /data/dontpanic
chown root log /data/dontpanic
chmod 0750 /data/dontpanic
# do not add here, "on property" tag area
# Collect apanic data, free resources and re-arm trigger
copy /proc/apanic_console /data/dontpanic/apanic_console
chown root log /data/dontpanic/apanic_console
chmod 0640 /data/dontpanic/apanic_console
# do not add here, "on property" tag area
copy /proc/apanic_threads /data/dontpanic/apanic_threads
chown root log /data/dontpanic/apanic_threads
chmod 0640 /data/dontpanic/apanic_threads
# do not add here, "on property" tag area
write /proc/apanic_console 1
# do not add here, "on property" tag area
# create basic filesystem structure
mkdir /data/misc 01771 system misc
mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth
mkdir /data/misc/bluetooth 0770 system system
mkdir /data/misc/keystore 0700 keystore keystore
mkdir /data/misc/vpn 0770 system system
mkdir /data/misc/systemkeys 0700 system system
mkdir /data/misc/vpn/profiles 0770 system system
# give system access to wpa_supplicant.conf for backup and restore
mkdir /data/misc/wifi 0770 wifi wifi
chmod 0770 /data/misc/wifi
chmod 0660 /data/misc/wifi/wpa_supplicant.conf
mkdir /data/local 0771 shell shell
mkdir /data/local/tmp 0771 shell shell
mkdir /data/data 0771 system system
mkdir /data/app-private 0771 system system
mkdir /data/app 0771 system system
chown system system /data/app
chmod 0771 /data/app
mkdir /data/property 0700 root root
# do not add here, "on property" tag area
# create log system
mkdir /data/log 0777 system system
# do not add here, "on property" tag area
chmod 1777 /data/log
chmod 1777 /data/anr
# do not add here, "on property" tag area
# create dalvik-cache and double-check the perms
mkdir /data/dalvik-cache 0771 system system
chown system system /data/dalvik-cache
chmod 0771 /data/dalvik-cache
# do not add here, "on property" tag area
# create the lost+found directories, so as to enforce our permissions
mkdir /data/lost+found 0770
# do not add here, "on property" tag area
# double check the perms, in case lost+found already exists, and set owner
chown root root /data/lost+found
chmod 0770 /data/lost+found
# do not add here, "on property" tag area
start zygote
start immvibed
start media
start tvout
start DR-daemon
start mobex-daemon