-
Notifications
You must be signed in to change notification settings - Fork 5
/
init.common.rc
236 lines (187 loc) · 8.06 KB
/
init.common.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
import /init.watchdog.rc
import /init.firmware.rc
import /init.intel.feature.asf.rc
import /init.intel.features.rc
import /init.ksm.rc
import /init.readahead.rc
import /init.zram.rc
on early-init
# set permission for charger-mode
chmod 0750 /charger
chown system system /dev/dri/card0
chmod 0666 /dev/dri/card0
symlink /dev/dri/card0 /dev/card0
# Enable native bridge for target executables
mount binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc
on init
# set usb serial number
write /sys/class/android_usb/android0/iSerial ${ro.serialno}
mkdir /storage/emulated 0555 root root
mkdir /mnt/shell/emulated 0700 shell shell
mkdir /mnt/media_rw/sdcard1 0700 media_rw media_rw
mkdir /mnt/media_rw/usbcard1 0700 media_rw media_rw
export EXTERNAL_STORAGE /storage/emulated/legacy
export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
export EMULATED_STORAGE_TARGET /storage/emulated
# Disable SECONDARY_STORAGE in common
# Shall enable it in product
#export SECONDARY_STORAGE /storage/sdcard1
# Support legacy paths
symlink /storage/emulated/legacy /sdcard
symlink /storage/emulated/legacy /mnt/sdcard
symlink /storage/emulated/legacy /storage/sdcard0
symlink /mnt/shell/emulated/0 /storage/emulated/legacy
# Support external SD card
mkdir /storage/sdcard1 0700 root root
# Support USB Disk
mkdir /storage/usbcard1 0700 root root
on boot
# chown system system /dev/pvr_sync
# chmod 666 /dev/pvr_sync
# chown system system /dev/dri/card0
# chmod 0666 /dev/dri/card0
# symlink /dev/dri/card0 /dev/card0
# IMG Graphics specific setup. See also "service pvrsrvctl"
# The permissions below should be tighter.
# chown system system /dev/card0
chown system system /sys/class/backlight/psb-bl/brightness
chown system system /sys/class/backlight/psb-bl/max_brightness
chown system system /sys/class/backlight/psb-bl/actual_brightness
# chmod 0666 /dev/card0
chmod 0664 /sys/class/backlight/psb-bl/brightness
chmod 0664 /sys/class/backlight/psb-bl/max_brightness
chmod 0664 /sys/class/backlight/psb-bl/actual_brightness
#Change mmc queue nr_requests from 128 to 32 to reduce write latencies
write /sys/block/mmcblk0/queue/nr_requests 32
# Change TCP Net-Core buffers sizes to improve cellular data throughput
write /proc/sys/net/core/rmem_default 1048576
write /proc/sys/net/core/rmem_max 2097152
write /proc/sys/net/core/wmem_max 1048576
#Set freezing timeout value as 2000ms
write /sys/power/pm_freeze_timeout 2000
on fs
mkdir /factory 0775 system system
mkdir /config 0775 system system
mkdir /media 0775 media media
mount_all /fstab
mkdir /config/wifi
chown system wifi /config/wifi
chmod 0770 /config/wifi
mkdir /config/em
chown system system /config/em
chmod 0770 /config/em
chown system system /sys/class/usb_otg/otg0/a_bus_drop
on post-fs
# 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 will be created with user and group media_rw (1023)
# Performance tweaks for interactive governor
chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate
chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
chown system system /sys/devices/system/cpu/cpufreq/interactive/touchboostpulse
chown system system /sys/devices/system/cpu/cpufreq/interactive/touchboostpulse_duration
chown system system /sys/devices/system/cpu/cpufreq/interactive/touchboost_freq
chmod 0220 /sys/devices/system/cpu/cpufreq/interactive/touchboostpulse
chmod 0220 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
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_usbcard1 /system/bin/sdcard -u 1023 -g 1023 -w 1023 -d /mnt/media_rw/usbcard1 /storage/usbcard1
class late_start
disabled
on post-fs-data
mkdir /data/system/ 0770 system system
write /proc/sys/kernel/ctrl-alt-del 0
mkdir /mnt/asec/media 0770 media media
# Disable data roaming option enabled by default
setprop ro.com.android.dataroaming false
# Set indication (checked by vold) that we have finished this action
setprop vold.post_fs_data_done 1
# Set this property to force the camera shutter sound to play on speaker
setprop ro.camera.sound.forced 1
# Set this property to avoid fm rx to be muted
setprop ro.fmrx.sound.forced 1
# Set this property to enable Thermal service
setprop persist.service.thermal 1
# Properties for Thermal Service
setprop persist.thermal.debug.xml 0
setprop ro.thermal.ituxversion 3.0
setprop persist.thermal.shutdown.msg 1
setprop persist.thermal.shutdown.vibra 1
setprop persist.thermal.shutdown.tone 1
setprop persist.thermal.display.msg 1
setprop persist.thermal.display.vibra 1
chown system system /sys/class/drm/card0/gt_max_freq_mhz
on property:sys.boot_completed=1
start bcu_cpufreqrel
on charger
chown system system /dev/dri/card0
chmod 0666 /dev/dri/card0
symlink /dev/dri/card0 /dev/card0
# IMG Graphics specific setup. See also "service pvrsrvctl"
# The permissions below should be tighter.
chown system system /dev/card0
start pvrsrvctl
# reduce backlight
write /sys/class/backlight/psb-bl/brightness 50
#default setting to enable charging in COS
setprop sys.usb.config charging
start thermald
service thermald /sbin/thermald
class core
oneshot
disabled
user root
service bcu_cpufreqrel /system/bin/bcu_cpufreqrel
group system
oneshot
disabled
service pvrsrvctl /system/vendor/bin/pvrsrvctl --no-module --start
class core
oneshot
user root
service ct_monitor /system/bin/ct_monitor
class core
oneshot
user root
service charger_app /charger
class charger
user root
# Enable native bridge for target executables
on property:ro.enable.native.bridge.exec=1
copy /system/etc/binfmt_misc/arm_exe /proc/sys/fs/binfmt_misc/register
copy /system/etc/binfmt_misc/arm_dyn /proc/sys/fs/binfmt_misc/register
on property:ro.enable.native.bridge.exec=0
copy /system/etc/binfmt_misc/disable /proc/sys/fs/binfmt_misc/arm_exe
copy /system/etc/binfmt_misc/disable /proc/sys/fs/binfmt_misc/arm_dyn
# This property trigger has added to imitiate the previous behavior of "adb root".
# The adb gadget driver used to reset the USB bus when the adbd daemon exited,
# and the host side adb relied on this behavior to force it to reconnect with the
# new adbd instance after init relaunches it. So now we force the USB bus to reset
# here when adbd sets the service.adb.root property to 1. We also restart adbd here
# rather than waiting for init to notice its death and restarting it so the timing
# of USB resetting and adb restarting more closely matches the previous behavior.
on property:service.adb.root=1
write /sys/class/android_usb/android0/enable 0
restart adbd
write /sys/class/android_usb/android0/enable 1
on property:sys.property_forcedshutdown=1
write /sys/module/intel_mid_osip/parameters/force_shutdown_occured 1
on property:sys.shutdown.requested=0
write /sys/devices/virtual/misc/watchdog/shutdown_ongoing 1
on property:sys.shutdown.requested=1
write /sys/devices/virtual/misc/watchdog/reboot_ongoing 1
on property:sys.shutdown.requested=1recovery
write /sys/devices/virtual/misc/watchdog/reboot_ongoing 1
on property:sys.shutdown.requested=1bootloader
write /sys/devices/virtual/misc/watchdog/reboot_ongoing 1
# bugreport is triggered by holding down volume down, volume up and power
service bugreport /system/bin/dumpstate -d -p -B \
-o /data/data/com.android.shell/files/bugreports/bugreport
class main
disabled
oneshot
keycodes 114 115 116