summaryrefstree
path: root/boot/ramdisk/init.target.recovery.rc
blob: 3dbf703b52db3d8103c5e8d7f61b561712112a6c (plain)
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
on init
# setup the global environment
    export EXTERNAL_STORAGE /storage/sdcard0

# create mountpoints
    mkdir /mnt/sdcard 0000 system system
    mkdir /mnt/usb 0000 system system

# Backwards Compat - XXX: Going away in G*
    symlink /mnt/sdcard /sdcard

# NETWORK: NAT setting
# To prevent out of WINDOW ACK from making
# connection tracking to treat them as INVALID packet
    write /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal 1



# TODO: Remove un-necessary partition in "on emmc" section after mfgkernel
#       is ready, it should be independent to system & data partition
on emmc-fs
    mkdir /system
    mkdir /data 0771 system system
    mkdir /persist 0771 system system

    mkdir /devlog 0700 root root
    devwait emmc@devlog
    exec /sbin/e2fsck_recvy -p emmc@devlog
    mount ext4 emmc@devlog /devlog noatime nosuid nodev data=ordered

    mkdir /tombstones 0771 system system
    mkdir /tombstones/mdm 0771 system system
    mkdir /tombstones/modem 0771 system system
    mkdir /tombstones/lpass 0771 system system
    mkdir /tombstones/dsps 0771 system system

    # For firmwares
    mkdir /firmware 0771 system system
    mkdir /vendor 0771 system system
    mkdir /vendor/firmware 0771 system system

    # 8064 has only mdm, use radio partition for it.
    mkdir /firmware/mdm 0771 system system
    devwait emmc@radio
    mount vfat emmc@radio /firmware/mdm ro shortname=lower
    exec /system/bin/sh2 /init.qcom.firmware_links.sh /firmware/mdm/image /vendor/firmware "*.mbn *.img"

    mkdir /data/qcks 0700 root system
    mount tmpfs tmpfs /data/qcks size=20m,mode=0750,gid=1000

    mkdir /data/efs 0700 root system
    mount tmpfs tmpfs /data/efs size=20m,mode=0750,gid=1000

    #qmuxd require
    mkdir /data/radio 0771 radio radio
    mkdir /firmware/q6 0771 system system
    devwait emmc@adsp
    mount vfat emmc@adsp /firmware/q6 ro shortname=lower
    exec /system/bin/sh2 /init.qcom.firmware_links.sh /firmware/q6 /vendor/firmware "q6.*"

on post-fs-data
    mkdir /data/radio 0770 radio radio
    chmod 2770 /data/radio
#+SSD_RIL: from Qualcomm socket path
    chmod 2770 /dev/socket/qmux_radio
    mkdir /dev/socket/qmux_audio 0770 audio audio
    chmod 2770 /dev/socket/qmux_audio
    mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth
    chmod 2770 /dev/socket/qmux_bluetooth
#-SSD_RIL: from Qualcomm socket path

    # HTC add: 3LM setting on ICS
    setprop ro.3lm.production 1

    # HTC add: 3LM encryption on ICS
    setprop ro.3lm.legacy_encryption 1
    mkdir /data/secure 0755 system system
    mkdir /data/secure/data 0755 system system
    mount tmpfs tmpfs /data/secure/data mode=0755,gid=1000

	# HTC add: for customization wizard folder
	mkdir /data/data/cw 0770 root root
	mkdir /data/data/cwtemp 0770 root root

	# HTC add: double check the perms of /data/data for already existed case
	chown system system /data/data
	chmod 0771 /data/data

	# If there is no fs-post-data action in the init.<device>.rc file, you
	# must uncomment this line, otherwise encrypted filesystems
	# won't work.
	# Set indication (checked by vold) that we have finished this action
	setprop vold.post_fs_data_done 1

on boot

    # Temp disable 3 cpus to prevent heat for DLX
    write /sys/devices/system/cpu/cpu1/online 0
    write /sys/devices/system/cpu/cpu2/online 0
    write /sys/devices/system/cpu/cpu3/online 0
    chmod 444 /sys/devices/system/cpu/cpu1/online
    chmod 444 /sys/devices/system/cpu/cpu2/online
    chmod 444 /sys/devices/system/cpu/cpu3/online

# set RLIMIT_NICE to allow priorities from 19 to -20
    setrlimit 8 268435456 268435456

# HTC SSD Camera
    chown media system /sys/camera_htccallback/htccallback
    chown media system /sys/camera_attrs/videochat

# HTC SSD USB
    chown system system /sys/class/android_usb/f_modem/on
    chown system system /sys/class/android_usb/f_diag/on
    chown system system /sys/class/android_usb/f_rmnet/on

#set diag permissions
    chown radio radio /dev/diag
    chown radio radio /dev/diag_mdm
    chown radio radio /dev/htcdiag
    chown radio radio /dev/diag_arm9
    chown radio radio /dev/btdiag
    chmod 0660 /dev/diag
    chmod 0660 /dev/diag_mdm
    chmod 0660 /dev/htcdiag
    chmod 0660 /dev/diag_arm9
    chmod 0660 /dev/btdiag

	chown root system /proc/driver/hdf
	chmod 0664 /proc/driver/hdf

#set touch permissions
    chown system system /sys/android_touch/unlock

# HTC SSD Camera
    chown media system /sys/camera_htccallback/htccallback
    chown media system /sys/camera_attrs/videochat

# Define TCP buffer sizes for various networks
#   ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
    setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
    setprop net.tcp.buffersize.wifi    524288,1048576,2097152,262144,524288,1048576
    setprop net.tcp.buffersize.lte     4094,87380,1220608,4096,16384,1220608
    setprop net.tcp.buffersize.umts    4094,87380,110208,4096,16384,110208
    setprop net.tcp.buffersize.hspa    4094,87380,1220608,4096,16384,1220608
    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.edge    4093,26280,35040,4096,16384,35040
    setprop net.tcp.buffersize.gprs    4092,8760,11680,4096,8760,11680
    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

# To prevent out of order acknowledgements from making
# connection tracking to treat them as not belonging to
# the connection they belong to.
# Otherwise, a weird issue happens in which some long
# connections on high-throughput links get dropped when
# an ack packet comes out of order
    write /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal 1


service port-bridge /system/bin/port-bridge /dev/smd0 /dev/ttyHSUSB0

service mfgsrv /sbin/mfgsrv -i -t /dev/ttyHSL0 -t /dev/ttyHSUSB1
    class core
    user root
    group root
    disabled

service kickstart /system/bin/qcks -1 modem_st1 -2 modem_st2 -3 radio_config -i /vendor/firmware/
    class core
    user root
    oneshot
    disabled

service htc_ebdlogd /sbin/htc_ebdlogd_recvy -s -k -F /sbin -p V
    class core
    user root
    disabled
    oneshot
    ioprio idle 0

service mfg_htcqxdm2sd /sbin/mfg_htcqxdm2sd -d 1
    disabled
    oneshot

service servicemanager /system/bin/servicemanager
    critical
    oneshot
    disabled

service media /system/bin/mediaserver
    class main
    user root
    disabled
    group audio camera inet net_bt net_bt_admin net_bw_acct drmrpc
    ioprio rt 4

on property:ro.bootmode=power_test
    devwait emmc@system
    mount ext4 emmc@system /system ro

on property:ro.bootmode=recovery
    devwait emmc@system
#    mount ext4 emmc@system /system ro
#    umount /system
    # we will remap this as /mnt/sdcard with the sdcard fuse tool
    mkdir /data 0771 system system
    devwait emmc@userdata
    mount ext4 emmc@userdata /data
    mkdir /data/media 0775 media_rw media_rw
    chown media_rw media_rw /data/media
    umount /data

on property:ro.mfgkernel=1
    write /sys/power/wake_lock mfgkernel

#on property:ro.bootmode=recovery
#   write /sys/devices/platform/android_usb/host_mode 1

#on property:ro.bootmode=recovery_manual
#   write /sys/devices/platform/android_usb/host_mode 1

on property:ro.9kramdump=0
    start kickstart

on property:ro.build.tags=test-keys
    start htc_ebdlogd

# Backward compatibility
on property:ro.sf=0
    mount debugfs /sys/kernel/debug /sys/kernel/debug

service hdf /sbin/hdf
    class core
	oneshot

service ril-daemon /system/bin/rild
    class main
    socket rild stream 660 root radio
    socket rild-debug stream 660 radio system
    user root
    group radio cache inet misc audio sdcard_rw qcom_oncrpc diag

on property:dev.bootcomplete=1
    start bootcomplete

service bootcomplete /system/bin/bootcomplete
    user root
    group root
    disabled
    oneshot

service shutdown /system/bin/shutdown
    user root
    group root
    disabled
    oneshot

service charging /system/bin/charging
    user root
    group root
    disabled
    oneshot

service post-boot /system/bin/sh /system/etc/init.post_boot.sh
    user root
    oneshot