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
|
on emmc
mkdir /system
mkdir /data 0771 system system
mkdir /cache 0770 system cache
mkdir /devlog 0700 root root
devwait emmc@system
mount ext4 emmc@system /system ro barrier=1
devwait emmc@userdata
# exec /system/bin/e2fsck -p emmc@userdata
mount ext4 emmc@userdata /data nosuid nodev barrier=1 noauto_da_alloc
mount ext4 emmc@cache /cache nosuid nodev barrier=1
mount ext4 emmc@devlog /devlog nosuid nodev barrier=1
on early-init
device /dev/block/mmcblk0p17 0460 radio diag
on init
# double check the perms and set owner
chown root root /devlog
chmod 0700 /devlog
symlink /mnt/sdcard/ext_sd /sdcard2
mount rootfs rootfs / remount
mkdir /app-cache 1755 root system
mount tmpfs tmpfs /app-cache size=8m,mode=0755,gid=1000
mount rootfs rootfs / ro remount
#set G-Sensor and Compass permissions
chown compass system /dev/akm8975_aot
chown compass system /dev/akm8975_daemon
chown compass system /dev/bma150
chmod 0640 /dev/akm8975_aot
chmod 0640 /dev/akm8975_daemon
chmod 0640 /dev/bma150
on post-fs
#gps daemon
chmod 0774 /dev/gps_onoff
chown gps system /dev/gps_onoff
chmod 0774 /sys/class/sec/gps/GPS_nRST/value
chown gps system /sys/class/sec/gps/GPS_nRST/value
mkdir /data/gps 0777 system system
chmod 0770 /dev/ttyHS10
chown gps system /dev/ttyHS10
chmod 0777 /data/sph.cfg
chmod 0755 /system/bin/glgps
chmod 0755 /system/bin/gpslogd
chmod 0755 /system/lib/hw/gps.default.so
on boot
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
# bluetooth power up/down interface
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chmod 0660 /sys/class/rfkill/rfkill0/state
# Widevine DRM
chown drm system /dev/htcdrm
chmod 0660 /dev/htcdrm
#+SSD_RIL: from Qualcomm QMI and Netmgrd
mkdir /data/radio 0770 radio radio
mkdir /dev/socket/qmux_radio 0770 radio radio
mkdir /dev/socket/qmux_audio 0770 radio radio
mkdir /dev/socket/qmux_bluetooth 0770 radio radio
mkdir /dev/socket/qmux_gps 0770 radio radio
#-SSD_RIL: from Qualcomm QMI and Netmgrd
# HTC SSD Audio
mkdir /data/audio
chown media audio /data/audio
chmod 755 /data/audio
# for wireless modem
chown system system /sys/class/android_usb/f_serial/on
chown system system /sys/class/android_usb/f_modem/on
chown system system /sys/module/serial/parameters/modem_enabled
chown system system /dev/ttyHSUSB0
chown system system /dev/ttyHSUSB1
chown system system /dev/ttySA0
chown system system /dev/smd9
# for Flip to speaker
chown radio radio /sys/class/htc_accelerometer/accelerometer/PhoneOnOffFlag
chown radio radio /sys/class/htc_ecompass/ecompass/PhoneOnOffFlag
# for Optical sensors
chown system system /sys/class/optical_sensors/lightsensor/ls_adc
chown system system /sys/class/optical_sensors/lightsensor/ls_auto
chown system system /sys/class/optical_sensors/lightsensor/ls_kadc
chown system radio /sys/class/optical_sensors/proximity/ps_adc
chown system system /sys/class/optical_sensors/proximity/ps_kadc
chown system system /sys/class/optical_sensors/proximity/ps_led
chown system system /sys/class/optical_sensors/proximity/ps_test_mode
# for simlock
chown radio radio /dev/simlock
chmod 0660 /dev/simlock
# for charging function
chown radio radio radio /sys/class/power_supply/battery/phone_call
chmod 0220 /sys/class/power_supply/battery/phone_call
# HTC SSD Battery - BEGIN
# for RIL to notify battery driver talking and network_search state
chown radio radio /sys/class/power_supply/battery/phone_call
# HTC SSD Battery - END
# Load kineto_gan.ko while booting
insmod /system/lib/modules/kineto_gan.ko
# Load bcmdhd.ko while booting
insmod /system/lib/modules/bcmdhd.ko
# Force loading of modem and Q6 images
service load-modem /system/bin/load-modem.sh
oneshot
#service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -puse_p2p_group_interface=1
# wifi ++
service wpa_supplicant /system/bin/logwrapper /system/bin/wpa_supplicant -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -puse_p2p_group_interface=1
# we will start as root and wpa_supplicant will switch to user wifi
# after setting up the capabilities required for WEXT
# user wifi
# group wifi inet keystore
socket wpa_wlan0 dgram 660 wifi wifi
disabled
oneshot
service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL
disabled
oneshot
service dhcpcd_p2p /system/bin/dhcpcd -aABKL
disabled
oneshot
service iprenew_wlan0 /system/bin/dhcpcd -n
disabled
oneshot
service iprenew_p2p /system/bin/dhcpcd -n
disabled
oneshot
# wifi--
# for brcmgps++
service glgps /system/bin/glgps -c /system/etc/gps/gpsconfig.xml
socket gps seqpacket 0660 gps system
class main
user gps
group system sdcard_rw inet radio
# brcmgps--
# bugreport is triggered by the KEY_VOLUMEUP and KEY_VOLUMEDOWN keycodes
service bugreport /system/bin/dumpstate -d -v -o /sdcard/bugreports/bugreport
disabled
oneshot
keycodes 114 115
#service hciattach /system/bin/brcm_patchram_plus --enable_hci --patchram /etc/firmware/bcm4329.hcd /dev/ttyHS0
# user bluetooth
# group bluetooth net_bt_admin
# disabled
# Make sure we startup btld before hcid
# Set target address to emulator host loopback IF
# Limit baudrate to 460800 to ensure reliable uart operation
service btld /system/bin/btld -lpm 1 -hb 3000000
user root
group bluetooth net_bt_admin
disabled
onrestart restart bluetoothd
# for USB internet sharing
service udhcpd /system/bin/udhcpd
disabled
oneshot
service netsharing_on /system/bin/netsharing net on
disabled
oneshot
service netsharing_off /system/bin/netsharing net off
disabled
oneshot
service netsharing_pass /system/bin/netsharing net_pass on
disabled
oneshot
#+SSD_RIL
service qmuxd /system/bin/qmuxd
service netmgrd /system/bin/netmgrd
on property:ro.use_data_netmgrd=false
# netmgr not supported on specific target
stop netmgrd
#-SSD_RIL
#+SSD_RIL: from QCT Fusion
service ril-daemon1 /system/bin/rild -c 1
class late_start
socket rild1 stream 660 root radio
socket rild-debug1 stream 660 radio system
user root
disabled
group radio cache inet misc audio qcom_oncrpc diag system
#-SSD_RIL: from QCT Fusion
service rmt_storage /system/bin/rmt_storage /dev/block/mmcblk0p13 /dev/block/mmcblk0p14
class core
user root
disabled
# for modem link
service modem /system/xbin/wireless_modem
user system
group system radio
disabled
oneshot
on property:service.modem.enable=1
start modem
on property:ro.emmc=1
start rmt_storage
service dmagent /system/bin/dmagent -N -P19 -VSY
socket dmagent stream 660 root radio
user root
group radio cache inet misc
service srv_ser2net /system/bin/ser2net -n
disabled
on property:service.ser2net.enable=1
start srv_ser2net
on property:service.ser2net.enable=0
stop srv_ser2net
service hdmid /system/bin/hdmid
socket displayd stream 0660 root system graphics
service htcbatt /system/bin/htcbatt
user root
service dcvs0 /system/bin/dcvs --cpu=0 --slacktime=16
user root
disabled
service dcvs1 /system/bin/dcvs --cpu=1 --slacktime=16
user root
disabled
service mpdecision /system/bin/mpdecision --no_sleep --avg_comp --single_core_while_panel_off
user root
disabled
service thermald /system/bin/thermald
user root
disabled
on property:init.svc.bootanim=stopped
start qcom-post-boot
write /proc/sys/vm/min_free_kbytes 4096
write /proc/sys/vm/lowmem_reserve_ratio 16 32
write /sys/module/lowmemorykiller/parameters/adj 0,2,4,7,9,12
write /sys/module/lowmemorykiller/parameters/minfree 7946,9953,11960,14008,16015,20560
write /sys/module/lowmemorykiller/parameters/fork_boost_minfree 0,0,0,0,6177,6177
write /sys/module/lowmemorykiller/parameters/check_filepages 1
start mpdecision
start thermald
service qcom-post-boot /system/bin/sh /system/etc/init.qcom.post_boot.sh
user root
disabled
oneshot
service htc_ebdlogd /system/bin/htc_ebdlogd -s -k -P 7
user root
disabled
oneshot
ioprio idle 0
service htc_ebdlogd_rel /system/bin/htc_ebdlogd -s -k
user root
disabled
oneshot
ioprio idle 0
on property:ro.build.tags=test-keys
start htc_ebdlogd
on property:ro.build.tags=release-keys
start htc_ebdlogd_rel
# Widevine DRM
chown drm system /dev/htcdrm
chmod 0660 /dev/htcdrm
# HTC set radio_feedback permissions
chown radio radio /dev/radio_feedback
chmod 0660 /dev/radio_feedback
#start camera server as daemon
service qcamerasvr /system/bin/mm-qcamera-daemon
user system
group system camera inet
# Automotive connectivity
service cand /system/bin/cand
user root
# SSD Touch debug log for s-off device
on property:ro.sf=0
write /sys/android_touch/debug_level 8
# This will grant permission for LMI Rescue Start Server
chown graphics /RescueStarter
chmod 755 /RescueStarter
chown graphics /RescueServer
chmod 755 /RescueServer
# This will start LMI Rescue Start Server
service RescueStarter /system/bin/RescueStarter
class core
user graphics
group input graphics
|