aboutsummaryrefslogtreecommitdiff
path: root/devel/linux-kmod-compat
diff options
context:
space:
mode:
authorLuigi Rizzo <luigi@FreeBSD.org>2007-02-02 18:08:20 +0000
committerLuigi Rizzo <luigi@FreeBSD.org>2007-02-02 18:08:20 +0000
commit2892f3e420d6a4b79bc1819dc4bcab418d96fad1 (patch)
treeb5fe39428910967bb57be92b7fd5d6e96b1a1f2c /devel/linux-kmod-compat
parentbb0c3bda54187e99da6574f7892f9a8a46d04984 (diff)
Notes
Diffstat (limited to 'devel/linux-kmod-compat')
-rw-r--r--devel/linux-kmod-compat/Makefile53
-rw-r--r--devel/linux-kmod-compat/distinfo3
-rw-r--r--devel/linux-kmod-compat/pkg-descr12
-rw-r--r--devel/linux-kmod-compat/pkg-plist6
4 files changed, 74 insertions, 0 deletions
diff --git a/devel/linux-kmod-compat/Makefile b/devel/linux-kmod-compat/Makefile
new file mode 100644
index 000000000000..9fb1c93bee96
--- /dev/null
+++ b/devel/linux-kmod-compat/Makefile
@@ -0,0 +1,53 @@
+# New ports collection makefile for: linux-bsd-kmod
+# Date created: 1 February 2007
+# Whom: luigi
+#
+# $FreeBSD$
+
+PORTNAME= linux-kmod-compat
+PORTVERSION= 20070202
+CATEGORIES= emulators linux multimedia
+MASTER_SITES= http://info.iet.unipi.it/~luigi/FreeBSD/
+EXTRACT_SUFX= .tgz
+
+MAINTAINER= luigi@FreeBSD.org
+COMMENT= Adaptation layer to build linux drivers on FreeBSD
+
+WRKSRC= ${WRKDIR}/linux_compat
+
+NO_PACKAGE= depends on kernel sources
+
+# At the moment, emulation is only partial, but amd64 is coming
+ONLY_FOR_ARCHS= i386
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 602100
+BROKEN= Requires a recent USB stack. you have ${OSVERSION}
+.endif
+
+# Here is where install most things except the .mk file
+MY_DST= ${DESTDIR}${PREFIX}/share/${PORTNAME}/linux_compat
+MY_MK= bsd.linux_kmod.mk
+
+# Update the header location in the .mk
+post-patch:
+ @${REINPLACE_CMD} -e 's|^KLINPATH.*|KLINPATH?= ${MY_DST}|' \
+ ${WRKSRC}/${MY_MK}
+
+do-build: # nothing to build here, just a chance to update the source.
+
+# Install bsd.linux_kmod.mk into /usr/share/mk so it can be found without
+# extra arguments. All other files go into ${MY_DST}, with proper updating
+# of owner and permissions. INSTALL is not recursive so we simulate it
+# with cp -r/chmod/chown
+
+do-install:
+ ${INSTALL_DATA} ${WRKSRC}/bsd.linux_kmod.mk /usr/share/mk
+ ${MKDIR} ${MY_DST}
+ ${CP} -Rp ${WRKSRC}/* ${MY_DST}
+ ${FIND} ${MY_DST} -type f -exec ${CHMOD} ${SHAREMODE} \{\} \;
+ # XXX TODO: fix modes on directories
+ ${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${MY_DST}
+
+.include <bsd.port.post.mk>
diff --git a/devel/linux-kmod-compat/distinfo b/devel/linux-kmod-compat/distinfo
new file mode 100644
index 000000000000..23f0d6c79ed4
--- /dev/null
+++ b/devel/linux-kmod-compat/distinfo
@@ -0,0 +1,3 @@
+MD5 (linux-kmod-compat-20070202.tgz) = f7a92dae511fdc8fa321c4dd1b2ba392
+SHA256 (linux-kmod-compat-20070202.tgz) = 3e4c6eb9aad38f62056477f70ab6063c2c3e6c59d05019f1254908293036f1de
+SIZE (linux-kmod-compat-20070202.tgz) = 76791
diff --git a/devel/linux-kmod-compat/pkg-descr b/devel/linux-kmod-compat/pkg-descr
new file mode 100644
index 000000000000..2b2c1e549019
--- /dev/null
+++ b/devel/linux-kmod-compat/pkg-descr
@@ -0,0 +1,12 @@
+This port is an emulation layer to port linux device drivers to FreeBSD,
+mostly oriented to USB device drivers where FreeBSD support is weaker.
+It contains:
+- a set of headers with declarations for entities used in the Linux kernel;
+- a compatibility library (in source form) mapping [part of] the linux kernel
+ APIs to equivalent FreeBSD APIs;
+- a template for character device drivers.
+Ideally, the porting of a linux driver should be as simple as downloading
+the linux driver sources, writing a simple Makefile.kmod, and running
+"make -f Makefile.kld" to produce your driver.ko.
+Full details at
+ http://info.iet.unipi.it/~luigi/FreeBSD/linux_bsd_kld.html
diff --git a/devel/linux-kmod-compat/pkg-plist b/devel/linux-kmod-compat/pkg-plist
new file mode 100644
index 000000000000..5f2d2cd50a64
--- /dev/null
+++ b/devel/linux-kmod-compat/pkg-plist
@@ -0,0 +1,6 @@
+@comment All files but one are in the (private) directory share/linux-bsd-kmod
+@unexec echo "Uninstalling from %D/share/linux-bsd-kmod"
+@unexec rm -rf %D/share/linux-bsd-kmod
+@comment This .mk really goes into /usr/share/mk
+@cwd /usr/share/mk
+bsd.linux_kmod.mk