diff options
author | luigi <luigi@FreeBSD.org> | 2007-02-03 02:08:20 +0800 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2007-02-03 02:08:20 +0800 |
commit | d72165b21d0f66449ec68ca442490bbdaafdffea (patch) | |
tree | 24c9d5f2c10b3afbf6c5311d93a8d44fd9b7a7cd | |
parent | 692677bf1bf7201a5834ef7483dd40876c1e5849 (diff) | |
download | freebsd-ports-gnome-d72165b21d0f66449ec68ca442490bbdaafdffea.tar.gz freebsd-ports-gnome-d72165b21d0f66449ec68ca442490bbdaafdffea.tar.zst freebsd-ports-gnome-d72165b21d0f66449ec68ca442490bbdaafdffea.zip |
Add new port for linux-kmod-compat - emulation layer to build
linux device drivers as FreeBSD kld modules. Details at
http://info.iet.unipi.it/~luigi/FreeBSD/linux_bsd_kld.html
Two ports for webcam drivers that use this package are coming in
a matter of minutes.
NOTES:
+ This is only for 6.x and 7.x, no support planned for earlier versions.
+ At the moment only i386 but have patches for 64-bit architectures
that should be committed soon.
+ This port installs a file in /usr/share/mk . After some discussion
on the ports list this seems, to be the most reasonable thing to do.
portlint complains about it.
+ portlint also complains because the url in pkg-descr does not contain
'www'. Can't help it, the url really does not contain 'www'.
+ The emulation code is under active development so expect frequent
updates to the portversion and related entries.
+ For the same reason, at this time i prefer not to list all individual
files in pkg-plist. When the thing has settled a bit more, I will reconsider
this choice.
+ Documentation is a bit lacking - hopefully it is coming too, as part
of the ongoing development.
And finally - i have almost spent more time to prepare the port
(including discussing choices, location and studying the ports
infrastructure) than writing the linux emulation code. If some of
the ports guru wants to help cleaning up mistakes that i may have
made, i''l be grateful (but please don't set up a static pkg-plist,
for the reasons above).
-rw-r--r-- | devel/linux-kmod-compat/Makefile | 53 | ||||
-rw-r--r-- | devel/linux-kmod-compat/distinfo | 3 | ||||
-rw-r--r-- | devel/linux-kmod-compat/pkg-descr | 12 | ||||
-rw-r--r-- | devel/linux-kmod-compat/pkg-plist | 6 |
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 |