The first time:

debian@beaglebone:~$ sudo bash -ex create-hid-BB.sh
[sudo] password for debian: 
+ grep g_multi
+ lsmod
+ mount
+ grep /sys/kernel/config
+ umount /sys/kernel/config
+ mount none -t configfs /sys/kernel/config
+ kbdir=/sys/kernel/config/usb_gadget/kb
+ '[' '!' -d /sys/kernel/config/usb_gadget/kb ']'
+ mkdir /sys/kernel/config/usb_gadget/kb
+ echo 0x1337
+ echo 0x1337
+ echo 0x0100
+ echo 0x0110
+ '[' '!' -d /sys/kernel/config/usb_gadget/kb/configs/c.1 ']'
+ mkdir /sys/kernel/config/usb_gadget/kb/configs/c.1
+ echo 500
+ '[' '!' -d /sys/kernel/config/usb_gadget/kb/functions/hid.usb0 ']'
+ mkdir /sys/kernel/config/usb_gadget/kb/functions/hid.usb0
+ echo 1
+ echo 1
+ echo 8
+ cp report_descriptor_kb.bin /sys/kernel/config/usb_gadget/kb/functions/hid
.usb0/report_desc
+ ln -s /sys/kernel/config/usb_gadget/kb/functions/hid.usb0 /sys/kernel/
config/usb_gadget/kb/configs/c.1
+ '[' -d /sys/class/udc/musb-hdrc.0.auto ']'
+ '[' -d /sys/class/udc/musb-hdrc.0 ']'
+ echo musb-hdrc.0
create-hid-BB.sh: line 44: echo: write error: Device or resource busy


Same command again:
debian@beaglebone:~$ sudo bash -ex create-hid-BB.sh
+ lsmod
+ grep g_multi
+ grep /sys/kernel/config
+ mount
+ umount /sys/kernel/config
+ mount none -t configfs /sys/kernel/config
+ kbdir=/sys/kernel/config/usb_gadget/kb
+ '[' '!' -d /sys/kernel/config/usb_gadget/kb ']'
+ echo 0x1337
+ echo 0x1337
+ echo 0x0100
+ echo 0x0110
+ '[' '!' -d /sys/kernel/config/usb_gadget/kb/configs/c.1 ']'
+ echo 500
+ '[' '!' -d /sys/kernel/config/usb_gadget/kb/functions/hid.usb0 ']'
+ echo 1
create-hid-BB.sh: line 29: echo: write error: Device or resource busy




On Wednesday, November 22, 2017 at 1:34:00 PM UTC-5, RobertCNelson wrote:
>
> On Wed, Nov 22, 2017 at 12:23 PM,  <[email protected] <javascript:>> 
> wrote: 
> > I am trying to get a BBBW to register itself as a pure HID device. 
> > 
> > I'm starting with a modified version of Phil Polstra's bash script 
> presented 
> > at DEF CON (attached). His script was built originally for Ubuntu, but 
> I'm 
> > running the latest 9.1 Debian image. 
> > 
> > I have updated the original last line from echoing 'musb-hdrc.0.auto' to 
> > 'musb-hdrc.0' (for versions 4.9.x, which mine is). 
> > 
> > Here's what happens: 
> > 
> > debian@beaglebone:~$ sudo bash create-hid-BB.sh 
> > 
> > create-hid-BB.sh: line 44: echo: write error: Device or resource busy 
>
> add the -ex options to bash, so you can actually watch and therefore 
> trace what happens.. 
>
> Regards, 
>
>
> -- 
> Robert Nelson 
> https://rcn-ee.com/ 
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/6be6e25f-e072-4712-a669-c28d32217fc9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to