LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-02-2008, 06:24 AM   #1
Robert_A
LQ Newbie
 
Registered: Jun 2008
Posts: 8

Rep: Reputation: 0
Question Mount userspace directory as "/dev" block device for USB Gadget API?


Hi all,

On my embedded ARM platform I try to set up an USB "device" which contains the file/folder structure of an UPnP Server.
A USB host (e.g. the Windows PC) should be able to view the contents of the UPnP Server.

To accomplish this I tried the following:

- I successfully use FUSE+DJMount to mount an Upnp-Server to a userspace directory (/tmp/upnp).
- I successfully load the Kernel Module "g_file_storage.ko" with e.g. "file=/dev/sda1" to set up a USB device (with die filesystem of a USB stick, connected to the ARM dev. board).

BUT: When I try to load the Kernel Module "g_file_storage.ko" with my userspace directory "file=/tmp/upnp" it comes to the following error message:

insmod: cannot insert '../g_file_storage.ko': Is a directory (-1): Is a directory
modprobe: failed to load module g_file_storage

In the documentation of the Kernelmodule g_file_storage it says that only block devices or single files (partitions) can be loaded. So this explains why modprobe fails!

Now I'm looking for a way to either mount my "tmp/upnp" directory to a /dev/xyz device or to configure the Kernel module "g_file_storage" to support userspace directories...
Or, can my FUSE file system be found in the /dev tree?

I hope you can point me in the right direction,

Thanks in advance,
Robert
 
Old 06-06-2008, 10:17 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
It took me a while to figure out your situation, but I think I've got it now. You're trying to make your Linux host into a giant thumb drive, right? Since the USB Gadget API binds the USB to a block device, and your Fuse filesystem is really a 'fake' filesystem, there is no block device to which the USB Gadget can bind. Sounds to me like you're hooped, unless you convert your Fuse filesystem to a bona fide block device running in kernel space. Too bad; it would have been a nice way to accomplish your objective.
--- rod.
 
Old 06-09-2008, 02:32 AM   #3
Robert_A
LQ Newbie
 
Registered: Jun 2008
Posts: 8

Original Poster
Rep: Reputation: 0
Question

Quote:
Originally Posted by theNbomr View Post
It took me a while to figure out your situation, but I think I've got it now. You're trying to make your Linux host into a giant thumb drive, right?
Hi thNbomr,

thanks for your answer, you got my situation completely right!
Since there are a lot of applications which use FUSE as virtual Filesystem I thought it would be a good approach to connect it to the USB Gadget API!

As you got my situation right, can you think of another solution to my problems?

I can't believe that there is no FUSE to /dev "wrapper" ...

Thanks,
Robert
 
Old 06-11-2008, 01:32 AM   #4
Robert_A
LQ Newbie
 
Registered: Jun 2008
Posts: 8

Original Poster
Rep: Reputation: 0
no more answers? thx.
 
Old 06-11-2008, 07:32 AM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Sorry, I just don't see your approach working. A filesystem is not a block device. Maybe somewhere out there is a "Block Device in User Space" package. If not, here's your chance for fame and glory. :-)
--- rod.
 
Old 02-17-2011, 02:26 AM   #6
neu_yang
LQ Newbie
 
Registered: Feb 2011
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by Robert_A View Post
Hi all,

On my embedded ARM platform I try to set up an USB "device" which contains the file/folder structure of an UPnP Server.
A USB host (e.g. the Windows PC) should be able to view the contents of the UPnP Server.

To accomplish this I tried the following:

- I successfully use FUSE+DJMount to mount an Upnp-Server to a userspace directory (/tmp/upnp).
- I successfully load the Kernel Module "g_file_storage.ko" with e.g. "file=/dev/sda1" to set up a USB device (with die filesystem of a USB stick, connected to the ARM dev. board).

BUT: When I try to load the Kernel Module "g_file_storage.ko" with my userspace directory "file=/tmp/upnp" it comes to the following error message:

insmod: cannot insert '../g_file_storage.ko': Is a directory (-1): Is a directory
modprobe: failed to load module g_file_storage

In the documentation of the Kernelmodule g_file_storage it says that only block devices or single files (partitions) can be loaded. So this explains why modprobe fails!

Now I'm looking for a way to either mount my "tmp/upnp" directory to a /dev/xyz device or to configure the Kernel module "g_file_storage" to support userspace directories...
Or, can my FUSE file system be found in the /dev tree?

I hope you can point me in the right direction,

Thanks in advance,
Robert
HI,Robert:

Now,I have the same problems with you? Didn't you fix it?
Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mount: /dev/sdb1 is not a valid block device zaltar Linux - General 8 07-13-2005 02:07 AM
mount: /dev/cdrom is not a valid block device aikempshall Slackware 7 01-15-2005 02:36 AM
mount: /dev/cdrom is not a valid block device abruneau Linux - General 19 02-16-2004 04:56 AM
mount: /dev/cdrom1 is not a valid block device ludwig W Linux - Newbie 1 04-20-2003 05:47 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration