Gadget: gadget cdrom, renamed kbd and disk
This commit is contained in:
parent
2633827025
commit
6258164c72
@ -7,15 +7,17 @@ echo "Disable gadget"
|
|||||||
echo "" > UDC
|
echo "" > UDC
|
||||||
|
|
||||||
echo "Clean up configs"
|
echo "Clean up configs"
|
||||||
rm configs/c.1/hid.usb0
|
rm configs/c.1/hid.kbd0
|
||||||
rm configs/c.1/mass_storage.1
|
rm configs/c.1/mass_storage.disk1
|
||||||
|
rm configs/c.1/mass_storage.cdrom1
|
||||||
|
|
||||||
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.kbd0
|
||||||
rmdir functions/mass_storage.1
|
rmdir functions/mass_storage.disk1
|
||||||
|
rmdir functions/mass_storage.cdrom1
|
||||||
|
|
||||||
echo "Clean up strings"
|
echo "Clean up strings"
|
||||||
rmdir strings/0x409
|
rmdir strings/0x409
|
||||||
|
@ -28,19 +28,27 @@ echo 250 > configs/c.1/MaxPower
|
|||||||
echo "Creating usb devices"
|
echo "Creating usb devices"
|
||||||
# Gadget HID Keyboard
|
# Gadget HID Keyboard
|
||||||
echo " HID Keyboard"
|
echo " HID Keyboard"
|
||||||
mkdir -p functions/hid.usb0
|
mkdir -p functions/hid.kbd0
|
||||||
echo 1 > functions/hid.usb0/protocol
|
echo 1 > functions/hid.kbd0/protocol
|
||||||
echo 1 > functions/hid.usb0/subclass
|
echo 1 > functions/hid.kbd0/subclass
|
||||||
echo 8 > functions/hid.usb0/report_length
|
echo 8 > functions/hid.kbd0/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.kbd0/report_desc
|
||||||
|
|
||||||
|
|
||||||
echo " Mass storage"
|
echo " Mass storage"
|
||||||
mkdir -p functions/mass_storage.1
|
mkdir -p functions/mass_storage.disk1
|
||||||
|
|
||||||
|
echo " CD-ROM"
|
||||||
|
mkdir -p functions/mass_storage.cdrom1
|
||||||
|
echo 1 > functions/mass_storage.cdrom1/lun.0/cdrom
|
||||||
|
echo 1 > functions/mass_storage.cdrom1/lun.0/removable
|
||||||
|
|
||||||
|
|
||||||
echo "Activating gadgeds"
|
echo "Activating gadgeds"
|
||||||
ln -s functions/hid.usb0 configs/c.1/
|
ln -s functions/hid.kbd0 configs/c.1/
|
||||||
ln -s functions/mass_storage.1 configs/c.1/
|
ln -s functions/mass_storage.disk1 configs/c.1/
|
||||||
|
ln -s functions/mass_storage.cdrom1 configs/c.1/
|
||||||
|
|
||||||
|
|
||||||
echo "Turn on gadget"
|
echo "Turn on gadget"
|
||||||
ls /sys/class/udc > UDC
|
ls /sys/class/udc > UDC
|
||||||
|
Loading…
Reference in New Issue
Block a user