I'm wondering if it's possible to make a Linux system appear like an USB peripheral.
Like smartphones which can switch from master to slave depending on the device they are connected to, I would like to know if it's possible to have the same behavior with a Linux system.
For example, I have an embedded Linux on a card with usb connectors, when I plug a usb key to this card, the usb key is detected as a slave device and mounted on the file system. Now if I connect my card to my computer I would like to have it recognized as usb slave device too.
Do you think it's possible?
I found a similar question asked but not answered Use a Linux directory as a USB-OTG device to an Android phone?
I finaly chose to try to configure the system as MTP device instead of presenting it as mass storage for those reasons :
- Protect against concurrent file access
- Protect system against crash or corruption due to concurrent file access or bad mounting/unmounting
- Possibility to expose root file system without unmounting or stopping it
- Possibility to share multiple devices
As I have some problems configuring it I oppened a new question here for those interested.