View Single Post
Community Council | Posts: 4,920 | Thanked: 12,867 times | Joined on May 2012 @ Southerrn Finland
#23
Originally Posted by jackburton View Post
What's the use case for this? Why would you want to update the files from both places at once?

As long as the g_file_storage or g_mass_storage driver is being used, it cannot be done with the kernel modules as-is.

http://www.linux-usb.org/gadget/file_storage.html
Excactly. I found out the hard way trying this leads to system unstability.

Why it would be usable; The current way it's implemented is too cludgy IMHO.
  • you need a specific daemon to unmount/mount the filesystems on need and handle the exporting
  • there are applications that cannot run when MyDocs is not mounted, for example the camera and things like Easy Debian which have loop-mounted rootFS on MyDocs
  • If you have these kind of applications running, you cannot umount MyDocs before closing them
  • sometimes (yes it has happened) the state machine of usb-moded gets confused and thinks it has mounted MyDocs when it isn't and vice versa

The whole shebang would be simpler if there was a module that had this kind of functionality:
  • both USB ethernet and USB memory storage modes in one gadget
  • ability to export the backing storage in read/write mode without collisions in the locally mounted storage
  • there would be no need at all for usb-moded as user would not need to select between "SDK mode" and "USB memeory mode" and nothing would need to be mounted/unmounted ever again
  • all applications relaying on the exported filesystems could continue working all the time, transparently without need to know if the FS was exported or not

What I think happened, why this thing was done the way it is now; In symbian the devices have this kind of multiple USB modes, that users need to select; thre's mass memory mode, media transfer mode, PC suite mode, whatever.
They were unable to think outside the box at the time this was implemented, and more or less copied the symbian architecture to Harmattan without thinking of simplifying and streamlining it...