-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.tegra.rc
executable file
·212 lines (162 loc) · 7.17 KB
/
init.tegra.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
#Copyright (c) 2011-2014 NVIDIA Corporation. All Rights Reserved.
#
#NVIDIA Corporation and its licensors retain all intellectual property and
#proprietary rights in and to this software and related documentation. Any
#use, reproduction, disclosure or distribution of this software and related
#documentation without an express license agreement from NVIDIA Corporation
#is strictly prohibited.
import init.nv_dev_board.usb.rc
import init.${ro.boot.modem}.rc
import init.comms.rc
on early-init
mount debugfs debugfs /sys/kernel/debug mode=0755
on init
mkdir /mnt/shell/emulated 0700 shell shell
mkdir /storage/emulated 0555 root root
mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw
mkdir /storage/sdcard1 0700 root root
export EXTERNAL_STORAGE /storage/emulated/legacy
export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
export EMULATED_STORAGE_TARGET /storage/emulated
export SECONDARY_STORAGE /storage/sdcard1
# Support legacy paths
symlink /storage/emulated/legacy /sdcard
symlink /storage/emulated/legacy /mnt/sdcard
symlink /storage/sdcard1 /mnt/sdcard2
symlink /storage/emulated/legacy /storage/sdcard0
symlink /mnt/shell/emulated/0 /storage/emulated/legacy
# create directory for mounting usb drives
mkdir /mnt/media_rw/usbdrive 0700 media_rw media_rw
mkdir /storage/usbdrive 0700 root root
symlink /mnt/media_rw/usbdrive /storage/usbdrive
symlink /mnt/media_rw/usbdrive /usbdrive
# create directory for mounting calibration partition
mkdir /mnt/factory 0666 system system
# create directory for mounting user calibration partition
mkdir /mnt/usercalib 0771 system system
start watchdogd
on fs
# mount console ramooops
mount pstore pstore /sys/fs/pstore
on post-fs-data
# We chown/chmod /mnt/usercalib again so because mount is run as root + defaults
chown system system /mnt/usercalib
chmod 0771 /mnt/usercalib
# create the lost+found directories, so as to enforce our permissions
mkdir /mnt/usercalib/lost+found 0770 root root
# Set SELinux security contexts on upgrade or policy update.
restorecon_recursive /mnt/usercalib
mkdir /data/misc/dhcp 0770 dhcp dhcp
mkdir /data/nvcam 0700 media camera
chown dhcp dhcp /data/misc/dhcp
mkdir /data/media 0770 media_rw media_rw
# Set indication (checked by vold) that we have finished this action
setprop vold.post_fs_data_done 1
# create directory for camera calibration data
mkdir /mnt/factory/camera 0666 system system
# cpu volt cap
mkdir /data/misc/cvc 0774 system system
# Set up HDCP
import init.hdcp.rc
on boot
# backlight
chown system system /sys/class/backlight/pwm-backlight/brightness
# didim
chown system system /sys/devices/platform/host1x/tegradc.0/smartdimmer/enable
chown system system /sys/devices/platform/host1x/tegradc.0/smartdimmer/aggressiveness
chown system system /sys/devices/platform/host1x/tegradc.0/smartdimmer/sd_window
chown system system /sys/devices/platform/host1x/tegradc.0/smartdimmer/sd_window_enable
# CMU
chown system system /sys/devices/platform/host1x/tegradc.0/cmu_enable
chown system system /sys/devices/platform/host1x/tegradc.1/cmu_enable
# power
chown system system /sys/kernel/tegra_cap/core_cap_level
chown system system /sys/kernel/tegra_cap/core_cap_state
chown system system /sys/kernel/tegra_volt_cap/cpu_volt
chmod 0664 /sys/kernel/tegra_volt_cap/cpu_volt
chown system system /sys/module/cpu_tegra/parameters/cpu_user_cap
chown system system /sys/devices/platform/host1x/gk20a.0/enable_3d_scaling
# audio
chmod 0664 /sys/power/suspend/mode
chown system audio /sys/power/suspend/mode
# Tegra wakeup monitor
chown system system /sys/devices/platform/tegra_wakeup_monitor/cmd
chown system system /sys/devices/platform/tegra_wakeup_monitor/monitor_enable
chown system system /sys/devices/platform/tegra_wakeup_monitor/nf_enable
chown system system /sys/devices/platform/tegra_wakeup_monitor/am_enable
chown system system /sys/devices/platform/tegra_wakeup_monitor/init_ports
chown system system /sys/devices/platform/tegra_wakeup_monitor/add_ports
chown system system /sys/devices/platform/tegra_wakeup_monitor/del_ports
# nvdps
chown system system /sys/devices/platform/host1x/tegradc.0/nvdps
# Default Read Ahead value for sdcards
write /sys/block/mmcblk0/queue/read_ahead_kb 2048
write /sys/block/mmcblk1/queue/read_ahead_kb 2048
#ozwpan driver: WiFi direct USB shim driver
chown system system /dev/ozwpan
chown system system /sys/class/ozmo_wpan/ozwpan/devices
chown system system /sys/class/ozmo_wpan/ozwpan/select
chown system system /sys/class/ozmo_wpan/ozwpan/bind
chmod 0660 /sys/class/ozmo_wpan/ozwpan/bind
# Set GL driver yield function to sleep for 250us
setprop persist.tegra.yieldFunctionSlow 4
# TLK storage service
import init.tlk.rc
# set hwui properties depending on the screen resolution and the memory size
service set_hwui_params /system/bin/set_hwui_params.sh
class main
user root
group root
oneshot
# Enable/disable CMU according to the colorspace
# BL/Kernel enable CMU as default, skip here
#on property:persist.sys.dpy0.colorspace=srgb
# write /sys/devices/platform/host1x/tegradc.0/cmu_enable 1
on property:persist.sys.dpy0.colorspace=native
write /sys/devices/platform/host1x/tegradc.0/cmu_enable 0
on property:persist.sys.dpy1.colorspace=srgb
write /sys/devices/platform/host1x/tegradc.1/cmu_enable 1
on property:persist.sys.dpy1.colorspace=native
write /sys/devices/platform/host1x/tegradc.1/cmu_enable 0
on property:ro.debuggable=1
# EMC debug interface
chmod 666 /sys/kernel/debug/tegra_emc/eack_state
service sdcard /system/bin/sdcard -u 1023 -g 1023 -l /data/media /mnt/shell/emulated
class late_start
service fuse_sdcard1 /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1
class late_start
disabled
service fuse_usbdrive /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/usbdrive /storage/usbdrive
class late_start
disabled
# bugreport is triggered by the VOLUME-DOWN and VOLUME-UP keys
service bugreport /system/bin/dumpstate -d -p -B -o /data/data/com.android.shell/files/bugreports/bugreport
class main
disabled
oneshot
keycodes 116 115 114
# 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/media_rw/usbdrive
on device-removed-/sys/block/sda
umount /mnt/media_rw/usbdrive
# unified scaling setup
import init.ussrd.rc
service cvc /vendor/bin/cvc
user system
group system
class main
# Enable rbe
# thresIncr:50 thresIncrCntMax:6 thresDecr:70 thresDecrCntMax:2
# The change from default is the thresDecrCntMax. Default is 3.
service wlbwservice /system/bin/wlbwservice -t 50 6 70 2
class main
user system
group system inet net_admin
# Thie yields each tegra wdt expiration to be at 7.5 secs and fourth expiration for reboot at 30 secs.
service watchdogd /sbin/watchdogd 10 20
class core
seclabel u:r:watchdogd:s0
# Customers should remove this line
import init.qvs.rc