-
Notifications
You must be signed in to change notification settings - Fork 38
/
init.huawei.rc
executable file
·343 lines (279 loc) · 11.3 KB
/
init.huawei.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
339
340
341
342
343
# Copyright (c) 2009-2012, Code Aurora Forum. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of Code Aurora nor
# the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
import init.huawei.usb.rc
on init
mkdir /storage 0775 system sdcard_r
mkdir /storage/sdcard1 0000 system system
mkdir /storage/sdcard0 0000 system system
export EXTERNAL_STORAGE /storage/sdcard1
symlink /storage/sdcard1 /mnt/sdcard
symlink /storage/sdcard1 /sdcard
symlink /storage/sdcard0 /mnt/emmc
symlink /storage/sdcard0 /HWUserData
on boot
mount debugfs /sys/kernel/debug /sys/kernel/debug
chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chown bluetooth bluetooth /proc/bluetooth/sleep/proto
chmod 0660 /sys/module/bluetooth_power/parameters/power
chmod 0660 /sys/class/rfkill/rfkill0/state
chmod 0660 /proc/bluetooth/sleep/proto
chmod 0660 /proc/bluetooth/clock/proto
chown bluetooth bluetooth /dev/ttyHS0
chmod 0660 /dev/ttyHS0
chown bluetooth bluetooth /sys/devices/platform/msm_serial_hs.0/clock
chmod 0660 /sys/devices/platform/msm_serial_hs.0/clock
# port-bridge
chmod 0660 /dev/smd0
chown system system /dev/smd0
chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state
# For bridgemgr daemon to inform the USB driver of the correct transport
chown radio radio /sys/class/android_usb/f_rmnet_smd_sdio/transport
# To allow interfaces to get v6 address when tethering is enabled
write /proc/sys/net/ipv6/conf/rmnet0/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet1/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet2/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet3/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet4/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet5/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet6/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet7/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet_sdio0/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet_sdio1/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet_sdio2/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet_sdio3/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet_sdio4/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet_sdio5/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet_sdio6/accept_ra 2
write /proc/sys/net/ipv6/conf/rmnet_sdio7/accept_ra 2
chmod 0664 /dev/light
chmod 0664 /dev/proximity
chmod 0664 /dev/accel
chmod 0664 /dev/compass_aot
chmod 0664 /dev/akm8975_dev
chown system system /sys/kernel/logger/log_main/enable
chown system system /sys/kernel/logger/log_events/enable
chown system system /sys/kernel/logger/log_radio/enable
chown system system /sys/kernel/logger/log_main/priority
chown system system /sys/kernel/logger/log_events/priority
chown system system /sys/kernel/logger/log_radio/priority
chown system system /sys/devices/platform/mmi_key_dev/keytest
chmod 664 /dev/input/event1
chmod 664 /dev/input/event2
chown system system /sys/devices/platform/msm_hsusb/gadget/sdstatus
chown system system /sys/devices/platform/msm_hsusb/gadget/switchusb
chown system system /sys/devices/platform/msm_hsusb/gadget/fixusb
setprop net.tcp.buffersize.hsupa 4094,87380,1220608,4096,16384,1220608
setprop net.tcp.buffersize.hsdpa 4094,87380,1220608,4096,16384,1220608
setprop net.tcp.buffersize.evdo_b 4094,87380,262144,4096,16384,262144
# Assign TCP buffer thresholds to be ceiling value of technology maximums
# Increased technology maximums should be reflected here.
write /proc/sys/net/core/rmem_max 1220608
write /proc/sys/net/core/wmem_max 1220608
chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chown system system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
chmod 0644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
chmod 0644 /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
chown system system /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse
chmod 0644 /sys/devices/system/cpu/cpufreq/ondemand/boostpulse
chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/boostpulse
on fs
# mount mmc partitions
wait /dev/block/mmcblk0p12
mount ext4 /dev/block/mmcblk0p12 /system ro barrier=1,nodelalloc
wait /dev/block/mmcblk0p19
exec /system/bin/e2fsck -p /dev/block/mmcblk0p19
mount ext4 /dev/block/mmcblk0p19 /data nosuid nodev barrier=1 noauto_da_alloc,nodelalloc
mount ext4 /dev/block/mmcblk0p6 /cache nosuid nodev barrier=1,nodelalloc
wait /dev/block/mmcblk0p13
mount vfat /dev/block/mmcblk0p13 /storage/sdcard0 uid=1000,gid=1015,umask=0002,utf8
# Imported from init.msm7627a.rc
write /sys/module/block2mtd/parameters/block2mtd /dev/block/mmcblk0p17
# msm specific files that need to be created on /data
on post-fs-data
mkdir /data/misc/bluetooth 0770 bluetooth bluetooth
chmod 0666 /sys/class/rfkill/rfkill0/state
# Create the directories used by the Wireless subsystem
mkdir /data/misc/wifi/load 0770 wifi wifi
mkdir /data/misc/wifi/sockets 0770 wifi wifi
mkdir /data/misc/dhcp 0770 dhcp dhcp
# Create directory used by audio subsystem
mkdir /data/misc/audio 0770 audio audio
chmod 0664 /sys/devices/platform/msm_sdcc.1/polling
chmod 0664 /sys/devices/platform/msm_sdcc.2/polling
chmod 0664 /sys/devices/platform/msm_sdcc.3/polling
chmod 0664 /sys/devices/platform/msm_sdcc.4/polling
# Chown polling nodes as needed from UI running on system server
chown system system /sys/devices/platform/msm_sdcc.1/polling
chown system system /sys/devices/platform/msm_sdcc.2/polling
chown system system /sys/devices/platform/msm_sdcc.3/polling
chown system system /sys/devices/platform/msm_sdcc.4/polling
# Create directories for wiper services
mkdir /data/wpstiles/ 0755 shell
mkdir /data/wiper 0755 location qcom_oncrpc
chown system system /sys/class/android_usb/android0/f_mass_storage/lun/file
chmod 0660 /sys/class/android_usb/android0/f_mass_storage/lun/file
chown system system /sys/class/android_usb/android0/f_rndis/ethaddr
chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr
setprop vold.post_fs_data_done 1
on property:init.svc.wpa_supplicant=stopped
stop dhcpcd
on property:init.svc.bluetoothd=running
write /sys/class/bluetooth/hci0/idle_timeout 7000
service rmt_storage /system/bin/rmt_storage /dev/block/mmcblk0p10 /dev/block/mmcblk0p11 /dev/block/mmcblk0p17
class main
user root
disabled
service bt-dun /system/bin/dun-server /dev/smd7 /dev/rfcomm0
class main
disabled
oneshot
service sapd /system/bin/sdptool add --channel=15 SAP
class main
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service dund /system/bin/sdptool add --channel=1 DUN
class main
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service bridgemgrd /system/bin/bridgemgrd
class main
user radio
group radio
disabled
service port-bridge /system/bin/port-bridge /dev/smd0 /dev/ttyGS0
class late_start
user system
group system inet
disabled
on property:ro.baseband="msm"
start port-bridge
# Enable BT-DUN only for all msms
setprop ro.qualcomm.bluetooth.dun true
on property:ro.baseband="unknown"
start port-bridge
on property:wlan.driver.status=loading
start setwifimac
service pcm-bridge /system/bin/pcm-bridge /dev/smd7 /dev/ttyGS1
service qmuxd /system/bin/qmuxd
class main
user radio
group radio
service netmgrd /system/bin/netmgrd
class main
service setbtmac /system/bin/setbtmac
class main
oneshot
service setwifimac /system/bin/setwifimac
disabled
oneshot
service wpa_supplicant /system/bin/wpa_supplicant -Dnl80211 -ieth0 -puse_p2p_group_interface=1 -W -c/data/misc/wifi/wpa_supplicant.conf
class main
group wifi inet
socket wpa_eth0 dgram 660 wifi wifi
disabled
oneshot
service dhcpcd_eth0 /system/bin/dhcpcd -BKLG
class main
disabled
oneshot
service iprenew_eth0 /system/bin/dhcpcd -n
class main
disabled
oneshot
service p2p_supplicant /system/bin/wpa_supplicant -Dnl80211 -ieth0 -puse_p2p_group_interface=1 -W -c/data/misc/wifi/wpa_supplicant.conf
class main
group wifi inet
socket wpa_eth0 dgram 660 wifi wifi
disabled
oneshot
service dhcpcd_p2p /system/bin/dhcpcd -BKLG
class main
disabled
oneshot
service iprenew_p2p /system/bin/dhcpcd -n p2p
class main
disabled
oneshot
service dhcpcd_bnep0 /system/bin/dhcpcd -BKLG
class main
disabled
oneshot
service oem_rpc_svc /system/bin/oem_rpc_svc
class main
oneshot
service gps_nmea /system/bin/port-bridge /dev/nmea /dev/ttyGS1
disabled
service compassd /system/bin/compassd
class main
disabled
oneshot
service akm8975 /system/bin/akmd8975
class main
disabled
oneshot
service akm8962 /system/bin/akmd8962
class main
disabled
oneshot
service rmt_oeminfo /system/bin/rmt_oeminfo
class main
user root
oneshot
on property:ro.boot.emmc=true
start rmt_oeminfo
start rmt_storage
service hostapd /system/bin/hostapd -dddd /data/hostapd/hostapd.conf
class main
user root
group root
oneshot
disabled
service ftp /system/bin/sdptool add --psm=5257 --channel=20 FTP
class main
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service map0 /system/bin/sdptool add --channel=16 MAS0
class main
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot
service map1 /system/bin/sdptool add --channel=17 MAS1
class main
user bluetooth
group bluetooth net_bt_admin
disabled
oneshot