-
Notifications
You must be signed in to change notification settings - Fork 3
/
init.omap4430.rc
339 lines (278 loc) · 11.2 KB
/
init.omap4430.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
import init.omap4430.usb.rc
on init
loglevel 8
# See storage config details at http://source.android.com/tech/storage/
mkdir /mnt/shell/emulated 0700 shell shell
mkdir /storage/emulated 0555 root root
export EXTERNAL_STORAGE /storage/emulated/legacy
export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
export EMULATED_STORAGE_TARGET /storage/emulated
# 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
# create removable USB Mass Storage mountpoints
mkdir /storage/usb0 0000 system system
mkdir /storage/usb1 0000 system system
# power management
# Enable off mode by default
# write /sys/kernel/debug/pm_debug/enable_off_mode 1
on fs
mkdir /factory 0775 radio radio
mount ext4 /dev/block/platform/omap/omap_hsmmc.1/by-name/system /system wait rw
mount_all /fstab.otter2
setprop ro.crypto.fuse_sdcard true
# pvr module
insmod /system/lib/modules/pvrsrvkm_sgx540_120.ko
insmod /system/lib/modules/omaplfb_sgx540_120.ko
on post-fs
# We chown/chmod /data again so because mount is run as root + defaults
# chown system system /data
# chmod 0771 /data
chmod 0666 /dev/pvrsrvkm
# change permissions for mtd device
chmod 0660 /dev/mtd/mtd0
chown media media /dev/mtd/mtd0
# change permissions for i2c-2 device
chmod 0660 /dev/i2c-2
chown media media /dev/i2c-2
# change permissions for Tiler driver
chmod 0777 /dev/tiler
chmod 0777 /dev/dmm
# Set default maximum of 1008 on cpu0 (peformance settings will change this if set by user)
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1008000
#Give system ownership and permission to boost clock for specified timeout
#Note boost_timeout cannot be changed from application because of dynamic sysfs creation. It will have default value of 3 sec.
chown system system /sys/devices/system/cpu/cpu0/cpufreq/boost_cpufreq
chmod 0664 /sys/devices/system/cpu/cpu0/cpufreq/boost_cpufreq
# Boost the CPU for 30 secs during boot
write /sys/devices/system/cpu/cpufreq/interactive/boost_timeout 30000000
write /sys/devices/system/cpu/cpu0/cpufreq/boost_cpufreq 1
# change permissions for ION driver
chmod 0777 /dev/ion
# We chown/chmod /factory because mount is run as root + defaults
chown radio radio /factory
chmod 0775 /factory
# add symlink for HDCP key
# symlink /factory/hdcp.keys /system/vendor/firmware/hdcp.key
# change permissions for Sensors
# bma250
chown system system /sys/bus/i2c/devices/4-0018/delay
chmod 0771 /sys/bus/i2c/devices/4-0018/delay
chown system system /sys/bus/i2c/devices/4-0018/enable
chmod 0771 /sys/bus/i2c/devices/4-0018/enable
# stk-als22x7
chown system system /sys/bus/i2c/devices/4-0010/enable
chmod 0771 /sys/bus/i2c/devices/4-0010/enable
# change permissions for alsa nodes
chmod 0777 /dev/snd/controlC0
chmod 0777 /dev/snd/pcmC0D0p
chmod 0777 /dev/snd/pcmC0D1c
chmod 0777 /dev/snd/pcmC0D1p
chmod 0777 /dev/snd/pcmC0D2c
chmod 0777 /dev/snd/pcmC0D3c
chmod 0777 /dev/snd/pcmC0D3p
chmod 0777 /dev/snd/pcmC0D4c
chmod 0777 /dev/snd/pcmC0D4p
chmod 0777 /dev/snd/pcmC0D5c
chmod 0777 /dev/snd/pcmC0D5p
chmod 0777 /dev/snd/timer
# change permissions for modem
chmod 0660 /dev/ttyS0
chown radio radio /dev/ttyS0
# change permissions for Thermal sensor TMP105
chmod 0777 /sys/class/hwmon/hwmon0/device/temp1_max
chmod 0777 /sys/class/hwmon/hwmon0/device/temp1_max_hyst
# change permissions for Tiler driver
chown media media /dev/tiler
chmod 0666 /dev/tiler
# LEDs
chmod 0777 /dev/ilitek_ctrl
chmod 0777 /sys/class/leds/lcd-backlight/brightness
chmod 0666 /sys/class/leds/led-green/brightness
chmod 0666 /sys/class/leds/led-orange/brightness
chown system system /sys/class/leds/lcd-backlight/brightness
chown system system /sys/class/leds/led-green/brightness
chown system system /sys/class/leds/led-orange/brightness
# Revert the boost_timeout to the default value of 3 sec. Note this won't affect the prev boost
# request for boot time reduction
write /sys/devices/system/cpu/cpufreq/hotplug/boost_timeout 3000000
# Set current permissions for charge protection
chown system system /sys/class/power_supply/usb/device/charge_command
chown system system /sys/class/power_supply/usb/device/charge_current
chown system system /sys/class/power_supply/usb/device/float_voltage
chown system system /sys/class/power_supply/usb/device/bad_battery
# wi-fi
setprop wifi.interface "wlan0"
setprop softap.interface "wlan0"
insmod /system/lib/modules/compat.ko
insmod /system/lib/modules/cfg80211.ko
insmod /system/lib/modules/mac80211.ko
insmod /system/lib/modules/wl12xx.ko
on post-fs-data
mkdir /data/tmp 0777 system system
symlink /data/tmp /tmp
# make dir for trace
mkdir /data/trace 0777 system system
chmod 0777 /data/trace
# symlink egl.cfg
symlink /sys/egl/egl.cfg /system/lib/egl/egl.cfg
# mount system ro
mount ext4 /dev/block/platform/omap/omap_hsmmc.1/by-name/system /system ro remount
# wifi
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
mkdir /data/smc 0770 drmrpc drmrpc
chown drmrpc drmrpc /data/smc/counter.bin
chown drmrpc drmrpc /data/smc/storage.bin
chown drmrpc drmrpc /data/smc/system.bin
setprop vold.post_fs_data_done 1
start sdcard
on boot
mount debugfs /sys/kernel/debug /sys/kernel/debug
setprop ro.radio.noril yes
# change permissions for overlay managers and display devices
chown system system /sys/devices/platform/omapdss/display0/enabled
chown system system /sys/devices/platform/omapdss/display1/enabled
chown system system /sys/devices/platform/omapdss/display2/enabled
chown system system /sys/devices/platform/omapdss/display3/enabled
chown system system /sys/devices/platform/omapdss/display0/name
chown system system /sys/devices/platform/omapdss/display1/name
chown system system /sys/devices/platform/omapdss/display2/name
chown system system /sys/devices/platform/omapdss/display3/name
chown system system /sys/devices/platform/omapdss/overlay0/manager
chown system system /sys/devices/platform/omapdss/overlay1/manager
chown system system /sys/devices/platform/omapdss/overlay2/manager
chown system system /sys/devices/platform/omapdss/overlay3/manager
chown system system /sys/devices/platform/omapdss/overlay0/zorder
chown system system /sys/devices/platform/omapdss/overlay1/zorder
chown system system /sys/devices/platform/omapdss/overlay2/zorder
chown system system /sys/devices/platform/omapdss/overlay3/zorder
# change permissions for manager tranparency parameters
chown system system /sys/devices/platform/omapdss/manager0/name
chown system system /sys/devices/platform/omapdss/manager0/display
chown system system /sys/devices/platform/omapdss/manager1/name
chown system system /sys/devices/platform/omapdss/manager1/display
chown system system /sys/devices/platform/omapdss/manager2/name
chown system system /sys/devices/platform/omapdss/manager2/display
chown system system /sys/devices/platform/omapdss/overlay0/enabled
chown system system /sys/devices/platform/omapdss/overlay1/enabled
chown system system /sys/devices/platform/omapdss/overlay2/enabled
chown system system /sys/devices/platform/omapdss/overlay3/enabled
# change permissions for display timings to get the resolutions
chown system system /sys/devices/platform/omapdss/display0/timings
chown system system /sys/devices/platform/omapdss/display1/timings
chown system system /sys/devices/platform/omapdss/display2/timings
chown system system /sys/devices/platform/omapdss/display3/timings
chown system system /sys/devices/platform/omapdss/display2/code
# fake some battery state
setprop status.battery.state Slow
setprop status.battery.level 5
setprop status.battery.level_raw 50
setprop status.battery.level_scale 9
service fixmac /system/bin/fix-mac.sh
class core
user root
group root
oneshot
service hwprops /sbin/hwprops
critical
disabled
oneshot
# initialize the SGX driver
service pvrsrvinit /system/vendor/bin/pvrsrvinit
class core
user root
group root
oneshot
# create filesystems if necessary
service setup_fs /system/bin/setup_fs \
/dev/block/platform/omap/omap_hsmmc.1/by-name/cache \
/dev/block/platform/omap/omap_hsmmc.1/by-name/userdata
class core
user root
group root
oneshot
###################################################
# MSHIELD SMC Daemon - component required to store persistent data coming
# from the SMC PA to the device persistent storage
###################################################
service tf_daemon /system/bin/tf_daemon \
-d -c /vendor/etc/smc_normal_world_android_cfg.ini
class main
user root
group root
oneshot
disabled
###################################################
# MSHIELD SMC PA Control - installs the SMC PA into the Secure Environment
###################################################
service smc_pa /system/bin/smc_pa_ctrl \
-c /vendor/etc/smc_normal_world_android_cfg.ini \
start /vendor/firmware/smc_pa.ift
class core
user root
group root
oneshot
# 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)
service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023
class late_start
disabled
# wifi services
service p2p_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -N \
-ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf -puse_p2p_group_interface=1
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service wpa_supplicant /system/bin/wpa_supplicant \
-iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf -e/data/misc/wifi/entropy.bin
class main
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL
class main
disabled
oneshot
service iprenew_wlan0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service dhcpcd_p2p /system/bin/dhcpcd -aABKL
class main
disabled
oneshot
service iprenew_p2p /system/bin/dhcpcd -n
class main
disabled
oneshot
service dhcpcd_eth0 /system/bin/dhcpcd -ABKL
class main
disabled
oneshot
service dhcpcd_bnep0 /system/bin/dhcpcd -ABKL
class main
disabled
oneshot
service iprenew_bnep0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service hostapd_bin /system/bin/hostapd -d /data/misc/wifi/hostapd.conf
socket wpa_wlan0 dgram 660 wifi wifi
class main
disabled
oneshot
#on property:init.svc.smc_pa=stopped
# start tf_daemon
#service watchdog /sbin/watchdog
# user root
# oneshot
on property:sys.boot_completed=1