Re: compiling out-of-tree kernel modules for kFreeBSD (was Re: Error during compiling kernel module at generating file vnode_if.h.)

2011-06-18 Thread Robert Millan
2011/6/18 Benjamin Kaduk ka...@mit.edu:
 For stock
 FreeBSD, I can integrate with the bsd.kmod.mk system makefile which
 simplifies things greatly.  Is there a similar standard mechanism by which
 to build an out-of-tree kernel module on Debian/kFreeBSD?

You can use bsd.kmod.mk on Debian all the same.  Make sure you
have installed:

freebsd-buildutils
kfreebsd-headers-8.2-1-amd64 (= 8.2-2)

then:

SYSDIR=/usr/src/kfreebsd-headers-8.2-1-amd64/sys
PATH=/usr/lib/freebsd:$PATH make

For an example of this in action see:

http://people.debian.org/~rmh/fuse/

(Note: this package still needs cleanup, but the build system works)

-- 
Robert Millan


--
To UNSUBSCRIBE, email to debian-bsd-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/banlktikmxuqyjof0kltqwapepksjwdv...@mail.gmail.com



compiling out-of-tree kernel modules for kFreeBSD (was Re: Error during compiling kernel module at generating file vnode_if.h.)

2011-06-17 Thread Benjamin Kaduk

[removing the bug from the cc]

On Fri, 17 Jun 2011, Robert Millan wrote:


2011/6/17 Benjamin Kaduk ka...@mit.edu:

On Fri, 17 Jun 2011, Robert Millan wrote:


I'm wondering if it'd make sense to stop providing kfreebsd-source-*
packages.  Unlike linux-source-*, figuring out how to properly use
this build system is very complicated (e.g. export PATH so that
`awk' is /usr/lib/freebsd/awk).


Stock FreeBSD has a 'buildenv' toplevel make target (usually used for
cross-compiling with a different TARGET, I think).  I wonder if it could be
leveraged to help with this sort of issue.


We have a set of hacks that make kernel of FreeBSD buildable.  The
problem is that these are only applied in the Debian package.  We
could move this know-how into a Makefile and include that into
/usr/src, but TBH I don't think it's worth it.  People who want to rebuild
kFreeBSD on Debian/GNU world could just apt-get source -b kfreebsd-8
instead.


This reminds me -- I have been working on-and-off at porting the OpenAFS 
network filesystem to kFreeBSD (it has a Debian package, and I maintain 
the FreeBSD port of it), but it requires a kernel module.  The approach 
that we seem to have historically been taken is roughly build a kernel, 
and copy the CFLAGS over for the module build, but this is pretty ugly. 
For stock FreeBSD, I can integrate with the bsd.kmod.mk system makefile 
which simplifies things greatly.  Is there a similar standard mechanism by 
which to build an out-of-tree kernel module on Debian/kFreeBSD?


Thanks,

Ben Kaduk