forked from Zanooda/android_device_huawei_charlotte
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathinit.recovery.usb.rc
executable file
·606 lines (542 loc) · 33.1 KB
/
init.recovery.usb.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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
on init && property:sys.usb.configfs=1
mount configfs none /config
mkdir /config/usb_gadget/g1
write /config/usb_gadget/g1/bcdDevice 0x0299
mkdir /config/usb_gadget/g1/strings/0x409
chmod 0640 /config/usb_gadget/g1/strings/0x409/serialnumber
write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
mkdir /config/usb_gadget/g1/configs/b.1
write /config/usb_gadget/g1/configs/b.1/MaxPower 0x1f4
write /config/usb_gadget/g1/configs/b.1/bmAttributes 0xc0
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409
mkdir /config/usb_gadget/g1/functions/ffs.adb
mkdir /config/usb_gadget/g1/functions/ffs.hdb
mkdir /config/usb_gadget/g1/functions/mtp.gs0
mkdir /config/usb_gadget/g1/functions/ptp.gs1
mkdir /config/usb_gadget/g1/functions/accessory.gs2
mkdir /config/usb_gadget/g1/functions/audio_source.gs3
mkdir /config/usb_gadget/g1/functions/rndis.gs4
mkdir /config/usb_gadget/g1/functions/midi.gs5
mkdir /config/usb_gadget/g1/functions/mass_storage.gs6
mkdir /config/usb_gadget/g1/functions/ncm.gs7
write /config/usb_gadget/g1/functions/ncm.gs7/host_addr ${ro.serialno}
write /config/usb_gadget/g1/functions/ncm.gs7/qmult 64
mkdir /config/usb_gadget/g1/functions/balong_acm.a_at
mkdir /config/usb_gadget/g1/functions/balong_acm.acm_3g_diag
mkdir /config/usb_gadget/g1/functions/balong_acm.acm_a_shell
mkdir /config/usb_gadget/g1/functions/balong_acm.acm_c_shell
mkdir /config/usb_gadget/g1/functions/balong_acm.acm_ctrl
mkdir /config/usb_gadget/g1/functions/balong_acm.acm_4g_diag
mkdir /config/usb_gadget/g1/functions/balong_acm.acm_gps
mkdir /config/usb_gadget/g1/functions/balong_acm.acm_cdma_log
mkdir /config/usb_gadget/g1/functions/balong_acm.acm_skytone
mkdir /config/usb_gadget/g1/functions/balong_acm.acm_modem
mkdir /config/usb_gadget/g1/functions/hw_acm.hw_acm_modem
mkdir /config/usb_gadget/g1/functions/hw_acm.hw_acm_PCUI
mkdir /config/usb_gadget/g1/functions/hw_acm.hw_acm_DIAG
mkdir /config/usb_gadget/g1/functions/SourceSink.gs10
write /config/usb_gadget/g1/os_desc/use 1
write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100"
symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
chown system system /sys/class/android_usb/android0/f_rndis/ethaddr
chmod 0660 /sys/class/android_usb/android0/f_rndis/ethaddr
chown system system /sys/class/android_usb/android0/switch_request
chmod 0664 /sys/class/android_usb/android0/switch_request
# f_fs
mkdir /dev/usb-ffs 0770 shell shell
mkdir /dev/usb-ffs/adb 0770 shell shell
mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
# f_fs_hdb
mkdir /dev/usb-ffs/hdb 0770 shell shell
mount functionfs hdb /dev/usb-ffs/hdb uid=2000,gid=2000
on post-fs-data && property:sys.usb.configfs=1
write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
setprop sys.usb.config adb
on charger-config-usb_gadget && property:sys.usb.configfs=1
write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
on property:sys.usb.config=none && property:sys.usb.configfs=1
write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
write /config/usb_gadget/g1/UDC "none"
stop adbd
stop hdbd
setprop sys.usb.ffs.ready 0
setprop sys.usb.ffs_hdb.ready 0
write /config/usb_gadget/g1/bDeviceClass 0
write /config/usb_gadget/g1/bDeviceSubClass 0
write /config/usb_gadget/g1/bDeviceProtocol 0
write /sys/devices/virtual/android_usb/android0/port_mode 1
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x103A
start adbd
setprop sys.usb.ffs.ready 1
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && property:sys.usb.configfs=1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
write /sys/devices/virtual/android_usb/android0/port_mode 2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mtp && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
write /sys/devices/virtual/android_usb/android0/port_mode 3
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
setprop sys.usb.ffs.ready 1
on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start adbd
setprop sys.usb.ffs.ready 1
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /sys/devices/virtual/android_usb/android0/port_mode 4
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mtp,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_hdb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start hdbd
on property:sys.usb.ffs_hdb.ready=1 && property:sys.usb.config=mtp,hdb && property:sys.usb.configfs=1
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.hdb /config/usb_gadget/g1/configs/b.1/f2
write /sys/devices/virtual/android_usb/android0/port_mode 25
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mtp,adb,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb_hdb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start adbd
start hdbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs_hdb.ready=1 && property:sys.usb.config=mtp,adb,hdb && property:sys.usb.configfs=1
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.hdb /config/usb_gadget/g1/configs/b.1/f3
write /sys/devices/virtual/android_usb/android0/port_mode 26
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=ptp && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file ${ro.cust.cdrom}
symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f2
write /sys/devices/virtual/android_usb/android0/port_mode 5
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp_adb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file ${ro.cust.cdrom}
symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
write /sys/devices/virtual/android_usb/android0/port_mode 6
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=ptp,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp_hdb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start hdbd
on property:sys.usb.ffs_hdb.ready=1 && property:sys.usb.config=ptp,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file ${ro.cust.cdrom}
symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.hdb /config/usb_gadget/g1/configs/b.1/f3
write /sys/devices/virtual/android_usb/android0/port_mode 29
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=ptp,adb,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ptp_adb_hdb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start adbd
start hdbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs_hdb.ready=1 && property:sys.usb.config=ptp,adb,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file ${ro.cust.cdrom}
symlink /config/usb_gadget/g1/functions/ptp.gs1 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/ffs.hdb /config/usb_gadget/g1/configs/b.1/f4
write /sys/devices/virtual/android_usb/android0/port_mode 30
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=manufacture && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
stop hdbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "manufacture"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
symlink /config/usb_gadget/g1/functions/hw_acm.hw_acm_modem /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/hw_acm.hw_acm_PCUI /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/hw_acm.hw_acm_DIAG /config/usb_gadget/g1/configs/b.1/f3
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file none
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f4
write /sys/devices/virtual/android_usb/android0/port_mode 14
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.start_atdiag 1
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=manufacture,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "manufacture_adb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start adbd
start hdbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs_hdb.ready=1 && property:sys.usb.config=manufacture,adb && property:sys.usb.configfs=1
symlink /config/usb_gadget/g1/functions/hw_acm.hw_acm_modem /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/hw_acm.hw_acm_PCUI /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/hw_acm.hw_acm_DIAG /config/usb_gadget/g1/configs/b.1/f3
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file none
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f4
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f5
symlink /config/usb_gadget/g1/functions/ffs.hdb /config/usb_gadget/g1/configs/b.1/f6
write /sys/devices/virtual/android_usb/android0/port_mode 14
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.start_atdiag 1
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=accessory && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory"
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x2d00
symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1
write /sys/devices/virtual/android_usb/android0/port_mode 11
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_adb"
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x2d01
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1
symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /sys/devices/virtual/android_usb/android0/port_mode 12
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=audio_source && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "audiosource"
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x2d02
symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f1
write /sys/devices/virtual/android_usb/android0/port_mode 21
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "audiosource_adb"
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x2d03
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1
symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /sys/devices/virtual/android_usb/android0/port_mode 22
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=accessory,audio_source && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_audiosource"
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x2d04
symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f2
write /sys/devices/virtual/android_usb/android0/port_mode 23
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "accessory_audiosource_adb"
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x2d05
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1
symlink /config/usb_gadget/g1/functions/accessory.gs2 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/audio_source.gs3 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
write /sys/devices/virtual/android_usb/android0/port_mode 24
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=midi && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "midi"
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x4ee9
symlink /config/usb_gadget/g1/functions/midi.gs5 /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=midi,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "midi_adb"
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0x4ee9
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=midi,adb && property:sys.usb.configfs=1
symlink /config/usb_gadget/g1/functions/midi.gs5 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=rndis && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x108a
write /sys/class/android_usb/android0/f_rndis/wceis 1
symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1
write /sys/devices/virtual/android_usb/android0/port_mode 9
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
write /sys/class/net/rndis0/queues/rx-0/rps_cpus f
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_adb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x108a
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1
write /sys/class/android_usb/android0/f_rndis/wceis 1
symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /sys/devices/virtual/android_usb/android0/port_mode 10
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
write /sys/class/net/rndis0/queues/rx-0/rps_cpus f
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=rndis,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_hdb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x108a
start hdbd
on property:sys.usb.ffs_hdb.ready=1 && property:sys.usb.config=rndis,hdb && property:sys.usb.configfs=1
write /sys/class/android_usb/android0/f_rndis/wceis 1
symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.hdb /config/usb_gadget/g1/configs/b.1/f2
write /sys/devices/virtual/android_usb/android0/port_mode 27
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
write /sys/class/net/rndis0/queues/rx-0/rps_cpus f
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=rndis,adb,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_adb_hdb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x108a
start adbd
start hdbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs_hdb.ready=1 && property:sys.usb.config=rndis,adb,hdb && property:sys.usb.configfs=1
write /sys/class/android_usb/android0/f_rndis/wceis 1
symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.hdb /config/usb_gadget/g1/configs/b.1/f3
write /sys/devices/virtual/android_usb/android0/port_mode 28
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
write /sys/class/net/rndis0/queues/rx-0/rps_cpus f
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mass_storage && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mass_storage"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file none
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f1
write /sys/devices/virtual/android_usb/android0/port_mode 7
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mass_storage,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mass_storage_adb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mass_storage,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file none
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /sys/devices/virtual/android_usb/android0/port_mode 8
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mass_storage,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mass_storage_hdb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start hdbd
on property:sys.usb.ffs_hdb.ready=1 && property:sys.usb.config=mass_storage,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file none
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.hdb /config/usb_gadget/g1/configs/b.1/f2
write /sys/devices/virtual/android_usb/android0/port_mode 31
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mass_storage,adb,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mass_storage_adb_hdb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start adbd
start hdbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs_hdb.ready=1 && property:sys.usb.config=mass_storage,adb,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file none
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.hdb /config/usb_gadget/g1/configs/b.1/f3
write /sys/devices/virtual/android_usb/android0/port_mode 32
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=hisuite,mtp,mass_storage && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "hisuite_mtp_mass_storage"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file ${ro.cust.cdrom}
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f2
write /sys/devices/virtual/android_usb/android0/port_mode 35
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=hisuite,mtp,mass_storage,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "hisuite_mtp_mass_storage_adb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=hisuite,mtp,mass_storage,adb && property:sys.usb.configfs=1
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file ${ro.cust.cdrom}
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
write /sys/devices/virtual/android_usb/android0/port_mode 15
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=hisuite,mass_storage && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "hisuite_mass_storage"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file ${ro.cust.cdrom}
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f1
write /sys/devices/virtual/android_usb/android0/port_mode 35
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=hisuite,mass_storage,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "hisuite_mass_storage_adb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=hisuite,mass_storage,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file ${ro.cust.cdrom}
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /sys/devices/virtual/android_usb/android0/port_mode 15
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=hisuite,mtp,mass_storage,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "hisuite_mtp_mass_storage_hdb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start hdbd
on property:sys.usb.ffs_hdb.ready=1 && property:sys.usb.config=hisuite,mtp,mass_storage,hdb && property:sys.usb.configfs=1
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file ${ro.cust.cdrom}
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.hdb /config/usb_gadget/g1/configs/b.1/f3
write /sys/devices/virtual/android_usb/android0/port_mode 33
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=hisuite,mtp,mass_storage,adb,hdb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "hisuite_mtp_mass_storage_adb_hdb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start adbd
start hdbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.ffs_hdb.ready=1 && property:sys.usb.config=hisuite,mtp,mass_storage,adb,hdb && property:sys.usb.configfs=1
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/functions/mass_storage.gs6/lun.0/file ${ro.cust.cdrom}
symlink /config/usb_gadget/g1/functions/mass_storage.gs6 /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/ffs.hdb /config/usb_gadget/g1/configs/b.1/f4
write /sys/devices/virtual/android_usb/android0/port_mode 34
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=rndis,serial && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
stop adbd
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_serial"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
write /sys/class/android_usb/android0/f_rndis/wceis 1
symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/hw_acm.hw_acm_modem /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/hw_acm.hw_acm_PCUI /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/hw_acm.hw_acm_DIAG /config/usb_gadget/g1/configs/b.1/f4
write /sys/devices/virtual/android_usb/android0/port_mode 36
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.start_atdiag 1
setprop sys.usb.start_modempcui 0
write /sys/class/net/rndis0/queues/rx-0/rps_cpus f
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=rndis,serial,adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/UDC "none"
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_serial_adb"
write /config/usb_gadget/g1/idVendor 0x12d1
write /config/usb_gadget/g1/idProduct 0x107e
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,serial,adb && property:sys.usb.configfs=1
write /sys/class/android_usb/android0/f_rndis/wceis 1
symlink /config/usb_gadget/g1/functions/rndis.gs4 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/hw_acm.hw_acm_modem /config/usb_gadget/g1/configs/b.1/f2
symlink /config/usb_gadget/g1/functions/hw_acm.hw_acm_PCUI /config/usb_gadget/g1/configs/b.1/f3
symlink /config/usb_gadget/g1/functions/hw_acm.hw_acm_DIAG /config/usb_gadget/g1/configs/b.1/f4
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f5
write /sys/devices/virtual/android_usb/android0/port_mode 37
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.start_atdiag 1
setprop sys.usb.start_modempcui 0
write /sys/class/net/rndis0/queues/rx-0/rps_cpus f
setprop sys.usb.state ${sys.usb.config}