forked from CyanogenMod/android_device_samsung_p5-common
-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.p3.rc
366 lines (298 loc) · 11.3 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
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
import init.p3.usb.rc
on early-init
mount debugfs debugfs /sys/kernel/debug
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 0664 system system
symlink /mnt/usbdrive /usbdrive
mkdir /efs 0771 system system
write /sys/block/mmcblk0/queue/iosched/slice_idle 0
on init
# Vibetonz
export VIBE_PIPE_PATH /dev/pipes
mkdir /dev/pipes 0771 shell shell
on fs
mount ext4 /dev/block/platform/sdhci-tegra.3/by-num/p4 /system wait ro
setprop ro.crypto.tmpfs_options size=128m,mode=0771,uid=1000,gid=1000
exec sfsck /dev/block/platform/sdhci-tegra.3/by-num/p5 ext4
mount ext4 /dev/block/platform/sdhci-tegra.3/by-num/p5 /cache wait noatime nosuid nodev
# Device Encryption by Security R&D Group.
exec set_crypt_meta_info /dev/block/platform/sdhci-tegra.3/by-num/p8 /data
exec sfsck /dev/block/platform/sdhci-tegra.3/by-num/p8 ext4 encryptable
mount ext4 /dev/block/platform/sdhci-tegra.3/by-num/p8 /data wait noatime nosuid nodev noauto_da_alloc
exec sfsck /dev/block/platform/sdhci-tegra.3/by-num/p1 ext4
mount ext4 /dev/block/platform/sdhci-tegra.3/by-num/p1 /efs wait noatime nosuid nodev
on post-fs-data
chown system radio /efs
chmod 0775 /efs
mkdir /efs/wifi
mkdir /efs/bluetooth
chown radio system /efs/wifi
chmod 0775 /efs/bluetooth
chmod 0775 /efs/wifi
# For P3
mkdir /efs/wifi/mac
chown wifi wifi /efs/wifi/mac
chmod 0775 /efs/wifi/mac
chown system radio /efs/wifi/.mac.info
chown system radio /data/.mac.info
chmod 0664 /efs/wifi/.mac.info
chmod 0664 /data/.mac.info
mkdir /data/wifi 0771 wifi wifi
mkdir /data/misc/wifi 0771 wifi wifi
chmod 0771 /data/misc/wifi/
chmod 0771 /data/wifi/
mkdir /data/misc/dhcp 0771 dhcp dhcp
mkdir /data/misc/wifi/sockets 0771 wifi wifi
chmod 0664 /system/etc/wifi/wpa_supplicant.conf
chown dhcp dhcp /data/misc/dhcp
mkdir /data/misc/dhcpcd 0771 dhcp dhcp
chown dhcp dhcp /data/misc/dhcpcd
chown dhcp dhcp /data/misc/dhcp
# Change Permission /data/app for booting time
chmod 0771 /data/app
chown system system /data/app
# MHL
chown system radio /sys/devices/platform/acc_con/MHD_file
# 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
# SEC_MM_DRM
# Found in P4
# DRM directory creation
mkdir /system/etc/security/.drm 0775
chown root root /system/etc/security/.drm
chmod 0775 /system/etc/security/.drm
# 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
# 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
# create log system for radio
mkdir /data/log 0775 system log
chown system log /data/log
chmod 0775 /data/log
chmod 0775 /data/anr
# HATP Result Dir
mkdir /data/misc/radio 0771 radio system
# 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/batt_reset_soc
chown system radio /sys/class/power_supply/battery/batt_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
# OTG Test
chown system radio /sys/class/host_notify/usb_otg/booster
chmod 0664 /sys/class/host_notify/usb_otg/booster
# usb detect
mkdir /dev/bus 0755 root root
mkdir /dev/bus/usb 0755 root root
# 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
# 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/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
# 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
chmod 664 /sys/bus/iio/devices/device0/illuminance0_input
chmod 664 /sys/bus/iio/devices/device0/proximity_raw
# 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
# For P3
chown root system /sys/class/sensors/accelerometer_sensor/p3_accel_cal
chmod 0660 /dev/mpu
chmod 0660 /dev/mpuirq
chmod 0660 /dev/accelirq
chmod 0660 /dev/timerirq
# For P3
chmod 0660 /sys/class/sensors/accelerometer_sensor/p3_accel_cal
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
# CMC623
chown system media_rw /sys/class/mdnie/mdnie/mdnie_auto_ove
chown system media_rw /sys/class/mdnie/mdnie/mode
chown system media_rw /sys/class/mdnie/mdnie/cabc
chown system media_rw /sys/class/mdnie/mdnie/outdoor
chown system media_rw /sys/class/mdnie/mdnie/mdnie_roi
chown system media_rw /sys/class/mdnie/mdnie/scenario
chown system media_rw /sys/class/mdnie/mdnie/mdnie_temp
chown system media_rw /sys/class/mdnie/mdnie/lcd_power
chown system media_rw /sys/class/mdnie/mdnie/lcd_type
# Power management settings
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive
write /sys/module/cpuidle/parameters/lp2_in_idle 0
# 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
# 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
# For P3
chown root camera /sys/class/sec/sec_imx073/camerafw
# Change permissions on cameraflash so that we can use it with Torch
chmod 0666 /sys/devices/virtual/sec/sec_s5k5ccgx/cameraflash
# Touchscreen Config-UI interface
chmod 666 /sys/devices/platform/tegra-i2c.0/i2c-0/0-005a/debug_enable
chmod 666 /sys/devices/platform/tegra-i2c.0/i2c-0/0-005a/pause_driver
chmod 666 /sys/devices/platform/tegra-i2c.0/i2c-0/0-005a/slowscan_enable
# Default Read Ahead value for sdcards
write /sys/block/mmcblk0/queue/read_ahead_kb 2048
# Modem interface (For 3g tabs)
chown system radio /sys/devices/platform/tegra-ehci.1/ehci_power
# GPS perms
chown root system /dev/ttyHS0
chmod 0664 /dev/ttyHS0
chown root system /sys/class/sec/gps/pwr_en
chmod 0664 /sys/class/sec/gps/pwr_en
chown root system /sys/class/sec/gps/nrst
chmod 0664 /sys/class/sec/gps/nrst
mkdir /data/gps 771 system system
chown system system /data/gps
# Always start adbd on userdebug and eng builds
setprop sys.usb.config adb
service wpa_supplicant /system/bin/wpa_supplicant \
-Dnl80211 -iwlan0 -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 -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 dhcpcd_eth0 /system/bin/dhcpcd -ABKL -f/system/etc/dhcpcd/dhcpcd.conf
class main
disabled
oneshot
service iprenew_wlan0 /system/bin/dhcpcd -n
disabled
oneshot
service iprenew_p2p /system/bin/dhcpcd -n
disabled
oneshot
service iprenew_eth0 /system/bin/dhcpcd -n
disabled
oneshot
service macloader /system/bin/macloader
class main
oneshot
# end of wifi
# Start GPS daemon
service gpsd /system/bin/gpsd -c /system/etc/gps.xml
class main
socket gps seqpacket 0660 gps system
user gps
group system inet sdcard_rw
# create virtual SD card at /mnt/sdcard, based on the /data/media directory
# deamon 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
# bugreport is triggered by the VOLUME-DOWN and VOLUME-UP keys
service bugreport /system/bin/dumpstate -d -v -o /data/storage/bugreports/bugreport
class main
disabled
oneshot
keycodes 115 114
#BCM
service hciattach /system/bin/brcm_patchram_plus --enable_hci --enable_lpm --no2bytes --tosleep 50000 \
--baudrate 3000000 --use_baudrate_for_download --patchram /system/etc/firmware/bcm4330B1.hcd \
--i2s=1,0,1,2 /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
# serial keyboard daemon
service sec_keyboard /system/bin/sec_keyboard /dev/ttyS0
class late_start
group system
# For 3g tabs
service cpboot-daemon /sbin/cbd -d -o t -p 7
class main
user root
group radio cache inet misc audio sdcard_rw log
service battery_charger /charger
class charger