forked from motley-git/p5-common_android_ics_device_tree
-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.p3.rc
340 lines (267 loc) · 10.1 KB
/
init.p3.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
import init.p3.usb.rc
on early-init
mount debugfs debugfs /sys/kernel/debug
write /sys/class/firmware/timeout 5
export EXTERNAL_STORAGE /mnt/sdcard
mkdir /mnt/sdcard 0000 system system
# for backwards compatibility
symlink /mnt/sdcard /sdcard
# create directory for mounting usb drives
mkdir /mnt/usbdrive 0666 system system
symlink /mnt/usbdrive /usbdrive
mkdir /efs 0771 system system
write /sys/block/mmcblk0/queue/iosched/slice_idle 0
on init
# set tegra_dc0/1 perms
chmod 666 /dev/tegra_dc_0
chmod 666 /dev/tegra_dc_1
# Vibetonz
export VIBE_PIPE_PATH /dev/pipes
mkdir /dev/pipes 0771 shell shell
on fs
mount ext4 /dev/block/mmcblk0p4 /system noatime wait discard,noauto_da_alloc,data=writeback
setprop ro.crypto.tmpfs_options size=128m,mode=0771,uid=1000,gid=1000
mount ext4 /dev/block/mmcblk0p5 /cache wait noatime nosuid nodev errors=continue
exec check_filesystem /dev/block/mmcblk0p8 ext4
mount ext4 /dev/block/mmcblk0p8 /data wait noatime nosuid nodev discard,noauto_da_alloc,errors=continue
# mount EFS partition
mount ext4 /dev/block/mmcblk0p1 /efs wait noatime nosuid nodev
on post-fs-data
chown radio system /efs
chmod 0771 /efs
chmod 0775 /efs/bluetooth
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
#Change Permission /data/app for booting time
chmod 0771 /data/app
chown system system /data/app
#SISO-PLAYREADY-CHANGES
#DRM directory creation
mkdir /system/etc/security/.drm 0775
chown root root /system/etc/security/.drm
chmod 0775 /system/etc/security/.drm
# DivX DRM
mkdir /efs/.files 0777
mkdir /efs/.files/.dx1 0777
mkdir /efs/.files/.dm33 0777
mkdir /efs/.files/.mp301 0777
# Added for Playready DRM Support
mkdir /data/data/.drm 0775
chown drm system /data/data/.drm
chmod 0775 /data/data/.drm
mkdir /data/data/.drm/.playready 0775
chown drm system /data/data/.drm/.playready
chmod 0775 /data/data/.drm/.playready
#Added drm folder to copy drm plugins
mkdir /system/lib/drm 0775
chown root root /system/lib/drm
chmod 0775 /system/lib/drm
#SISO-PLAYREADY-CHANGES
# create data/gps for GPS demon
mkdir /data/gps 700 gps system
chown gps system /data/gps
chown gps root /sys/class/sec/gps/pwr_en
chmod 664 /sys/class/sec/gps/nrst
# create log system for radio
mkdir /data/log 0777 root root
chmod 0777 /data/log
# we will remap this as /mnt/sdcard with the sdcard fuse tool
mkdir /data/media 0775 media_rw media_rw
chown media_rw media_rw /data/media
# Set indication (checked by vold) that we have finished this action
setprop vold.post_fs_data_done 1
# change owner for writable sysfs files
chown system radio /sys/class/power_supply/battery/reset_soc
chown system radio /sys/class/power_supply/battery/reset_cap
chown system radio /sys/class/power_supply/battery/fg_reg
chown system radio /sys/class/power_supply/battery/charging_mode_booting
on boot
# 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
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chmod 6777 /system/bin/bcm_dut
# bluetooth MAC address programming
setprop ro.bt.bdaddr_path "/efs/imei/bt.txt"
chown bluetooth bluetooth ro.bt.bdaddr_path
# UART/USB path switching
chown system radio /sys/class/sec/sec_misc/uartsel
chown system radio /sys/class/sec/sec_misc/usbsel
# adc
chown system radio /sys/class/sec/sec_adc/adc_test
# backlight
chown system system /sys/class/backlight/pwm-backlight/brightness
# CMC623
chown system radio /sys/class/mdnie/cmc623/mdnie_auto_ove
chown system radio /sys/class/mdnie/cmc623/mdnie_bg
chown system radio /sys/class/mdnie/cmc623/mdnie_cabc
chown system radio /sys/class/mdnie/cmc623/mdnie_ove
chown system radio /sys/class/mdnie/cmc623/mdnie_roi
chown system radio /sys/class/mdnie/cmc623/mdnie_scenario
chown system radio /sys/class/mdnie/cmc623/mdnie_temp
chown system radio /sys/class/mdnie/cmc623/lcd_power
chown system radio /sys/class/mdnie/cmc623/lcdtype
# MHL
chown system radio /sys/devices/platform/acc_con/MHD_file
# Camera
chown root camera /sys/class/sec/sec_imx073/camerafw
# 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
# 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
chmod 664 /sys/class/sensors/accelerometer_sensor/calibration
chown system system /sys/class/sensors/accelerometer_sensor/calibration
# Vibetonz
chmod 0660 /dev/tspdrv
chown root shell /dev/tspdrv
# to enable wifi
setprop wifi.interface "eth0"
# end of wifi
# Power management settings
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
#Enable KSM
write /sys/kernel/mm/ksm/sleep_millisecs 1400
write /sys/kernel/mm/ksm/pages_to_scan 200
write /sys/kernel/mm/ksm/run 1
# HSIC control
chown radio system /sys/devices/platform/tegra-ehci.1/ehci_power
# emmc checksum
chown system radio /sys/class/sec/sec_misc/emmc_checksum_done
chown system radio /sys/class/sec/sec_misc/emmc_checksum_pass
# Get MAC address from efs for COB type
copy /efs/imei/.nvmac.info /data/.nvmac.info
chown system system /data/.nvmac.info
chmod 0400 /data/.nvmac.info
# disable_vbus
chown system radio /sys/devices/platform/android_usb/disable_vbus
chmod 0664 /sys/devices/platform/android_usb/disable_vbus
# Keyboard dock
chown input input /sys/class/sec/keyboard/keyboard_led
chmod 0660 /sys/class/sec/keyboard/keyboard_led
# KBC
chown system radio /sys/devices/platform/tegra-kbc/matrixkey_pressed
chmod 0664 /sys/devices/platform/tegra-kbc/matrixkey_pressed
# GPIO_KEY
chown system radio /sys/devices/platform/gpio-keys.0/gpiokey_pressed
chmod 0664 /sys/devices/platform/gpio-keys.0/gpiokey_pressed
# OTG Test
chown system radio /sys/class/host_notify/usb_otg/booster
chmod 0664 /sys/class/host_notify/usb_otg/booster
# MTP permission
chmod 0660 /dev/usb_mtp_gadget
chown system system /dev/usb_mtp_gadget
# DEBUG_LEVEL
chown system radio /sys/devices/platform/sec_debug_level
chmod 0664 /sys/devices/platform/sec_debug_level
chown system radio /sys/devices/virtual/misc/level/control
chmod 0664 /sys/devices/virtual/misc/level/control
# Camera
chown system radio /sys/class/sec/sec_s5k5ccgx/cameraflash
chown system radio /sys/class/sec/sec_s5k5ccgx/camtype
chown system radio /sys/class/sec/sec_s5k5bbgx/camtype
# Change permissions on cameraflash so that we can use it with Torch
chmod 0666 /sys/devices/virtual/sec/sec_s5k5ccgx/cameraflash
# crypto permissions
chown system system /dev/tegra-crypto
chmod 0660 /dev/tegra-crypto
# Hdcp
chown system system /dev/nvhdcp1
chmod 0660 /dev/nvhdcp1
chown system system /system/etc/hdmi/dectable.dat
chmod 0440 /system/etc/hdmi/dectable.dat
chown system system /system/etc/hdmi/dectable1.dat
chmod 0440 /system/etc/hdmi/dectable1.dat
#USB charging
write /sys/class/power_supply/battery/force_usb_charging 1
on property:vold.decrypt=check_integrity
exec check_encrypted_filesystem
setprop vold.post_fs_data_done 1
# Always start adbd on userdebug and eng builds
setprop sys.usb.config adb
service drm /system/bin/drmserver
class main
user drm
group system root inet sdcard_rw
service wpa_supplicant /system/bin/wpa_supplicant -Dnl80211 -ieth0 \
-c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
class main
socket wpa_eth0 dgram 0660 wifi wifi
disabled
oneshot
service dhcpcd_eth0 /system/bin/dhcpcd -ABKL
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_eth0 /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 gpsd /system/bin/gpsd -c /system/etc/gps.xml
class main
socket gps seqpacket 0660 gps system
user gps
group system inet
# create virtual SD card at /mnt/sdcard, based on the /data/media directory
# daemon will drop to user/group system/media_rw after initializing
# underlying files in /data/media wil be created with user and group media_rw (1023)
service sdcard /system/bin/sdcard /data/media 1023 1023
class late_start
service hciattach /system/bin/brcm_patchram_plus --enable_hci --enable_lpm --no2bytes \
--use_baudrate_for_download --baudrate 3000000 --patchram /etc/firmware/bcm4330B1.hcd /dev/ttyHS2
class main
user bluetooth
group bluetooth net_bt_admin
disabled
# Mount usb drives as /usbdrive. Generally usb drives are formatted with FAT
# filesystem, so we support FAT as of now.
on device-added-/sys/block/sda
mount vfat /dev/block/sda /mnt/usbdrive
on device-removed-/sys/block/sda
umount /mnt/usbdrive
# bugreport is triggered by holding down volume down, volume up and power
service bugreport /system/bin/bugmailer.sh -v
class main
disabled
oneshot
keycodes 114 115 116
service battery_charger /charger
class charger