• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

examples/H01-Nov-2013-1,2951,028

test/H01-Nov-2013-554451

AUTHORSH A D23-Jul-20111 KiB1917

ChangesH A D01-Nov-20134.8 KiB127107

Fuse.pmH A D01-Nov-201328.4 KiB898124

Fuse.xsH A D01-Nov-201354.1 KiB2,3142,133

MANIFESTH A D29-Feb-2012655 4241

META.ymlH A D01-Nov-2013801 2928

Makefile.PLH A D31-Oct-20135.9 KiB162125

READMEH A D31-Oct-20137.5 KiB210155

test.plH A D22-May-2011253 96

README

1Fuse perl bindings
2==================
3
4Fuse is combination of Linux kernel module and user space library which
5enables you to write user-space filesystems. This module enables you to
6write filesystems using perl.
7
8Additional file-systems using Fuse module are released on CPAN using Fuse::
9namespace. Currently that includes only Fuse::DBI which allows you to mount
10database as file system, but there will be more.
11
12This is a pre-production release.  It seems to work quite well.  In fact, I
13can't find any problems with it whatsoever.  If you do, I want to know.
14
15INSTALLATION
16
17To install this module type the standard commands as root:
18
19   perl Makefile.PL
20   make
21   make test
22   make install
23
24
25DEPENDENCIES
26
27This module requires the FUSE C library and the FUSE kernel module.
28See http://fuse.sourceforge.net/
29
30If you intend to use FUSE in threaded mode, you need a version of Perl which
31has been compiled with USE_ITHREADS.  Then, you need to use threads and
32threads::shared.
33
34
35COPYRIGHT AND LICENCE
36
37This is contributed to the FUSE project by Mark Glines <mark@glines.org>,
38and is therefore subject to the same license and copyright as FUSE itself.
39Please see the AUTHORS and COPYING files from the FUSE distribution for
40more information.
41
42
43EXAMPLES
44
45There are a few example scripts.  You can find them in the examples/
46subdirectory.  These are:
47
48* example.pl, a simple "Hello world" type of script
49
50* loopback.pl, a filesystem loopback-device.  like fusexmp from
51               the main FUSE dist, it simply recurses file operations
52               into the real filesystem.  Unlike fusexmp, it only
53               re-shares files under the /tmp/test directory.
54
55* rmount.pl, an NFS-workalike which tunnels through SSH.  It requires
56             an account on some ssh server (obviously), with public-key
57             authentication enabled.  (if you have to type in a password,
58             you don't have this.  man ssh_keygen.).  Copy rmount_remote.pl
59             to your home directory on the remote machine, and create a
60             subdir somewhere, and then run it like:
61             ./rmount.pl host /remote/dir /local/dir
62
63* rmount_remote.pl, a ripoff of loopback.pl meant to be used as a backend
64                    for rmount.pl.
65
66
67BUGS
68
69Currently tests have been attempted and succeeded on:
70  * Ubuntu 13.04/amd64
71  * Fedora 19/amd64
72  * CentOS 6.4/amd64
73  * CentOS 5.9/amd64
74  * CentOS 5.9/i386
75  * OpenSuSE 12.3/amd64
76  * Debian 7.1/powerpc
77  * Slackware 13.1/amd64
78  * NetBSD 6.1.1/amd64
79  * FreeBSD 9.1/amd64
80  * MacOS X 10.6.8 [OSXFUSE 2.6.1]
81  * MacOS X 10.7.5 [OSXFUSE 2.6.1]
82
83
84NOTES FOR BSD USERS
85
86On NetBSD, there is a potential issue with readdir() only being called
87once when using librefuse. However, currently using Perfuse causes other
88issues (readlink() drops the last character from the read link path, and
89the block count in stat() is incorrect). We will be addressing these
90concerns with the appropriate developers in the near future.
91
92If you are using Perfuse on NetBSD, you should do the following (as root):
93
94cat >> /etc/sysctl.conf <<_EOT_
95kern.sbmax=2621440
96net.inet.tcp.sendbuf_max=2621440
97net.inet6.tcp6.sendbuf_max=2621440
98_EOT_
99sysctl -f /etc/sysctl.conf
100
101Perfuse uses TCP sockets, and needs large send buffers.
102
103On NetBSD and FreeBSD, extended attributes do not work. These are
104specifically related to the FUSE implementations on those platforms.
105
106Normally you can not mount FUSE filesystems as non-root users on FreeBSD
107and NetBSD. They can allow non-root users to mount FUSE filesystems, but
108instead of changing the mode of /dev/fuse or /bin/fusermount, you need
109to use sysctl to allow user mounts. For FreeBSD, this involves (as root):
110
111sysctl -w vfs.usermount=1
112pw usermod <your username here> -G operator
113
114And on NetBSD (also as root):
115
116sysctl -w vfs.generic.usermount=1
117chmod 0660 /dev/putter
118usermod -G wheel <your username here>
119
120
121NOTES FOR OPENBSD IN PARTICULAR
122
123Oh, hello. You're an OpenBSD user. You like your secure, minimalist OS, but
124you really want in on that FUSE-y goodness. Well, it's still pretty early
125and kind of broken, but yes, FUSE has actually made its way onto OpenBSD.
126
127That said, it's not (as of this writing) in a released version. It *has*
128made its way into OpenBSD's CVS HEAD, but unless you're feeling very
129brave, you may not want to take that leap. You should, however, read this
130mailing list thread:
131
132http://marc.info/?t=136248759400010&r=1&w=4
133
134Even after patching with the latest userspace and kernel code patches,
135I still needed to add the following to src/sys/miscfs/fuse/fuse_vfsops.c,
136as line 23:
137
138#include <sys/filedesc.h>
139
140For me, it wouldn't build otherwise. You should be familiar with building
141a kernel, and your entire userspace; if not, read the OpenBSD FAQ.
142
143Once you've built your kernel, installed it, and built and installed your
144new userspace, reboot. You may also need to copy /usr/src/lib/libfuse/fuse.h
145to /usr/include/fuse.h. (I did.) Also, for the tests, I recommend installing
146devel/p5-Lchown, and installing Filesys::Statvfs, Unix::Mknod and Test::Pod
147out of CPAN.
148
149Okay, once you've done all that, run (as root):
150
151cd /dev
152./MAKEDEV fuse
153
154If that doesn't work, do this (also as root):
155
156cd /usr/src/etc
157make
158cp etc.`uname -m`/MAKEDEV /dev
159cd /dev
160./MAKEDEV fuse
161
162Now, in your perl-fuse distribution, run:
163
164perl Makefile.PL
165make
166
167You'll probably need to 'make test' as root. If you want to run your FUSE
168filesystem as non-root, run the following (as root):
169
170sysctl kern.usermount=1
171chmod 0660 /dev/fuse0
172
173Now, you should be able to run 'make test'. Yes, there are some test
174failures. No, those actually aren't our fault. Here are some things
175you should know about the state of FUSE on OpenBSD:
176
177 * truncate() does not work. This is not our fault. The fuse kernel
178   driver doesn't implement any support for truncate(), never mind
179   libfuse. It literally doesn't do anything with it.
180 * You can't make anything other than plain files, directories and
181   symlinks right now. The kernel driver doesn't support it yet.
182 * There is a bug if a file is created in the fuse filesystem and goes
183   away, then you create another file of the same name via FUSE and
184   try to do utime(). Not sure if it's just utime() or if other things
185   trip it too, but I discovered that via playing around. I *THINK*
186   it's a vnode caching problem.
187 * There's a reason the rename() test doesn't run. IT WILL CRASH YOUR
188   KERNEL. No joke. The rename() op in the kernel driver is busted.
189 * The kernel code passes the trailing null character at the end of
190   the read symlink path in readlink(). This causes all sorts of fun
191   trouble. This needs to be fixed in the kernel driver.
192 * fuse_get_context() returns an undef, because the reimplemented
193   libfuse doesn't implement that. It also doesn't do any argument
194   handling at all. Hence why it's all #ifndef'd out for OpenBSD.
195 * mknod() will not get called to create a plain file. You need to
196   implement create(), unless the OpenBSD devs fix libfuse to call
197   mknod() for plain files.
198 * You should probably implement release(); the kernel driver whines
199   a lot about the ENOSYS if you don't.
200 * You should probably implement all of chown(), chmod() and
201   utime() and/or utimens(). The kernel driver will mask out future
202   setattr() requests if it gets ENOSYS from ANY of these. Oops.
203 * Oh, and don't interrupt the FUSE implementation while it's running.
204   If you do (or if it aborts for some reason), umount the mountpoint
205   ASAP. If you don't, and especially if you then try to mount the
206   filesystem on that mountpoint again, you can hang your kernel. Not
207   even kidding. I have done this.
208
209Anyway, happy FUSEing!
210