-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathinit.a107.rc
executable file
·295 lines (232 loc) · 9.55 KB
/
init.a107.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
on init
export PHONE_STORAGE /mnt/emmc
export DSP_PATH /system/lib/dsp
export DEFAULT_BASEIMAGE /system/lib/dsp/baseimage.dof
export QOSDYN_FILE /system/lib/dsp/qosdyn_3430.dll64P
# Create mountpoints
mkdir /mnt/emmc
mkdir /mnt/usbdisk 0000 system system
symlink /mnt/usbdisk /usbdisk
symlink /mnt/emmc /emmc
mkdir /.secure 0000 system system
mkdir /debug 0000 system system
# for a107
mkdir /tmp 0775
on fs
# Mount Android Filesystem
mount ext3 /dev/block/mmcblk0p1 /system
chmod 0755 /system
mount ext3 /dev/block/mmcblk0p1 /system ro remount
mount ext3 /dev/block/mmcblk0p2 /cache nosuid nodev
mount ext3 /dev/block/mmcblk0p3 /data nosuid nodev
mkdir /.secure
mount ext3 /dev/block/mmcblk0p4 /.secure nosuid nodev
chmod 0754 /.secure
chown system system /.secure
on post-fs
# Create data_tmp folder fot bt mac address
mkdir /data/tmp 0777 system system
# Create basic filesystem structure
mkdir /data/misc/dhcp 0770 dhcp dhcp
# Give system access to wpa_supplicant.conf for backup and restore
mkdir /data/misc/wifi/sockets 0771 wifi wifi
mkdir /data/misc/dhcp 0664 wifi wifi
# Permissions for alsa nodes
symlink /dev/snd/pcmC0D0c /dev/pcmC0D0c
symlink /dev/snd/pcmC0D0p /dev/pcmC0D0p
symlink /dev/snd/controlC0 /dev/controlC0
symlink /dev/snd/timer /dev/timer
chown audio audio /dev/pcmC0D0c
chown audio audio /dev/pcmC0D0p
chown audio audio /dev/controlC0
chown audio audio /dev/timer
# Permissions for modem
mkdir /data/modem 0770 radio radio
# Permissions for bridge. Symlink search directory
chmod 0777 /dev/DspBridge
# Permissions for Camera
chmod 0777 /dev/video5
chmod 0777 /dev/video0
# Permissions for Overlay
chmod 0777 /dev/video1
chmod 0777 /dev/video2
# Permissions for overlay managers and display devices
chown system system /sys/devices/platform/usb_mass_storage/lun1/file
chmod 0664 /sys/devices/platform/usb_mass_storage/lun1/file
chmod 0664 /sys/devices/platform/vibrator/timer
chmod 0664 /sys/devices/platform/vibrator/status
chmod 0664 /sys/devices/platform/i2c_omap.2/i2c-2/2-0010/enable
chmod 0664 /sys/devices/platform/i2c_omap.2/i2c-2/2-0010/data
chown system system /sys/devices/platform/vibrator/timer
chown system system /sys/devices/platform/vibrator/status
chown system system /sys/devices/platform/omap_wdt/watchdog_reset
chmod 0664 /sys/devices/platform/omapdss/manager0/name
chmod 0664 /sys/devices/platform/omapdss/manager1/name
chmod 0664 /sys/devices/platform/omapdss/display0/name
chmod 0664 /sys/devices/platform/omapdss/display1/name
chmod 0664 /sys/devices/platform/omapdss/display0/enabled
chmod 0664 /sys/devices/platform/omapdss/display1/enabled
chmod 0664 /sys/devices/platform/omapdss/display1/timings
chmod 0664 /sys/devices/platform/omapdss/display0/timings
chmod 0664 /sys/devices/platform/omapdss/overlay0/manager
chmod 0664 /sys/devices/platform/omapdss/overlay1/manager
chmod 0664 /sys/devices/platform/omapdss/overlay2/manager
chmod 0664 /sys/devices/platform/omapdss/overlay0/enabled
chmod 0664 /sys/devices/platform/omapdss/overlay1/enabled
chmod 0664 /sys/devices/platform/omapdss/overlay2/enabled
chown system camera /sys/devices/platform/omapdss/manager0/name
chown system camera /sys/devices/platform/omapdss/manager1/name
chown system camera /sys/devices/platform/omapdss/display0/name
chown system camera /sys/devices/platform/omapdss/display1/name
chown system camera /sys/devices/platform/omapdss/display0/enabled
chown system camera /sys/devices/platform/omapdss/display1/enabled
chown system camera /sys/devices/platform/omapdss/display1/timings
chown system camera /sys/devices/platform/omapdss/display0/timings
chown system camera /sys/devices/platform/omapdss/overlay0/manager
chown system camera /sys/devices/platform/omapdss/overlay1/manager
chown system camera /sys/devices/platform/omapdss/overlay2/manager
chown system camera /sys/devices/platform/omapdss/overlay0/enabled
chown system camera /sys/devices/platform/omapdss/overlay1/enabled
chown system camera /sys/devices/platform/omapdss/overlay2/enabled
# Permissions for Resizer
chmod 0664 /sys/devices/platform/omap_vout/video4linux/video1/isprsz_mode
chmod 0664 /sys/devices/platform/omap_vout/video4linux/video1/isprsz_enable
chmod 0664 /sys/devices/platform/omap_vout/video4linux/video2/isprsz_mode
chmod 0664 /sys/devices/platform/omap_vout/video4linux/video2/isprsz_enable
chown system camera /sys/devices/platform/omap_vout/video4linux/video1/isprsz_mode
chown system camera /sys/devices/platform/omap_vout/video4linux/video1/isprsz_enable
chown system camera /sys/devices/platform/omap_vout/video4linux/video2/isprsz_mode
chown system camera /sys/devices/platform/omap_vout/video4linux/video2/isprsz_enable
# Change G-sensor owner from root to system
chown system system /sys/devices/platform/i2c_omap.2/i2c-2/2-0053/input/input4/enable
chown system system /sys/devices/platform/i2c_omap.2/i2c-2/2-0053/input/input4/delay
# Permissions for Previewer and Resizer
chmod 0777 /dev/omap-previewer
chmod 0777 /dev/omap-resizer
chmod 0777 /dev/video6
chmod 0777 /dev/video10
chmod 0777 /dev/omap-prev2resz
on boot
# Set timeout value for rmnet stats.
write /sys/devices/virtual/net/rmnet0/timeout_suspend 5000000
# Mount Debug file system
mkdir /debug
mount debugfs debugfs /debug
# Enabling sleep in idle path
write /debug/pm_debug/sleep_while_idle 1
# Enabling Voltage OFF in idle path
write /debug/pm_debug/voltage_off_while_idle 1
# Enabling OFF mode
write /debug/pm_debug/enable_off_mode 1
# Enable SmartReflex autocompensation on VDD1 & VDD2
write /debug/pm_debug/smartreflex/sr_core/autocomp 1
write /debug/pm_debug/smartreflex/sr_mpu/autocomp 1
# Enablig DVFS with ondemand governor
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor ondemand
# Power Management
write /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate 40000
# Permissions for setting the DSP Frequency
chown media root /sys/power/dsp_freq
# WiFi
chown wifi wifi /sys/class/rfkill/rfkill0/state
chmod 0664 /sys/class/rfkill/rfkill0/state
# Bluetooth
chown system system /dev/ttyO1
#chown bluetooth bluetooth /dev/ttyO1
chmod 0664 /dev/ttyO1
chown bluetooth bluetooth /sys/class/rfkill/rfkill1/state
chmod 0664 /sys/class/rfkill/rfkill1/state
# GPS
chown system system /dev/ttyO0
chmod 0664 /dev/ttyO0
#chown system system /dev/ttyVSP0
#chmod 0664 /dev/ttyVSP0
#chown system system /dev/ttyVSP1
#chmod 0664 /dev/ttyVSP1
chown system system /sys/class/rfkill/rfkill2/state
chmod 0664 /sys/class/rfkill/rfkill2/state
setprop ro.kernel.android.gps gps
mkdir /data/gps 0777 system system
chmod 0777 /data/gps
write /sys/class/rfkill/rfkill2/state 0
write /sys/class/rfkill/rfkill3/state 0
write /sys/class/rfkill/rfkill2/state 1
write /sys/class/rfkill/rfkill3/state 1
write /sys/class/rfkill/rfkill3/state 0
# Define modem related settings
setprop ro.radio.use-ppp yes
setprop keyguard.no_require_sim 1
setprop ro.config.nocheckin yes
# SGX driver
chmod 0666 /dev/pvrsrvkm
class_start default
# Initialize the SGX driver
service pvrsrvinit /system/bin/pvrsrvinit
user root
oneshot
#service ril-daemon /system/bin/rild -l /system/lib/libsierra-ril.so -- -d /dev/ttyUSB2
#service ril-daemon /system/bin/rild -l /system/lib/libenforaedg308-ril.so -- -d /dev/pts/0
#socket rild stream 660 root radio
#socket rild-debug stream 660 radio system
#user root
#group radio cache inet misc audio
# pppd settings
#service pppd_3g /system/bin/pppd call options.ppp
#user root radio
#group radio cache inet misc
#disabled
#oneshot
service ins_ehci /system/bin/insmod /system/etc/ppp/ehci-hcd.ko
user root radio
group radio cache inet misc
disabled
oneshot
service rm_ehci /system/bin/rmmod ehci_hcd
user root radio
group radio cache inet misc
disabled
oneshot
service uim /system/bin/uim-sysfs
user root
group media bluetooth
oneshot
service hciattach /system/bin/brcm_patchram_plus -d --enable_hci --patchram /vendor/firmware/bcm4329.hcd --baudrate 3000000 --bd_addr 00:01:36:87:65:43 /dev/ttyO1
user root
# Changing user to root from bluetooth is a potential security issue
group bluetooth net_bt_admin misc
disabled
oneshot
# OMAP specific services
# load DSP firmware
service baseimage /system/bin/cexec.out /system/lib/dsp/baseimage.dof
user root
group audio
oneshot
#service pppd_gprs /etc/init.gprs-pppd /dev/pts/1
#user root
#group radio cache inet misc
#disabled
# Camera FW3A service
#service fw3a /system/bin/fw3a_core
#user media
#group system camera
service wpa_supplicant /system/bin/wpa_supplicant -Dwext -ieth0 -c/data/misc/wifi/wpa_supplicant.conf
socket wpa_eth0 dgram 0660 wifi system
disabled
oneshot
service dhcpcd /system/bin/dhcpcd -ABKL eth0
disabled
oneshot
service dhcpcd_eth0 /system/bin/dhcpcd -ABKL eth0
disabled
oneshot
service gps-test /system/bin/scmd_4751 /dev/ttyO0
user root
group root
oneshot
service gps-daemon /system/vendor/bin/glgps -c /system/vendor/gps/glconfig.xml
user root
group root
#service BT_ADDR /system/bin/getBTMac.sh
#user root
#oneshot