summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2007-07-03 11:08:00 +0000
committerRoy Marples <uberlord@gentoo.org>2007-07-03 11:08:00 +0000
commit82d052af9ad9e4657607b872c42b5e65ed3a6ea4 (patch)
treea20a0f505ad3bac75a2c4774fa1ae9e0ad862e45 /sys-freebsd
parentDropped old versions. (diff)
downloadhistorical-82d052af9ad9e4657607b872c42b5e65ed3a6ea4.tar.gz
historical-82d052af9ad9e4657607b872c42b5e65ed3a6ea4.tar.bz2
historical-82d052af9ad9e4657607b872c42b5e65ed3a6ea4.zip
Push out errata patches for GIF/IPv6 and unix domain sockets.
Package-Manager: portage-2.1.3_rc6
Diffstat (limited to 'sys-freebsd')
-rw-r--r--sys-freebsd/freebsd-sources/ChangeLog9
-rw-r--r--sys-freebsd/freebsd-sources/Manifest23
-rw-r--r--sys-freebsd/freebsd-sources/files/digest-freebsd-sources-6.2-r23
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-EN-07:02.net.patch16
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-unp_gc.patch221
-rw-r--r--sys-freebsd/freebsd-sources/freebsd-sources-6.2-r2.ebuild91
6 files changed, 358 insertions, 5 deletions
diff --git a/sys-freebsd/freebsd-sources/ChangeLog b/sys-freebsd/freebsd-sources/ChangeLog
index 2a7ea64a6cba..d14201eb905a 100644
--- a/sys-freebsd/freebsd-sources/ChangeLog
+++ b/sys-freebsd/freebsd-sources/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-freebsd/freebsd-sources
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/ChangeLog,v 1.37 2007/05/10 10:24:54 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/ChangeLog,v 1.38 2007/07/03 11:08:00 uberlord Exp $
+
+*freebsd-sources-6.2-r2 (03 Jul 2007)
+
+ 03 Jul 2007; Roy Marples <uberlord@gentoo.org>
+ +files/freebsd-sources-6.2-EN-07:02.net.patch,
+ +files/freebsd-sources-6.2-unp_gc.patch, +freebsd-sources-6.2-r2.ebuild:
+ Push out errata patches for GIF/IPv6 and unix domain sockets.
*freebsd-sources-6.2-r1 (10 May 2007)
diff --git a/sys-freebsd/freebsd-sources/Manifest b/sys-freebsd/freebsd-sources/Manifest
index 8562104b765a..d2c9dfd63fff 100644
--- a/sys-freebsd/freebsd-sources/Manifest
+++ b/sys-freebsd/freebsd-sources/Manifest
@@ -14,6 +14,10 @@ AUX freebsd-sources-6.1-ntfs.patch 1043 RMD160 0389ef971934db5b239d81ec016d94a21
MD5 ea9ee941c9105bed2e9d226450087ee1 files/freebsd-sources-6.1-ntfs.patch 1043
RMD160 0389ef971934db5b239d81ec016d94a21398c226 files/freebsd-sources-6.1-ntfs.patch 1043
SHA256 2eb0e22bea267d7ac41c3dec81682d3cc1f1744316ea39342e2aaae1f2dca469 files/freebsd-sources-6.1-ntfs.patch 1043
+AUX freebsd-sources-6.2-EN-07:02.net.patch 615 RMD160 60ca8dd926916696785b7232e3d9ba467ca1ecd8 SHA1 77e9dbb5a651f140ab4c47cb6804ba4b073dbca0 SHA256 f6b22e6afacc2c5311cf26f8f890dc46dd41d50c7a4f94e6dafb0f4d340d53a0
+MD5 b261903cb01f647b95086884e3feca55 files/freebsd-sources-6.2-EN-07:02.net.patch 615
+RMD160 60ca8dd926916696785b7232e3d9ba467ca1ecd8 files/freebsd-sources-6.2-EN-07:02.net.patch 615
+SHA256 f6b22e6afacc2c5311cf26f8f890dc46dd41d50c7a4f94e6dafb0f4d340d53a0 files/freebsd-sources-6.2-EN-07:02.net.patch 615
AUX freebsd-sources-6.2-debug-O2.patch 815 RMD160 ae2c83117b81b47589e7ee35096c94cc8eceb29b SHA1 8f20681d81b171d93005d72acfbdf19481f5100c SHA256 92a5070fbb6e951417bf83065c9f8ba11d3f5f2b17bc340f1c3080d54af52177
MD5 f2c9bb12b453528f9337ac5cfa8918ea files/freebsd-sources-6.2-debug-O2.patch 815
RMD160 ae2c83117b81b47589e7ee35096c94cc8eceb29b files/freebsd-sources-6.2-debug-O2.patch 815
@@ -30,6 +34,10 @@ AUX freebsd-sources-6.2-sparc64.patch 18794 RMD160 7e529e32924c872ea033f03c781a8
MD5 2d9b3844827a93ea31fe3189359d693f files/freebsd-sources-6.2-sparc64.patch 18794
RMD160 7e529e32924c872ea033f03c781a86031fe8d13b files/freebsd-sources-6.2-sparc64.patch 18794
SHA256 a1b5803f3366d3466ba3c07f510e0b8c72e17b515a1dc82f696e5a10bec7a60c files/freebsd-sources-6.2-sparc64.patch 18794
+AUX freebsd-sources-6.2-unp_gc.patch 6066 RMD160 a8eb464d7a41b394b190bc530532a4a8a7bdff48 SHA1 5c371253d81dd8b039413c8afa6ac9ad6b7ae27b SHA256 39ac44c64e5115b166bb2302512be5069c9d0b9405aadf312c219d49aece6882
+MD5 6e65f40b970ad42a4a0da14350a2b3ed files/freebsd-sources-6.2-unp_gc.patch 6066
+RMD160 a8eb464d7a41b394b190bc530532a4a8a7bdff48 files/freebsd-sources-6.2-unp_gc.patch 6066
+SHA256 39ac44c64e5115b166bb2302512be5069c9d0b9405aadf312c219d49aece6882 files/freebsd-sources-6.2-unp_gc.patch 6066
AUX freebsd-sources-gentoo.patch 1191 RMD160 1c8ce1849d767a995f075fe43b7313b341bd0805 SHA1 abe5d4ff186d1b9b6ad6d7af6be359563e81183b SHA256 e5e7186858259e7d6d21e925dde640a68b27255cf69ab089ee82675568e7d9a7
MD5 91662a80d0cd0cd3dca34f3c1ca54830 files/freebsd-sources-gentoo.patch 1191
RMD160 1c8ce1849d767a995f075fe43b7313b341bd0805 files/freebsd-sources-gentoo.patch 1191
@@ -39,14 +47,18 @@ EBUILD freebsd-sources-6.2-r1.ebuild 2861 RMD160 1a9795cfa3942570ee9fad66504a567
MD5 0f4558e958597470a8eae7b7852cebb9 freebsd-sources-6.2-r1.ebuild 2861
RMD160 1a9795cfa3942570ee9fad66504a56709367b17b freebsd-sources-6.2-r1.ebuild 2861
SHA256 9e594e822c4b28a5c3412e9ec50ace85f25c6f17885a890cbad58032834fecbd freebsd-sources-6.2-r1.ebuild 2861
+EBUILD freebsd-sources-6.2-r2.ebuild 2961 RMD160 ca90f67bdbb0e8dd63c40e5a278e028ef674da06 SHA1 0ffccf30b35c6ac133b94c3454fb42d83c201ce5 SHA256 cb23463204bb29f3a8282ef9afbb274c453a191f7d475aceee0dee6be64bb59e
+MD5 c350fbeb34446956c6c6639f2789699c freebsd-sources-6.2-r2.ebuild 2961
+RMD160 ca90f67bdbb0e8dd63c40e5a278e028ef674da06 freebsd-sources-6.2-r2.ebuild 2961
+SHA256 cb23463204bb29f3a8282ef9afbb274c453a191f7d475aceee0dee6be64bb59e freebsd-sources-6.2-r2.ebuild 2961
EBUILD freebsd-sources-6.2.ebuild 2746 RMD160 0ca4ceb5773bc3e2cb01fe7679aee482c194b5dc SHA1 23609b30548648578b9d3d06de8bb6dffc032a72 SHA256 8edd769332a9532e3573725d9f721966c6653c4f213b6a0379df1383445a55bc
MD5 ebc9c9463e0c1581c0959f2482f9673a freebsd-sources-6.2.ebuild 2746
RMD160 0ca4ceb5773bc3e2cb01fe7679aee482c194b5dc freebsd-sources-6.2.ebuild 2746
SHA256 8edd769332a9532e3573725d9f721966c6653c4f213b6a0379df1383445a55bc freebsd-sources-6.2.ebuild 2746
-MISC ChangeLog 10553 RMD160 d0fcdfa1ab07276bb1a6f22fccfeb84ef86ff895 SHA1 9e8b8628d42ba563e6d94c3037fa7429abb6351c SHA256 d21a4f9274039a21905099311be5a8fb3abd751d24d5e1b6b8f6263686401f9b
-MD5 ec00caf740459e655fc24f803cbe12c5 ChangeLog 10553
-RMD160 d0fcdfa1ab07276bb1a6f22fccfeb84ef86ff895 ChangeLog 10553
-SHA256 d21a4f9274039a21905099311be5a8fb3abd751d24d5e1b6b8f6263686401f9b ChangeLog 10553
+MISC ChangeLog 10830 RMD160 aab3a5d7f88b861b149c03481352427b157b596b SHA1 c1a5c654966d37c9516f349ed0d3a60a32991d6b SHA256 1f88a98426ff7b00d079a5e2e741aac03abc4c0ee107be966d38e4d6e35e8ade
+MD5 3b208123ec5a5322fb830926ec0c72ee ChangeLog 10830
+RMD160 aab3a5d7f88b861b149c03481352427b157b596b ChangeLog 10830
+SHA256 1f88a98426ff7b00d079a5e2e741aac03abc4c0ee107be966d38e4d6e35e8ade ChangeLog 10830
MISC metadata.xml 156 RMD160 60b5820a08275f307e5bd936d78f5afd1f141086 SHA1 d9d9d4f2b5afc58339ea3e562fca490156935f1f SHA256 30ab515d6ac492d3d6c36ac3c675511742c2149e56a6b3228c8d22ab8edb3ff7
MD5 2bd48a5ae413433cbb36110b219ce97c metadata.xml 156
RMD160 60b5820a08275f307e5bd936d78f5afd1f141086 metadata.xml 156
@@ -57,3 +69,6 @@ SHA256 69e6dc9f0eb26473d50a9e4ecece2a92c4177e8491dc8d5722772e3e23f9c922 files/di
MD5 44a5c3d9ab8211e3d27c2a0bd4b23e5d files/digest-freebsd-sources-6.2-r1 256
RMD160 b7c0e2d559e11b94402d2a752c3cbda7f782824b files/digest-freebsd-sources-6.2-r1 256
SHA256 69e6dc9f0eb26473d50a9e4ecece2a92c4177e8491dc8d5722772e3e23f9c922 files/digest-freebsd-sources-6.2-r1 256
+MD5 44a5c3d9ab8211e3d27c2a0bd4b23e5d files/digest-freebsd-sources-6.2-r2 256
+RMD160 b7c0e2d559e11b94402d2a752c3cbda7f782824b files/digest-freebsd-sources-6.2-r2 256
+SHA256 69e6dc9f0eb26473d50a9e4ecece2a92c4177e8491dc8d5722772e3e23f9c922 files/digest-freebsd-sources-6.2-r2 256
diff --git a/sys-freebsd/freebsd-sources/files/digest-freebsd-sources-6.2-r2 b/sys-freebsd/freebsd-sources/files/digest-freebsd-sources-6.2-r2
new file mode 100644
index 000000000000..f15ec910fc83
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/digest-freebsd-sources-6.2-r2
@@ -0,0 +1,3 @@
+MD5 79c16213744e76d3bf13a9ac21ede56d freebsd-sys-6.2.tar.bz2 18344936
+RMD160 784230e22ccaf09933ef3f053ff29cc3e579786a freebsd-sys-6.2.tar.bz2 18344936
+SHA256 a754371d88601aaab7152bb3d127bd3777db912e13a26a866e13ba34934c5e5b freebsd-sys-6.2.tar.bz2 18344936
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-EN-07:02.net.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-EN-07:02.net.patch
new file mode 100644
index 000000000000..23cb15651bbc
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-EN-07:02.net.patch
@@ -0,0 +1,16 @@
+Index: sys/netinet6/nd6.c
+===================================================================
+RCS file: /home/ncvs/src/sys/netinet6/nd6.c,v
+retrieving revision 1.48.2.15
+diff -u -r1.48.2.15 nd6.c
+--- sys/netinet6/nd6.c 7 Oct 2006 18:31:27 -0000 1.48.2.15
++++ sys/netinet6/nd6.c 15 Feb 2007 02:34:00 -0000
+@@ -1315,7 +1315,7 @@
+ callout_init(&ln->ln_timer_ch, 0);
+
+ /* this is required for "ndp" command. - shin */
+- if (req == RTM_ADD && (rt->rt_flags & RTF_STATIC)) {
++ if (req == RTM_ADD) {
+ /*
+ * gate should have some valid AF_LINK entry,
+ * and ln->ln_expire should have some lifetime
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-unp_gc.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-unp_gc.patch
new file mode 100644
index 000000000000..e3dd8c0b2af3
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-6.2-unp_gc.patch
@@ -0,0 +1,221 @@
+--- src/sys/kern/kern_descrip.c 2006/09/29 12:29:26
++++ src/sys/kern/kern_descrip.c 2006/12/29 16:06:02
+@@ -2150,6 +2150,17 @@
+ FILE_UNLOCK(fp);
+ return (0);
+ }
++
++ /*
++ * We might have just dropped the last reference to a file
++ * object that is for a UNIX domain socket whose message
++ * buffers are being examined in unp_gc(). If that is the
++ * case, FWAIT will be set in f_gcflag and we need to wait for
++ * unp_gc() to finish its scan.
++ */
++ while (fp->f_gcflag & FWAIT)
++ msleep(&fp->f_gcflag, fp->f_mtxp, 0, "fpdrop", 0);
++
+ /* We have the last ref so we can proceed without the file lock. */
+ FILE_UNLOCK(fp);
+ if (fp->f_count < 0)
+--- src/sys/kern/uipc_usrreq.c 2006/07/13 07:28:19
++++ src/sys/kern/uipc_usrreq.c 2006/12/29 16:16:12
+@@ -68,6 +69,17 @@
+
+ #include <vm/uma.h>
+
++/*
++ * We allocate wrapper objects that add the reference count to an existing
++ * unpcb in 6.x to preserve the ABI layout of unpcb.
++ */
++struct unpcb_wrapper {
++ struct unpcb unpw_unpcb;
++ u_int unpw_refcount;
++};
++
++#define UNP_REFCOUNT(unp) (((struct unpcb_wrapper *)(unp))->unpw_refcount)
++
+ static uma_zone_t unp_zone;
+ static unp_gen_t unp_gencnt;
+ static u_int unp_count;
+@@ -769,6 +781,7 @@
+ unp->unp_socket = so;
+ so->so_pcb = unp;
+
++ UNP_REFCOUNT(unp) = 1;
+ UNP_LOCK();
+ unp->unp_gencnt = ++unp_gencnt;
+ unp_count++;
+@@ -782,8 +795,10 @@
+ static void
+ unp_detach(struct unpcb *unp)
+ {
++ struct sockaddr_un *saved_unp_addr;
+ struct vnode *vp;
+ int local_unp_rights;
++ int freeunp;
+
+ UNP_LOCK_ASSERT();
+
+@@ -807,10 +822,15 @@
+ soisdisconnected(unp->unp_socket);
+ unp->unp_socket->so_pcb = NULL;
+ local_unp_rights = unp_rights;
++ saved_unp_addr = unp->unp_addr;
++ unp->unp_addr = NULL;
++ UNP_REFCOUNT(unp)--;
++ freeunp = (UNP_REFCOUNT(unp) == 0);
+ UNP_UNLOCK();
+- if (unp->unp_addr != NULL)
+- FREE(unp->unp_addr, M_SONAME);
+- uma_zfree(unp_zone, unp);
++ if (saved_unp_addr != NULL)
++ FREE(saved_unp_addr, M_SONAME);
++ if (freeunp)
++ uma_zfree(unp_zone, unp);
+ if (vp) {
+ int vfslocked;
+
+@@ -1126,6 +1146,7 @@
+ unp_pcblist(SYSCTL_HANDLER_ARGS)
+ {
+ int error, i, n;
++ int freeunp;
+ struct unpcb *unp, **unp_list;
+ unp_gen_t gencnt;
+ struct xunpgen *xug;
+@@ -1177,6 +1198,7 @@
+ unp->unp_socket->so_cred))
+ continue;
+ unp_list[i++] = unp;
++ UNP_REFCOUNT(unp)++;
+ }
+ }
+ UNP_UNLOCK();
+@@ -1186,7 +1208,9 @@
+ xu = malloc(sizeof(*xu), M_TEMP, M_WAITOK | M_ZERO);
+ for (i = 0; i < n; i++) {
+ unp = unp_list[i];
+- if (unp->unp_gencnt <= gencnt) {
++ UNP_LOCK();
++ UNP_REFCOUNT(unp)--;
++ if (UNP_REFCOUNT(unp) != 0 && unp->unp_gencnt <= gencnt) {
+ xu->xu_len = sizeof *xu;
+ xu->xu_unpp = unp;
+ /*
+@@ -1203,7 +1227,13 @@
+ unp->unp_conn->unp_addr->sun_len);
+ bcopy(unp, &xu->xu_unp, sizeof *unp);
+ sotoxsocket(unp->unp_socket, &xu->xu_socket);
++ UNP_UNLOCK();
+ error = SYSCTL_OUT(req, xu, sizeof *xu);
++ } else {
++ freeunp = (UNP_REFCOUNT(unp) == 0);
++ UNP_UNLOCK();
++ if (freeunp)
++ uma_zfree(unp_zone, unp);
+ }
+ }
+ free(xu, M_TEMP);
+@@ -1401,8 +1431,8 @@
+ void
+ unp_init(void)
+ {
+- unp_zone = uma_zcreate("unpcb", sizeof(struct unpcb), NULL, NULL,
+- NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
++ unp_zone = uma_zcreate("unpcb", sizeof(struct unpcb_wrapper), NULL,
++ NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
+ if (unp_zone == NULL)
+ panic("unp_init");
+ uma_zone_set_max(unp_zone, maxsockets);
+@@ -1636,7 +1666,7 @@
+ unp_defer = 0;
+ /*
+ * before going through all this, set all FDs to
+- * be NOT defered and NOT externally accessible
++ * be NOT deferred and NOT externally accessible
+ */
+ sx_slock(&filelist_lock);
+ LIST_FOREACH(fp, &filehead, f_list)
+@@ -1659,16 +1689,16 @@
+ continue;
+ }
+ /*
+- * If we already marked it as 'defer' in a
+- * previous pass, then try process it this time
+- * and un-mark it
++ * If we already marked it as 'defer' in a
++ * previous pass, then try to process it this
++ * time and un-mark it
+ */
+ if (fp->f_gcflag & FDEFER) {
+ fp->f_gcflag &= ~FDEFER;
+ unp_defer--;
+ } else {
+ /*
+- * if it's not defered, then check if it's
++ * if it's not deferred, then check if it's
+ * already marked.. if so skip it
+ */
+ if (fp->f_gcflag & FMARK) {
+@@ -1691,7 +1721,7 @@
+ fp->f_gcflag |= FMARK;
+ }
+ /*
+- * either it was defered, or it is externally
++ * either it was deferred, or it is externally
+ * accessible and not already marked so.
+ * Now check if it is possibly one of OUR sockets.
+ */
+@@ -1700,13 +1730,23 @@
+ FILE_UNLOCK(fp);
+ continue;
+ }
+- FILE_UNLOCK(fp);
+ if (so->so_proto->pr_domain != &localdomain ||
+- (so->so_proto->pr_flags&PR_RIGHTS) == 0)
++ (so->so_proto->pr_flags & PR_RIGHTS) == 0) {
++ FILE_UNLOCK(fp);
+ continue;
++ }
++
++ /*
++ * Tell any other threads that do a subsequent
++ * fdrop() that we are scanning the message
++ * buffers.
++ */
++ fp->f_gcflag |= FWAIT;
++ FILE_UNLOCK(fp);
++
+ /*
+ * So, Ok, it's one of our sockets and it IS externally
+- * accessible (or was defered). Now we look
++ * accessible (or was deferred). Now we look
+ * to see if we hold any file descriptors in its
+ * message buffers. Follow those links and mark them
+ * as accessible too.
+@@ -1714,6 +1754,14 @@
+ SOCKBUF_LOCK(&so->so_rcv);
+ unp_scan(so->so_rcv.sb_mb, unp_mark);
+ SOCKBUF_UNLOCK(&so->so_rcv);
++
++ /*
++ * Wake up any threads waiting in fdrop().
++ */
++ FILE_LOCK(fp);
++ fp->f_gcflag &= ~FWAIT;
++ wakeup(&fp->f_gcflag);
++ FILE_UNLOCK(fp);
+ }
+ } while (unp_defer);
+ sx_sunlock(&filelist_lock);
+--- src/sys/sys/file.h 2006/05/29 20:28:17
++++ src/sys/sys/file.h 2006/12/29 16:16:12
+@@ -127,6 +127,7 @@
+ short f_gcflag; /* used by thread doing fd garbage collection */
+ #define FMARK 0x1 /* mark during gc() */
+ #define FDEFER 0x2 /* defer for next gc pass */
++#define FWAIT 0x4 /* gc is scanning message buffers */
+ int f_msgcount; /* (f) references from message queue */
+
+ /* DTYPE_VNODE specific fields */
diff --git a/sys-freebsd/freebsd-sources/freebsd-sources-6.2-r2.ebuild b/sys-freebsd/freebsd-sources/freebsd-sources-6.2-r2.ebuild
new file mode 100644
index 000000000000..126b067f2107
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/freebsd-sources-6.2-r2.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/freebsd-sources-6.2-r2.ebuild,v 1.1 2007/07/03 11:08:00 uberlord Exp $
+
+inherit bsdmk freebsd flag-o-matic
+
+DESCRIPTION="FreeBSD kernel sources"
+SLOT="${PVR}"
+KEYWORDS="~sparc-fbsd ~x86-fbsd"
+
+IUSE="symlink"
+
+SRC_URI="mirror://gentoo/${SYS}.tar.bz2"
+
+RDEPEND=">=sys-freebsd/freebsd-mk-defs-6.0-r1"
+DEPEND=""
+
+RESTRICT="strip binchecks"
+
+S="${WORKDIR}/sys"
+
+MY_PVR="${PVR}"
+
+[[ ${MY_PVR} == "${RV}" ]] && MY_PVR="${MY_PVR}-r0"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # This replaces the gentoover patch, it doesn't need reapply every time.
+ sed -i -e 's:^REVISION=.*:REVISION="'${PVR}'":' \
+ -e 's:^BRANCH=.*:BRANCH="Gentoo":' \
+ -e 's:^VERSION=.*:VERSION="${TYPE} ${BRANCH} ${REVISION}":' \
+ "${S}/conf/newvers.sh"
+
+ epatch "${FILESDIR}/${PN}-gentoo.patch"
+ epatch "${FILESDIR}/${PN}-6.0-flex-2.5.31.patch"
+ epatch "${FILESDIR}/${PN}-6.0-asm.patch"
+ epatch "${FILESDIR}/${PN}-6.0-werror.patch"
+ epatch "${FILESDIR}/${PN}-6.2-gcc41.patch"
+ epatch "${FILESDIR}/${PN}-6.2-sparc64.patch"
+ epatch "${FILESDIR}/${PN}-6.1-ntfs.patch"
+ epatch "${FILESDIR}/${PN}-6.2-debug-O2.patch"
+
+ # Errata patches
+ epatch "${FILESDIR}/${P}-EN-07:02.net.patch"
+ epatch "${FILESDIR}/${P}-unp_gc.patch"
+
+ # http://security.freebsd.org/advisories/FreeBSD-SA-07:03.ipv6.asc
+ epatch "${FILESDIR}/${P}-ipv6.patch"
+
+ # Disable SSP for the kernel
+ grep -Zlr -- -ffreestanding "${S}" | xargs -0 sed -i -e \
+ "s:-ffreestanding:-ffreestanding $(test-flags -fno-stack-protector -fno-stack-protector-all):g"
+}
+
+src_compile() {
+ einfo "Nothing to compile.."
+}
+
+src_install() {
+ insinto "/usr/src/sys-${MY_PVR}"
+ doins -r "${S}/"*
+}
+
+pkg_postinst() {
+ if [[ ! -L "${ROOT}/usr/src/sys" ]]; then
+ einfo "/usr/src/sys symlink doesn't exist; creating symlink to sys-${MY_PVR}..."
+ ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys" || \
+ eerror "Couldn't create ${ROOT}/usr/src/sys symlink."
+ # just in case...
+ [[ -L ""${ROOT}/usr/src/sys-${RV}"" ]] && rm "${ROOT}/usr/src/sys-${RV}"
+ ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys-${RV}" || \
+ eerror "Couldn't create ${ROOT}/usr/src/sys-${RV} symlink."
+ elif use symlink; then
+ einfo "Updating /usr/src/sys symlink to sys-${MY_PVR}..."
+ rm "${ROOT}/usr/src/sys" "${ROOT}/usr/src/sys-${RV}" || \
+ eerror "Couldn't remove previous symlinks, please fix manually."
+ ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys" || \
+ eerror "Couldn't create ${ROOT}/usr/src/sys symlink."
+ ln -sf "sys-${MY_PVR}" "${ROOT}/usr/src/sys-${RV}" || \
+ eerror "Couldn't create ${ROOT}/usr/src/sys-${RV} symlink."
+ fi
+
+ if use sparc-fbsd ; then
+ ewarn "WARNING: kldload currently causes kernel panics"
+ ewarn "on sparc64. This is probably a gcc-4.1 issue, but"
+ ewarn "we need gcc-4.1 to compile the kernel correctly :/"
+ ewarn "Please compile all modules you need into the kernel"
+ fi
+}