summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Villavicencio <the_paya@gentoo.org>2009-01-22 21:05:47 +0000
committerJavier Villavicencio <the_paya@gentoo.org>2009-01-22 21:05:47 +0000
commit01ed9538965d5edaa1c6af5d8cdd2310b41264c5 (patch)
treef818cb2012fe41c9de8b43940f46454bfd6846dd /sys-freebsd/freebsd-sources
parentImport of the 7.1 ebuilds from gentoo-bsd overlay. (diff)
downloadgentoo-2-01ed9538965d5edaa1c6af5d8cdd2310b41264c5.tar.gz
gentoo-2-01ed9538965d5edaa1c6af5d8cdd2310b41264c5.tar.bz2
gentoo-2-01ed9538965d5edaa1c6af5d8cdd2310b41264c5.zip
Import of the 7.1 ebuilds from gentoo-bsd overlay.
(Portage version: 2.2_rc23/cvs/FreeBSD i386)
Diffstat (limited to 'sys-freebsd/freebsd-sources')
-rw-r--r--sys-freebsd/freebsd-sources/ChangeLog15
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-gentoo.patch35
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-tmpfs_whiteout_stub.patch44
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-werror.patch27
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-asm.patch139
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-binutils_link.patch37
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-sparc64.patch12
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-subnet-route-pr40133.patch21
-rw-r--r--sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-types.h-fix.patch15
-rw-r--r--sys-freebsd/freebsd-sources/freebsd-sources-7.1.ebuild109
10 files changed, 453 insertions, 1 deletions
diff --git a/sys-freebsd/freebsd-sources/ChangeLog b/sys-freebsd/freebsd-sources/ChangeLog
index 850a7c065f41..f40e13ee531a 100644
--- a/sys-freebsd/freebsd-sources/ChangeLog
+++ b/sys-freebsd/freebsd-sources/ChangeLog
@@ -1,6 +1,19 @@
# ChangeLog for sys-freebsd/freebsd-sources
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/ChangeLog,v 1.44 2009/01/08 18:35:47 aballier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/ChangeLog,v 1.45 2009/01/22 21:05:47 the_paya Exp $
+
+*freebsd-sources-7.1 (22 Jan 2009)
+
+ 22 Jan 2009; Javier Villavicencio <the_paya@gentoo.org>
+ +files/freebsd-sources-7.0-gentoo.patch,
+ +files/freebsd-sources-7.0-tmpfs_whiteout_stub.patch,
+ +files/freebsd-sources-7.0-werror.patch,
+ +files/freebsd-sources-7.1-asm.patch,
+ +files/freebsd-sources-7.1-binutils_link.patch,
+ +files/freebsd-sources-7.1-sparc64.patch,
+ +files/freebsd-sources-7.1-subnet-route-pr40133.patch,
+ +files/freebsd-sources-7.1-types.h-fix.patch, +freebsd-sources-7.1.ebuild:
+ Import 7.1 ebuilds from gentoo-bsd overlay.
*freebsd-sources-6.2-r5 (08 Jan 2009)
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-gentoo.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-gentoo.patch
new file mode 100644
index 000000000000..7da5197d8de2
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-gentoo.patch
@@ -0,0 +1,35 @@
+diff -ur ../src.orig/sys/conf/kern.mk ./sys/conf/kern.mk
+--- ../src.orig/sys/conf/kern.mk 2007-05-24 23:53:42.000000000 +0200
++++ ./sys/conf/kern.mk 2008-03-14 14:37:47.216420518 +0100
+@@ -12,7 +12,7 @@
+ .else
+ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
+ -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
+- ${_wundef} ${_Wno_pointer_sign} -fformat-extensions
++ ${_wundef} ${_Wno_pointer_sign}
+ .if !defined(WITH_GCC3)
+ _Wno_pointer_sign=-Wno-pointer-sign
+ .endif
+@@ -36,7 +36,7 @@
+ # reserved for user applications.
+ #
+ .if ${MACHINE_ARCH} == "i386" && ${CC} != "icc"
+-CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 \
++CFLAGS+= -mpreferred-stack-boundary=2 \
+ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3
+ INLINE_LIMIT?= 8000
+ .endif
+Only in ./sys/conf: kern.mk.rej
+Only in ./sys/conf: kern.mk~
+diff -ur ../src.orig/sys/dev/aic7xxx/aicasm/Makefile ./sys/dev/aic7xxx/aicasm/Makefile
+--- ../src.orig/sys/dev/aic7xxx/aicasm/Makefile 2005-11-21 15:41:10.000000000 +0100
++++ ./sys/dev/aic7xxx/aicasm/Makefile 2008-03-14 14:36:35.859698365 +0100
+@@ -14,7 +14,7 @@
+ SRCS= ${GENHDRS} ${CSRCS} ${YSRCS} ${LSRCS}
+ CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g}
+ DPADD= ${LIBL}
+-LDADD= -ll
++LDADD= -lfl
+
+ # Correct path for kernel builds
+ # Don't rely on the kernel's .depend file
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-tmpfs_whiteout_stub.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-tmpfs_whiteout_stub.patch
new file mode 100644
index 000000000000..13524efa6e00
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-tmpfs_whiteout_stub.patch
@@ -0,0 +1,44 @@
+diff -ur sys/fs/tmpfs.orig/tmpfs_vnops.c sys/fs/tmpfs/tmpfs_vnops.c
+--- sys/fs/tmpfs.orig/tmpfs_vnops.c 2008-06-22 12:17:48 -0300
++++ sys/fs/tmpfs/tmpfs_vnops.c 2008-06-28 12:05:10 -0300
+@@ -1459,6 +1459,30 @@
+ return (0);
+ }
+
++
++/* --------------------------------------------------------------------- */
++/* This does absolutely nothing */
++#ifdef GENTOO_LIVECD
++static int
++tmpfs_whiteout(struct vop_whiteout_args *ap)
++{
++ switch (ap->a_flags) {
++ case LOOKUP:
++ return (0);
++ break;
++ case CREATE:
++ return(EOPNOTSUPP);
++ break;
++ case DELETE:
++ return (0);
++ break;
++ default:
++ return(EOPNOTSUPP);
++ }
++ return(0);
++}
++#endif
++
+ /* --------------------------------------------------------------------- */
+
+ /*
+@@ -1484,6 +1508,9 @@
+ .vop_mkdir = tmpfs_mkdir,
+ .vop_rmdir = tmpfs_rmdir,
+ .vop_symlink = tmpfs_symlink,
++#ifdef GENTOO_LIVECD
++ .vop_whiteout = tmpfs_whiteout,
++#endif
+ .vop_readdir = tmpfs_readdir,
+ .vop_readlink = tmpfs_readlink,
+ .vop_inactive = tmpfs_inactive,
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-werror.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-werror.patch
new file mode 100644
index 000000000000..3a2be631b1b7
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.0-werror.patch
@@ -0,0 +1,27 @@
+diff -ur ../src.orig/sys/conf/kern.pre.mk ./sys/conf/kern.pre.mk
+--- ../src.orig/sys/conf/kern.pre.mk 2007-08-08 21:12:06.000000000 +0200
++++ ./sys/conf/kern.pre.mk 2008-03-14 14:10:03.183569137 +0100
+@@ -90,7 +90,7 @@
+ .if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" || \
+ ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "powerpc" || \
+ ${MACHINE_ARCH} == "sparc64"
+-WERROR?= -Werror
++WERROR?= -Wno-error
+ .endif
+ .endif
+
+Only in ./sys/conf: kern.pre.mk.rej
+Only in ./sys/conf: kern.pre.mk~
+diff -ur ../src.orig/sys/conf/kmod.mk ./sys/conf/kmod.mk
+--- ../src.orig/sys/conf/kmod.mk 2007-07-11 03:20:37.000000000 +0200
++++ ./sys/conf/kmod.mk 2008-03-14 14:11:21.856366378 +0100
+@@ -79,7 +79,6 @@
+ . if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing)
+ CFLAGS+= -fno-strict-aliasing
+ . endif
+-#WERROR?= -Werror
+ .endif
+ CFLAGS+= ${WERROR}
+ CFLAGS+= -D_KERNEL
+Only in ./sys/conf: kmod.mk.rej
+Only in ./sys/conf: kmod.mk~
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-asm.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-asm.patch
new file mode 100644
index 000000000000..c0f5d787cd1d
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-asm.patch
@@ -0,0 +1,139 @@
+diff -ur ../src.orig/sys/compat/ndis/winx32_wrap.S ./sys/compat/ndis/winx32_wrap.S
+--- ../src.orig/sys/compat/ndis/winx32_wrap.S 2006-06-12 22:35:59.000000000 +0200
++++ ./sys/compat/ndis/winx32_wrap.S 2008-03-14 14:00:41.949886084 +0100
+@@ -369,7 +369,7 @@
+ ret
+
+ ENTRY(x86_setfs)
+- movl 4(%esp),%fs
++ movw 4(%esp),%fs
+ ret
+
+ ENTRY(x86_gettid)
+diff -ur ../src.orig/sys/i386/i386/locore.s ./sys/i386/i386/locore.s
+--- ../src.orig/sys/i386/i386/locore.s 2007-03-24 20:53:22.000000000 +0100
++++ ./sys/i386/i386/locore.s 2008-03-14 14:00:41.946886262 +0100
+@@ -358,7 +358,7 @@
+ pushl %eax
+ testl $PSL_VM,UC_EFLAGS(%eax)
+ jne 1f
+- movl UC_GS(%eax),%gs /* restore %gs */
++ movw UC_GS(%eax),%gs /* restore %gs */
+ 1:
+ movl $SYS_sigreturn,%eax
+ pushl %eax /* junk to fake return addr. */
+@@ -375,7 +375,7 @@
+ pushl %eax
+ testl $PSL_VM,UC4_EFLAGS(%eax)
+ jne 1f
+- movl UC4_GS(%eax),%gs /* restore %gs */
++ movw UC4_GS(%eax),%gs /* restore %gs */
+ 1:
+ movl $344,%eax /* 4.x SYS_sigreturn */
+ pushl %eax /* junk to fake return addr. */
+@@ -393,7 +393,7 @@
+ pushl %eax
+ testl $PSL_VM,SC_PS(%eax)
+ jne 9f
+- movl SC_GS(%eax),%gs /* restore %gs */
++ movw SC_GS(%eax),%gs /* restore %gs */
+ 9:
+ movl $103,%eax /* 3.x SYS_sigreturn */
+ pushl %eax /* junk to fake return addr. */
+diff -ur ../src.orig/sys/i386/i386/swtch.s ./sys/i386/i386/swtch.s
+--- ../src.orig/sys/i386/i386/swtch.s 2007-08-22 07:06:14.000000000 +0200
++++ ./sys/i386/i386/swtch.s 2008-03-14 14:00:41.948886237 +0100
+@@ -130,7 +130,7 @@
+ movl %ebp,PCB_EBP(%edx)
+ movl %esi,PCB_ESI(%edx)
+ movl %edi,PCB_EDI(%edx)
+- movl %gs,PCB_GS(%edx)
++ movw %gs,PCB_GS(%edx)
+ pushfl /* PSL */
+ popl PCB_PSL(%edx)
+ /* Test if debug registers should be saved. */
+@@ -301,7 +301,7 @@
+ /* This must be done after loading the user LDT. */
+ .globl cpu_switch_load_gs
+ cpu_switch_load_gs:
+- movl PCB_GS(%edx),%gs
++ movw PCB_GS(%edx),%gs
+
+ /* Test if debug registers should be restored. */
+ testl $PCB_DBREGS,PCB_FLAGS(%edx)
+@@ -371,7 +371,7 @@
+ movl %ebp,PCB_EBP(%ecx)
+ movl %esi,PCB_ESI(%ecx)
+ movl %edi,PCB_EDI(%ecx)
+- movl %gs,PCB_GS(%ecx)
++ movw %gs,PCB_GS(%ecx)
+ pushfl
+ popl PCB_PSL(%ecx)
+
+diff -ur ../src.orig/sys/i386/include/cpufunc.h ./sys/i386/include/cpufunc.h
+--- ../src.orig/sys/i386/include/cpufunc.h 2007-08-09 22:14:35.000000000 +0200
++++ ./sys/i386/include/cpufunc.h 2008-03-14 14:03:09.264377451 +0100
+@@ -452,7 +452,7 @@
+ rfs(void)
+ {
+ u_int sel;
+- __asm __volatile("movl %%fs,%0" : "=rm" (sel));
++ __asm __volatile("movw %%fs,%0" : "=rm" (sel));
+ return (sel);
+ }
+
+@@ -468,7 +468,7 @@
+ rgs(void)
+ {
+ u_int sel;
+- __asm __volatile("movl %%gs,%0" : "=rm" (sel));
++ __asm __volatile("movw %%gs,%0" : "=rm" (sel));
+ return (sel);
+ }
+
+@@ -492,7 +492,7 @@
+ rss(void)
+ {
+ u_int sel;
+- __asm __volatile("movl %%ss,%0" : "=rm" (sel));
++ __asm __volatile("movw %%ss,%0" : "=rm" (sel));
+ return (sel);
+ }
+
+@@ -507,13 +507,13 @@
+ static __inline void
+ load_fs(u_int sel)
+ {
+- __asm __volatile("movl %0,%%fs" : : "rm" (sel));
++ __asm __volatile("movw %0,%%fs" : : "rm" (sel));
+ }
+
+ static __inline void
+ load_gs(u_int sel)
+ {
+- __asm __volatile("movl %0,%%gs" : : "rm" (sel));
++ __asm __volatile("movw %0,%%gs" : : "rm" (sel));
+ }
+
+ static __inline void
+diff -ur ../src.orig/sys/i386/linux/linux_locore.s ./sys/i386/linux/linux_locore.s
+--- ../src.orig/sys/i386/linux/linux_locore.s 2001-02-25 07:29:01.000000000 +0100
++++ ./sys/i386/linux/linux_locore.s 2008-03-14 14:00:41.949886084 +0100
+@@ -8,7 +8,7 @@
+ NON_GPROF_ENTRY(linux_sigcode)
+ call *LINUX_SIGF_HANDLER(%esp)
+ leal LINUX_SIGF_SC(%esp),%ebx /* linux scp */
+- movl LINUX_SC_GS(%ebx),%gs
++ movw LINUX_SC_GS(%ebx),%gs
+ movl %esp, %ebx /* pass sigframe */
+ push %eax /* fake ret addr */
+ movl $LINUX_SYS_linux_sigreturn,%eax /* linux_sigreturn() */
+@@ -20,7 +20,7 @@
+ call *LINUX_RT_SIGF_HANDLER(%esp)
+ leal LINUX_RT_SIGF_UC(%esp),%ebx /* linux ucp */
+ leal LINUX_RT_SIGF_SC(%ebx),%ecx /* linux sigcontext */
+- movl LINUX_SC_GS(%ecx),%gs
++ movw LINUX_SC_GS(%ecx),%gs
+ push %eax /* fake ret addr */
+ movl $LINUX_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */
+ int $0x80 /* enter kernel with args */
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-binutils_link.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-binutils_link.patch
new file mode 100644
index 000000000000..43d01baef347
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-binutils_link.patch
@@ -0,0 +1,37 @@
+diff -ruN sys.orig/conf/kern.post.mk sys/conf/kern.post.mk
+--- sys.orig/conf/kern.post.mk 2007-03-23 18:55:59 -0300
++++ sys/conf/kern.post.mk 2008-06-18 19:51:13 -0300
+@@ -85,7 +85,9 @@
+ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o
+ @rm -f ${.TARGET}
+ @echo linking ${.TARGET}
+- ${SYSTEM_LD}
++ ${SYSTEM_LD} -o ${.TARGET}.tmp
++ @sh $S/tools/gen-ld-u-options ${.TARGET}.tmp > ${.TARGET}.lopt
++ ${SYSTEM_LD} "@${.TARGET}.lopt"
+ .if defined(CTFMERGE)
+ ${SYSTEM_CTFMERGE}
+ .endif
+diff -ruN sys.orig/conf/kmod.mk sys/conf/kmod.mk
+--- sys.orig/conf/kmod.mk 2008-06-18 09:11:53 -0300
++++ sys/conf/kmod.mk 2008-06-18 19:50:01 -0300
+@@ -176,7 +176,8 @@
+
+ .if ${MACHINE_ARCH} != amd64
+ ${FULLPROG}: ${KMOD}.kld
+- ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld
++ sh ./@/tools/gen-ld-u-options ${KMOD}.kld > ${KMOD}.lopt
++ ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld "@${KMOD}.lopt"
+ .if !defined(DEBUG_FLAGS)
+ ${OBJCOPY} --strip-debug ${.TARGET}
+ .endif
+diff -ruN sys.orig/tools/gen-ld-u-options sys/tools/gen-ld-u-options
+--- sys.orig/tools/gen-ld-u-options 1969-12-31 21:00:00 -0300
++++ sys/tools/gen-ld-u-options 2008-06-18 19:47:56 -0300
+@@ -0,0 +1,6 @@
++#!/bin/sh
++
++for i in `objdump -h -w $1 | grep set_ | cut -c5- | cut -f1 -d " "`
++do
++ echo -n " -u __start_$i -u __stop_$i "
++done
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-sparc64.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-sparc64.patch
new file mode 100644
index 000000000000..12bde6f9ac8b
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-sparc64.patch
@@ -0,0 +1,12 @@
+diff -ur sys.orig/conf/ldscript.sparc64 sys/conf/ldscript.sparc64
+--- sys.orig/conf/ldscript.sparc64 2003-06-07 19:23:50 +0100
++++ sys/conf/ldscript.sparc64 2006-10-11 11:10:21 +0100
+@@ -1,6 +1,6 @@
+ /* $FreeBSD: src/sys/conf/ldscript.sparc64,v 1.4.28.1 2008/11/25 02:59:29 kensmith Exp $ */
+-OUTPUT_FORMAT("elf64-sparc", "elf64-sparc",
+- "elf64-sparc")
++OUTPUT_FORMAT("elf64-sparc-freebsd", "elf64-sparc-freebsd",
++ "elf64-sparc-freebsd")
+ OUTPUT_ARCH(sparc:v9)
+ ENTRY(_start)
+ SEARCH_DIR(/usr/lib);
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-subnet-route-pr40133.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-subnet-route-pr40133.patch
new file mode 100644
index 000000000000..1184280b5d8f
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-subnet-route-pr40133.patch
@@ -0,0 +1,21 @@
+Fixes changing the default subnet route after removing an ip address.
+
+See: http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=40133
+and http://mail-index.netbsd.org/tech-net/2008/12/03/msg000896.html
+
+Thanks to Roy Marples.
+--- sys/netinet/in.c.orig
++++ sys/netinet/in.c
+@@ -858,6 +858,12 @@
+ error = rtinit(&target->ia_ifa, (int)RTM_ADD, flags);
+ if (!error)
+ target->ia_flags |= IFA_ROUTE;
++ else if (error == EEXIST) {
++ /*
++ * the fact that the route already exists is not an error.
++ */
++ error = 0;
++ }
+ return error;
+ }
+
diff --git a/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-types.h-fix.patch b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-types.h-fix.patch
new file mode 100644
index 000000000000..8de5df2d16a6
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/files/freebsd-sources-7.1-types.h-fix.patch
@@ -0,0 +1,15 @@
+Fixes a compile error if XOPEN_SOURCE 600 is defined.
+
+See: http://www.mailinglistarchive.com/freebsd-current@freebsd.org/msg15011.html
+
+--- sys/sys/types.h.orig
++++ sys/sys/types.h
+@@ -46,7 +46,7 @@
+
+ #include <sys/_pthreadtypes.h>
+
+-#if __BSD_VISIBLE
++#ifndef _POSIX_SOURCE
+ typedef unsigned char u_char;
+ typedef unsigned short u_short;
+ typedef unsigned int u_int;
diff --git a/sys-freebsd/freebsd-sources/freebsd-sources-7.1.ebuild b/sys-freebsd/freebsd-sources/freebsd-sources-7.1.ebuild
new file mode 100644
index 000000000000..e1f06ee4f88c
--- /dev/null
+++ b/sys-freebsd/freebsd-sources/freebsd-sources-7.1.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-sources/freebsd-sources-7.1.ebuild,v 1.1 2009/01/22 21:05:47 the_paya 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-7.0"
+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"
+
+ # __FreeBSD_cc_version comes from FreeBSD's gcc.
+ # on 7.0-RELEASE it's 700003.
+ sed -e "s:-D_KERNEL:-D_KERNEL -D__FreeBSD_cc_version=700004:g" \
+ -i "${S}/conf/kern.pre.mk" \
+ -i "${S}/conf/kmod.mk" || die "Couldn't set __FreeBSD_cc_version"
+
+ epatch "${FILESDIR}/${PN}-7.0-gentoo.patch"
+ epatch "${FILESDIR}/${PN}-6.0-flex-2.5.31.patch"
+ epatch "${FILESDIR}/${PN}-7.1-asm.patch"
+ epatch "${FILESDIR}/${PN}-7.0-werror.patch"
+ epatch "${FILESDIR}/${PN}-7.1-sparc64.patch"
+ epatch "${FILESDIR}/${PN}-6.1-ntfs.patch"
+ epatch "${FILESDIR}/${PN}-6.2-debug-O2.patch"
+ epatch "${FILESDIR}/${PN}-7.1-types.h-fix.patch"
+ epatch "${FILESDIR}/${PN}-7.1-subnet-route-pr40133.patch"
+
+ # http://security.freebsd.org/advisories/FreeBSD-SA-07:03.ipv6.asc
+ # Why did the 6.2 patch apply almoast cleanly on 7.0?
+ # Because the code was suppressed.
+ #epatch "${FILESDIR}/${PN}-7.0-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"
+
+ # By adding -DGENTOO_LIVECD to CFLAGS activate this stub
+ # vop_whiteout to tmpfs, so it can be used as an overlay
+ # unionfs filesystem over the cd9660 readonly filesystem.
+ epatch "${FILESDIR}/${PN}-7.0-tmpfs_whiteout_stub.patch"
+
+ # See http://sourceware.org/bugzilla/show_bug.cgi?id=5391
+ # ld doesn't provide symbols constructed as the __start_set_(s) ones
+ # are on FreeBSD modules.
+ # This patch adds code to generate a list of these and adds them
+ # as undefined references to ld's commandline to get them.
+ # Without this kernel modules will not load.
+ epatch "${FILESDIR}/${PN}-7.1-binutils_link.patch"
+}
+
+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
+}