[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

fuse4bsd on kfreebsd?



Hi,

I just tried to get fuse4bsd[1] compiled on kfreebsd. Here's how far I
came and what I needed to get (not) so far.

  [1] http://fuse4bsd.creo.hu/

First I had to add some symlinks:

# ln -vis kfreebsd-source-8.1/sys /usr/src/sys
# ln -vis i386 /usr/src/sys/i686

I guess for a package, the source would be patched appropriately
instead of creating those symlinks.

I had to use freebsd-make from freebsd-buildutils since GNU Make
doesn't work (as in other places, too).

It fails with "make: don't know how to make fuse_kernel.h. Stop". This
file can be found in the fuse source package, but is not included in
the libfuse-dev binary package built from it. Probably solvable via a
wishlist against libfuse-dev.

With that file symlinked to fuse4bsd-hg/fuse_module/fuse_kernel.h, it
fails to build after a while with the following error message:

fuse_dev.c: In function `fusedev_clone':
fuse_dev.c:551: error: implicit declaration of function `unit2minor'

This seems to be a change in FreeBSD 8.x, other software (e.g. zaptel)
patched it by replacing "unit2minor(unit)" with just "unit" for
FreeBSD > 800062 or so.

Now it ends with quite some conflicting types:

cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I../include -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-common  -mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -std=iso9899:1999  -c fuse_vfsops.c
fuse_vfsops.c:216: error: conflicting types for `fuse_mount'
fuse_vfsops.c:50: note: previous declaration of `fuse_mount' was here
fuse_vfsops.c:532: error: conflicting types for `fuse_unmount'
fuse_vfsops.c:51: note: previous declaration of `fuse_unmount' was here
fuse_vfsops.c:636: error: conflicting types for `fuse_root'
fuse_vfsops.c:52: note: previous declaration of `fuse_root' was here
fuse_vfsops.c: In function `fuse_root':
fuse_vfsops.c:670: error: too many arguments to function `VOP_GETATTR'
fuse_vfsops.c: At top level:
fuse_vfsops.c:681: error: conflicting types for `fuse_statfs'
fuse_vfsops.c:53: note: previous declaration of `fuse_statfs' was here
fuse_vfsops.c:797:38: error: macro "VFS_ROOT" passed 4 arguments, but takes just 3
fuse_vfsops.c: In function `fuse_vget_i':
fuse_vfsops.c:797: error: `VFS_ROOT' undeclared (first use in this function)
fuse_vfsops.c:797: error: (Each undeclared identifier is reported only once
fuse_vfsops.c:797: error: for each function it appears in.)
*** Error code 1

I didn't manage to fix that yet.

My patches so far:

diff -r 6e862286739e fuse_module/fuse.h
--- a/fuse_module/fuse.h        Fri Feb 27 00:21:58 2009 +0200
+++ b/fuse_module/fuse.h        Wed Aug 04 22:35:35 2010 +0200
@@ -273,3 +273,6 @@
 printf("b_bcount %d, b_data %p, b_error %#x, b_iocmd %#x, b_ioflags %#x, b_iooffset %lld, b_resid %d, b_blkno %d, b_offset %lld, b_flags %#x, b_bufsize %d, b_lblkno %d, b_vp %p, b_vp_ino %llu, b_dirtyoff %d, b_dirtyend %d, b_npages %d\n", \
 (int)(bp)->b_bcount, (bp)->b_data, (bp)->b_error, (bp)->b_iocmd, (bp)->b_ioflags, (long long)(bp)->b_iooffset, (int)(bp)->b_resid, (int)(bp)->b_blkno, (long long)(bp)->b_offset, (bp)->b_flags, (int)(bp)->b_bufsize, (int)(bp)->b_lblkno, (bp)->b_vp, VTOILLU((bp)->b_vp), (int)(bp)->b_dirtyoff, (int)(bp)->b_dirtyend, (int)(bp)->b_npages)
 #endif
+
+/* Manually added, from @/sys/fcntl.h */
+#define AT_FDCWD                -100
diff -r 6e862286739e fuse_module/fuse_dev.c
--- a/fuse_module/fuse_dev.c    Fri Feb 27 00:21:58 2009 +0200
+++ b/fuse_module/fuse_dev.c    Wed Aug 04 22:35:35 2010 +0200
@@ -548,7 +548,7 @@
        /* find any existing device, or allocate new unit number */
        i = clone_create(&fuseclones, &fuse_cdevsw, &unit, dev, 0);
        if (i) {
-               *dev = make_dev(&fuse_cdevsw, unit2minor(unit),
+               *dev = make_dev(&fuse_cdevsw, unit,
                                UID_ROOT, GID_OPERATOR,
                                S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP,
                                 "fuse%d", unit);
diff -r 6e862286739e fuse_module/fuse_vfsops.c
--- a/fuse_module/fuse_vfsops.c Fri Feb 27 00:21:58 2009 +0200
+++ b/fuse_module/fuse_vfsops.c Wed Aug 04 22:35:35 2010 +0200
@@ -794,7 +794,7 @@
        if (nodeid == FUSE_ROOT_ID) {
                if (parentid != FUSE_NULL_ID)
                        return (ENOENT);
-               err = VFS_ROOT(mp, myflags, vpp, td);
+               err = VFS_ROOT(mp, myflags, vpp);
                if (err)
                        return (err);
                KASSERT(*vpp, ("we neither err'd nor found the root node"));


		Regards, Axel
-- 
 ,''`.  |  Axel Beckert <abe@debian.org>, http://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE
  `-    |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5


Reply to: