BBB as modified file system

67 views
Skip to first unread message

ivo welch

unread,
Oct 25, 2014, 11:48:38 PM10/25/14
to beagl...@googlegroups.com

dear BBB experts:  I would like to create a high-level filesystem device on my BBB that my (possibly malicious) linux PC can communicate with over USB in EHCI (USB 2.0 high-speed).  I will want to switch off everything else, incl ethernet-over-usb, again because I will guess that my PC is infected.

from the PC perspective, I want the BBB to operate at roughly at the level of a fuse filesystem, albeit with its own processor that can enforce separation.

most importantly, I would like the BBB to hook into the "open file" request call.  for example, I want my BBB to log every file open request to its own /tmp/log/file-logged, return an error if I don't like the filename, mangle the filename (e.g., shorten it of auto-expand it), or disallow opening a file for write when a pin is bridged or when the file resides in the /ro/ part of the file system or the filename contains the string "ro".

on the PC, I want to do

   PC$ mount -t speak2mybbb /dev/usb1 /mnt/usb1  ## say my BBB sits on /dev/usb1
   PC$ echo "hi" > /mnt/usb1/rw/file2    ## create a file
   PC$ ls /mnt/usb1/rw/     ## note: my BBB has mangled the filename
   file2-mangled-file-name
   PC$ cat /mnt/usb1/rw/file2-remangleme  ## note:  my BBB can remangle and figure this out
   hi
   PC$ echo "hi" > /mnt/usb1/ro/file2  ## note: my BBB knows that /ro/ is read-only and does not allow writing here.
   ERROR: no such file or directory
   PC$ umount /dev/usb1

at first, I thought I should hook into the USB mass storage driver, because it already does EHCI and reading the USB spec, there is a lot of stuff that can go wrong.  but the problem, I believe, is that this layer operates at too low a level.  I deduct this because it supports many different higher-level file systems, like FAT or ext4.  presumably, the USB-mass storage level is primarily "sector-read" and "sector-write," which would make it very difficult to hook into a file-open.

the USB serial driver works and would allow me to filter requests, and I could write a fuse driver on the PC (not the BBB), but USB serial is slow.

has anyone created an EHCI fuse-like file-system communication example?  any pointers by experts would be highly appreciated.

regards,

/iaw

ivo welch

unread,
Oct 26, 2014, 8:31:40 PM10/26/14
to beagl...@googlegroups.com

ok, further research.  I discovered that I probably want to write a usb mtp (media transfer protocol) driver for the BBB.  if anyone has already written one, please let me know.

cla...@xenei.com

unread,
Feb 21, 2016, 12:51:58 PM2/21/16
to BeagleBoard
Ivo,

Did you ever get an MTP responder working on beagleboard?

Claude

ivo welch

unread,
Feb 21, 2016, 1:37:39 PM2/21/16
to beagl...@googlegroups.com

No.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/rcYr_v6ZP3s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Claude Warren

unread,
Feb 21, 2016, 3:18:48 PM2/21/16
to beagl...@googlegroups.com
are you still interested?  What are your requirements?  I have a project that requires MTP to present other file systems to the initiator.

Claude
Reply all
Reply to author
Forward
0 new messages