summaryrefstree
path: root/system/init.recovery.mt6763.rc
blob: 11a35b89f183c7ede1a4a37bb32e6db90da9b81e (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
on init
    # Create a more standard /dev/block layout for our scripts
    symlink /dev/block/platform/bootdevice /dev/block/bootdevice

    mkdir /config
    mount configfs none /config
    mkdir /config/usb_gadget/g1 0770 shell shell
    write /config/usb_gadget/g1/idVendor 0x18d1
    write /config/usb_gadget/g1/idProduct 0xd001
    mkdir /config/usb_gadget/g1/strings/0x409 0770
    write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
    write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
    write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
    mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell
    mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
    mkdir /config/usb_gadget/g1/functions/ffs.adb
    setprop sys.usb.ffs.aio_compat 1

    # Allow writing to preloader partitions
    write /sys/block/mmcblk0boot0/force_ro 0
    write /sys/block/mmcblk0boot1/force_ro 0

on property:ro.debuggable=0
    # distinguish USB shoulde connect or not, i.e. CDP vs SDP
    write /sys/class/udc/musb-hdrc/device/cmode 2
    # set charging free due to it wait for USB activation
    start adbd

on property:sys.usb.ffs.ready=1
    write /config/usb_gadget/g1/UDC "none"
    rm /config/usb_gadget/g1/configs/b.1/f1
    rm /config/usb_gadget/g1/configs/b.1/f2
    write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb"
    write /config/usb_gadget/g1/idVendor 0x18d1
    write /config/usb_gadget/g1/idProduct 0xd001
    symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
    write /config/usb_gadget/g1/UDC "musb-hdrc"

on post-fs
    # Support A/B feature for emmc boot region
    symlink /dev/block/mmcblk0boot0 /dev/block/platform/bootdevice/by-name/preloader_a
    symlink /dev/block/mmcblk0boot1 /dev/block/platform/bootdevice/by-name/preloader_b