Hi, all You can simply hack file_storage like this: 1. When gadget_connect/disconnect() hook get called, you can deliver an udev event to userspace. 2. Write some udev scripts to handle the special udev event and mount / umount your disk. 2010/1/29 Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>: > On Thu, 28 Jan 2010, Sergey Lapin wrote: > >> Hi, all! >> >> What is usage scenario for file storage gadget? I need to achieve this goal: >> >> USB cable is out -> /dev/sdaX is mounted om /data and accessible within a device >> USB cable is inserted -> /dev/sda is unmounted and then exported with >> g_{file,mass}_storage >> USB cable is removed -> /dev/sdaX is mounted back. >> >> How could I achieve this in generic way? > > Currently there is no way to achieve this. You would need to modify > all the USB device controller drivers. Make them export a file in > sysfs containing the current connection state and allow processes to > poll that file. > > Alan Stern > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html