wow Phil, way to over complicate g_multi heh.

nano /etc/modules -> add 'g_multi file=/path/to/sdcard'

No quotes.

The above is persistent, and by its self requires a system restart in order
to become 'active' However you can also use modprobe to load the module
without a restart. Using the exact same parameters. Like this:

$ sudo modprobe g_multi file=/path/to/sdcard

So for the inexperienced. g_multi will load all three USB gadget drivers.
Equivalents to g_mass_storage, g_ether, and g_serial. In order to use the
other gadgets, they must be configured. Also, for what it is worth, only
one gadget driver can be loaded / used at a time. Hence the need for
g_multi.


On Fri, Jul 10, 2015 at 6:44 AM, Philip Polstra <ppols...@gmail.com> wrote:

> You want to use the USB gadget to export the SD Card filesystem.  This is
> similar to something I'm doing for an upcoming DEFCON talk.  Here is the
> script for that talk:
>
> #!/bin/bash
> # stop the GETTY service if needed
> if which 'systemctl' ; then
>   systemctl stop serial-getty@ttyGS0.service >/dev/null
> fi
> # unload current composite gadget
> modprobe -r g_multi
> # these variables are used to export all partitions
> fstr=""
> rostr=""
> # unmount the USB drive
> for d in $(ls /dev/sd*) ; do
>   if  echo "$d" | egrep '[1-9]$' >/dev/null ; then
>     umount $d
>     fstr+=",$d"
>     rostr+=",1"
>   fi
> done
> fstr=${fstr:1} # strip leading comma
> rostr=${rostr:1} # strip leading comma
> echo "$fstr" >/tmp/usbexports # save for later r/w export
>
> # now export it
> vend=$(( 0x1337 )) # pick your favorite vid/pid
> prod=$(( 0x1337 ))
> echo "$vend" >/tmp/usbvend # save vid/pid for r/w export
> echo "$prod" >/tmp/usbprod
> modprobe g_multi file=$fstr cdrom=0 stall=0 ro=$rostr \
>   removable=1 nofua=1 idVendor=$vend idProduct=$prod
>
>
> On Fri, Jul 10, 2015 at 9:26 AM <jlill...@gmail.com> wrote:
>
>> I have a new BBB with Debian. I want the SD Card to appear on the USB
>> port (to Host) rather than the internal memory. I find references to
>> uDev.txt and modifying other files related to boot but it seems like it;s
>> more for the pre Debain stuff.  I have the card formatted and when I ssh
>> in, I can see it mounted in /media so I am that far. I put a iDev.txt on
>> that card. What else do I change?
>>
>> Thanks
>>
>> -Jim
>>
>> --
>> 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 beagleboard+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> 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 beagleboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to