init.rc
8.47 KB
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
import /vendor/etc/init/hw/init.${ro.hardware}.usb.rc
import /vendor/etc/init/hw/init.${ro.hardware}.${ro.boot.soc_type}.rc
on early-init
# mount the debugfs
mount debugfs none /sys/kernel/debug/ mode=0755
on early-init
start early_init_sh
# Due keymaster start very early so set prop here
# Also gatekeeper share same role for keymaster
setprop ro.hardware.keystore ${ro.boot.keystore}
setprop ro.hardware.gatekeeper ${ro.boot.keystore}
setprop vendor.storageproxyd ${ro.boot.keystore}
on init
start watchdogd
# Support legacy paths
symlink /sdcard /mnt/sdcard
symlink /sdcard /storage/sdcard0
# setup the global environment
export CORE_REGISTER_FILE /vendor/etc/core_register
export COMPONENT_REGISTER_FILE /vendor/etc/component_register
export CONTENTPIPE_REGISTER_FILE /vendor/etc/contentpipe_register
# disable cursor blink for fbcon, if no splash screen support
write /sys/class/graphics/fbcon/cursor_blink 0
# deattch the fbcon as hdmi hotplug conflict with fbcon
write /sys/class/vtconsole/vtcon1/bind 0
chown system system /dev/stune/top-app/schedtune.boost
chmod 664 /dev/stune/top-app/schedtune.boost
chown system system /dev/stune/top-app/schedtune.prefer_idle
chmod 664 /dev/stune/top-app/schedtune.prefer_idle
chown system system /dev/stune/foreground/schedtune.boost
chmod 664 /dev/stune/foreground/schedtune.boost
chown system system /dev/stune/foreground/schedtune.prefer_idle
chmod 664 /dev/stune/foreground/schedtune.prefer_idle
chown system system /dev/stune/schedtune.boost
chmod 664 /dev/stune/schedtune.boost
# set default schedTune value for foreground/top-app (only affects EAS)
write /dev/stune/foreground/schedtune.boost 10
write /dev/stune/foreground/schedtune.prefer_idle 1
write /dev/stune/top-app/schedtune.boost 40
write /dev/stune/top-app/schedtune.prefer_idle 1
write /dev/stune/rt/schedtune.boost 50
write /dev/stune/rt/schedtune.prefer_idle 1
# force USB2514 autosuspend
write /sys/devices/platform/usb@38200000/38200000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.5/power/control auto
on late-fs
# Start keymaster service
start vendor.keymaster-3-0-${ro.boot.keystore}
setprop vendor.powerhal.init 1
on late-fs && property:vendor.storageproxyd=trusty
start vendor.oemlock-1-0
on early-boot
# For evk_8mq, when swap used about 400M, upgrade the level.
setprop ro.lmk.upgrade_pressure 87
setprop ro.lmk.downgrade_pressure 95
setprop ro.lmk.critical_upgrade true
# Set the host name which used in console
export HOSTNAME smarc-imx8mq
# Set permission for IIM node
symlink /dev/mxs_viim /dev/mxc_mem
# Enable Tethering in the Settings
setprop ro.tether.denied false
setprop sys.hwc.disable 1
setprop vendor.2d.composition 0
setprop hwc.stretch.filter 1
#viv sdk dir
setprop VIVANTE_SDK_DIR /vendor/etc/viv_sdk
# fsl omx graphic manager media framework property
setprop rw.VIDEO_RENDER_NAME video_render.surface
setprop media.fsl_codec.flag 7
setprop debug.stagefright.ccodec 0
setprop camera.disable_zsl_mode 1
# Tweak the mmc device read ahead buffer size
write /sys/block/mmcblk0/queue/read_ahead_kb 2048
write /sys/block/mmcblk1/queue/read_ahead_kb 2048
# Set period_us for usb audio
setprop ro.audio.usb.period_us 20000
# Prepare for wifi
setprop wifi.interface wlan0
setprop persist.service.bdroid.bdaddr 22:22:67:C6:69:73
# Prepare for bluetooth
chmod 665 /sys/class/rfkill/rfkill0/state
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
write /sys/class/rfkill/rfkill0/state 0
# Prepare for RIL
setprop ro.ril.wake_lock_timeout 300
# Use ro.boot.lcd_density to override ro.sf.lcd_density
setprop ro.sf.lcd_density ${ro.boot.lcd_density}
# Disable surfaceflinger back pressure propagate
setprop debug.sf.disable_backpressure 1
# Set tracefs permission to 755
chmod 0755 /sys/kernel/debug/tracing
# Set sw_sync group to graphics and set permission to 664
chown root graphics /sys/kernel/debug/sync/sw_sync
chmod 0664 /sys/kernel/debug/sync/sw_sync
# Default backlight device
setprop hw.backlight.dev "backlight"
# Chmod/chown FSL specific sys entry
chown system system /sys/class/backlight/backlight/brightness
chmod 0660 /sys/class/backlight/backlight/brightness
# Set light sensor sysfs path and light sensor threshold lux value
setprop ro.hardware.lightsensor "/sys/class/i2c-dev/i2c-0/device/0-0044/"
setprop ro.lightsensor.threshold 20
# Dectect DSF streams when scanning media
setprop ro.FSL_DSF_PARSER 1
# Allow DSD file(duration larger than 10s) can play
setprop audio.offload.min.duration.secs 10
# Enlarge limition of audio buffer allocation
setprop ro.af.client_heap_size_kbyte 32768
# enlarge media max memory size to 3G.
setprop ro.media.maxmem 3221225471
setprop wlan.interface wlan0
start vendor.wifi_hal_legacy
on boot
start audioserver
start mediadrm
start media
start drm
service wpa_supplicant /vendor/bin/hw/wpa_supplicant \
-O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1 \
-g@android:wpa_wlan0
interface android.hardware.wifi.supplicant@1.0::ISupplicant default
interface android.hardware.wifi.supplicant@1.1::ISupplicant default
interface android.hardware.wifi.supplicant@1.2::ISupplicant default
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service sensor_fusion /vendor/bin/fsl_sensor_fusion
class late_start
seclabel u:r:sensors:s0
user system
group input
oneshot
# Set watchdog timer to 30 seconds and pet it every 10 seconds to get a 20 second margin
service watchdogd /sbin/watchdogd 10 20
class core
seclabel u:r:watchdogd:s0
service dhcpcd_wlan0 /system/bin/dhcpcd -aABDKL
class main
disabled
oneshot
service dhcpcd_p2p /system/bin/dhcpcd -aABKL
class main
disabled
oneshot
service dhcpcd_eth0 /system/bin/dhcpcd -ABKL eth0
class main
disabled
oneshot
service dhcpcd_bt-pan /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_eth0 /system/bin/dhcpcd -n eth0
class main
disabled
oneshot
service iprenew_bt-pan /system/bin/dhcpcd -n
class main
disabled
oneshot
# bugreport is triggered by holding down volume down, volume up and power
service bugreport /system/bin/dumpstate -d -p -B -z \
-o /data/user_de/0/com.android.shell/files/bugreports/bugreport
class main
disabled
oneshot
keycodes 114 115 116
on fs
# mount ext4 partitions
mount_all /vendor/etc/fstab.freescale
# Adjust parameters for dm-verity device
write /sys/block/dm-0/queue/read_ahead_kb 4096
# Update dm-verity state and set partition.*.verified properties
verity_update_state
on verity-logging
exec u:r:slideshow:s0 -- /sbin/slideshow warning/verity_red_1 warning/verity_red_2
on post-fs
# Set netd memlock rlimit to 8MB
setrlimit 8 8388608 8388608
# Turn on swap
swapon_all /vendor/etc/fstab.freescale
# Swap in only 1 page at a time
write /proc/sys/vm/page-cluster 0
on post-fs-data
setprop vold.post_fs_data_done 1
# create temp node for secure storage proxy
mkdir /data/vendor/ss 0700 system system
# tmp dir for opencl Compiler
setprop TMPDIR /data/vendor/.opencl-cache
mkdir /data/vendor/.opencl-cache 0771 camera camera
on zygote-start
# Create the directories used by the Wireless subsystem
mkdir /data/misc/wifi 0770 wifi wifi
mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi
mkdir /data/vendor/wifi 0771 wifi wifi
mkdir /data/vendor/wifi/wpa 0770 wifi wifi
mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
service early_init_sh /vendor/bin/init.insmod.sh /vendor/etc/early.init.cfg sys.all.early_init.ready
class main
user root
group root system
disabled
oneshot
on property:sys.boot_completed=1 && property:vendor.storageproxyd=trusty
start storageproxyd
service storageproxyd /vendor/bin/storageproxyd -p /data/vendor/ss -r /dev/mmcblk0rpmb -d /dev/trusty-ipc-dev0
group system
on property:ro.boot.vendor.sysrq=1
write /proc/sys/kernel/sysrq 1