Gadget: mass storage
This commit is contained in:
parent
0d1c04a2d6
commit
2633827025
@ -8,11 +8,14 @@ echo "" > UDC
|
|||||||
|
|
||||||
echo "Clean up configs"
|
echo "Clean up configs"
|
||||||
rm configs/c.1/hid.usb0
|
rm configs/c.1/hid.usb0
|
||||||
|
rm configs/c.1/mass_storage.1
|
||||||
|
|
||||||
rmdir configs/c.1/strings/0x409
|
rmdir configs/c.1/strings/0x409
|
||||||
rmdir configs/c.1
|
rmdir configs/c.1
|
||||||
|
|
||||||
echo "Clean up functions"
|
echo "Clean up functions"
|
||||||
rmdir functions/hid.usb0
|
rmdir functions/hid.usb0
|
||||||
|
rmdir functions/mass_storage.1
|
||||||
|
|
||||||
echo "Clean up strings"
|
echo "Clean up strings"
|
||||||
rmdir strings/0x409
|
rmdir strings/0x409
|
||||||
|
@ -22,7 +22,7 @@ echo "$gmanufacturer" > strings/0x409/manufacturer
|
|||||||
echo "$gproduct" > strings/0x409/product
|
echo "$gproduct" > strings/0x409/product
|
||||||
mkdir -p configs/c.1/strings/0x409
|
mkdir -p configs/c.1/strings/0x409
|
||||||
|
|
||||||
echo "Config 1: ECM network" > configs/c.1/strings/0x409/configuration
|
echo "Config: HID KBD" > configs/c.1/strings/0x409/configuration
|
||||||
echo 250 > configs/c.1/MaxPower
|
echo 250 > configs/c.1/MaxPower
|
||||||
|
|
||||||
echo "Creating usb devices"
|
echo "Creating usb devices"
|
||||||
@ -33,7 +33,14 @@ echo 1 > functions/hid.usb0/protocol
|
|||||||
echo 1 > functions/hid.usb0/subclass
|
echo 1 > functions/hid.usb0/subclass
|
||||||
echo 8 > functions/hid.usb0/report_length
|
echo 8 > functions/hid.usb0/report_length
|
||||||
echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > functions/hid.usb0/report_desc
|
echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > functions/hid.usb0/report_desc
|
||||||
ln -s functions/hid.usb0 configs/c.1/
|
|
||||||
|
|
||||||
echo "Activate gadget"
|
echo " Mass storage"
|
||||||
|
mkdir -p functions/mass_storage.1
|
||||||
|
|
||||||
|
|
||||||
|
echo "Activating gadgeds"
|
||||||
|
ln -s functions/hid.usb0 configs/c.1/
|
||||||
|
ln -s functions/mass_storage.1 configs/c.1/
|
||||||
|
|
||||||
|
echo "Turn on gadget"
|
||||||
ls /sys/class/udc > UDC
|
ls /sys/class/udc > UDC
|
||||||
|
Loading…
Reference in New Issue
Block a user