Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 04 Aug 2012 14:17:03 -0400
From:      Richard Yao <ryao@gentoo.org>
To:        "hackers@FreeBSD.org" <hackers@FreeBSD.org>
Subject:   [PATCH] Enable out-of-tree kernel module compilation with GNU xargs in $PATH
Message-ID:  <501D671F.6050904@gentoo.org>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigCF1BDC78E5715FE5A1AA728B
Content-Type: multipart/mixed; boundary="------------080506090609070404010209"

This is a multi-part message in MIME format.
--------------080506090609070404010209
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I am working on a port of a Linux kernel module to FreeBSD. I decided to
rebase on FreeBSD 9.1-BETA1. I installed Gentoo Prefix so that I would
be able to work on this port in a more familiar development environment.

Unfortunately, there is an issue where /usr/src/sys/conf/kmod.mk invokes
xargs with -J, which Gentoo Prefix's GNU xargs does not support. I have
written a patch for kmod.mk that will attempt shell substitution in
place of xargs when the current command that relies on xargs fails.

There are probably other ways of addressing this, but I just would like
this to work without requiring a patch to the system sources.

--------------080506090609070404010209
Content-Type: text/plain;
 name="patch-kmod.mk"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="patch-kmod.mk"

--- /usr/src/sys/conf/kmod.mk.orig	2012-08-02 23:49:09.749192513 -0400
+++ /usr/src/sys/conf/kmod.mk	2012-08-04 08:57:25.719110508 -0400
@@ -217,7 +217,8 @@ ${FULLPROG}: ${OBJS}
 	grep -v '^#' < ${EXPORT_SYMS} > export_syms
 .endif
 	awk -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET} \
-	    export_syms | xargs -J% ${OBJCOPY} % ${.TARGET}
+	    export_syms | xargs -J% ${OBJCOPY} % ${.TARGET} || \
+	    ${OBJCOPY} $(awk -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET} export_=
syms) ${.TARGET}
 .endif
 .endif
 .if !defined(DEBUG_FLAGS) && ${__KLD_SHARED} =3D=3D no

--------------080506090609070404010209--

--------------enigCF1BDC78E5715FE5A1AA728B
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJQHWclAAoJECDuEZm+6ExkbNIP/jK0O7GwAETGWt/Qsn9lZEpA
bVkKqrjNVAIJ8FoDVejrIv1810GF5ZU7v59ccUDCuAXMAzdz+RVBtl0SQe2qzH26
X9L0Xv70Ptt6DS23nGTDzCDx7CgwM6Od4PZGEbzHgo+hMV5ueG9CR/DazH75DKAR
XboLRrT+6jv4BsKJm5cVHpfcQgU6kAyUgMJstv4CqUiu+4pRSZOdm0taVmPfCw6F
Im2+/2pGa4xq4WqdGVIcWctMYMNpZKiskITIoaCdNDlX7xEnWthWU2dHD8ed5h8k
kJZYNBXf/Hw/iTSaKMrm9C8Rs0Fd3oS4G1vwYDI7t6UCcIATsYKGRnySzTZGcqR2
gQLZv+qRGpiV0RF0T8cvUgUr66Jfhm+vDpw5DCk5b7QgYpD6osZhDrKOYrtxZRW4
J73H55GN+Q5qVXtzJFKIVlCf+GSskZNP41qurQfQ2Wr9UikE3SctcVWxHiJD8o1F
sOr7cK4T/iG7HDYu+xqew97ImjHjB3ZPMrK71Ejo4d1UJsnpD6UDx7lXFcYaKszT
7y23v/rPQHkpHg96FQl2nu0P+rcGddJAHpisXxgF/Y3XCnx0F0h7vaotqwcREfaG
dMzL2uRb8O+RwZ0XXQ1agIomnmfHhqU8TXn0J7PXiEV2eWicCYT4Rtz4k1Nt+3V1
kgaUKI+jySFEyyz71hAt
=x9nP
-----END PGP SIGNATURE-----

--------------enigCF1BDC78E5715FE5A1AA728B--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?501D671F.6050904>