blob: d6f77c11da6d2f00c77cf8ee1d005022e34317c9 [file] [log] [blame]
on init
write /proc/sys/kernel/hung_task_timeout_secs 0
mount configfs none /config
mkdir /config/usb_gadget/g1
mkdir /config/usb_gadget/g1/strings/0x409
mkdir /config/usb_gadget/g1/configs/b.1
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409
mkdir /config/usb_gadget/g1/functions/ffs.adb 0770 shell shell
on boot
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}
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "Conf 1"
write /config/usb_gadget/g1/configs/b.1/MaxPower 0x1f4
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/ffs.adb
chown system system /dev/dun
chown system system /dev/dun2
setprop sys.usb.ffs.aio_compat 1
setprop sys.usb.configfs 1
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb && property:sys.usb.configfs=1
write /config/usb_gadget/g1/idVendor 0x04E8
write /config/usb_gadget/g1/idProduct 0x685D
setprop sys.usb.state ${sys.usb.config}