--- kfreebsd-7-7.0.orig/fetch
+++ kfreebsd-7-7.0/fetch
@@ -0,0 +1,29 @@
+#!/bin/bash
+set -ex
+
+ANONCVS=anoncvs@anoncvs.fr.freebsd.org:/home/ncvs
+RELENG=RELENG_7_0_0_RELEASE
+
+rm -rf src
+
+if test -e src.tar.bz2 ; then
+  tar -xjpf src.tar.bz2
+  action="update"
+else
+  action="checkout"
+fi
+
+for i in src/{sys,usr.sbin/config} ; do
+  cvs -d $ANONCVS ${action} -r $RELENG $i
+  test -e $i
+done
+
+grep ^src/ debian/copyright | xargs rm -rf
+
+# assert that no non-free objects were left unremoved
+[ "`find src -name \*.o.uu | wc -l`" = "0" ]
+
+rm -f src.tar.bz2
+tar -cjpf src.tar.bz2 src/
+
+rm -rf src
--- kfreebsd-7-7.0.orig/debian/control
+++ kfreebsd-7-7.0/debian/control
@@ -0,0 +1,534 @@
+Source: kfreebsd-7
+Section: devel
+Priority: optional
+Maintainer: GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>
+Uploaders: Aurelien Jarno <aurel32@debian.org>, Guillem Jover <guillem@debian.org>
+Vcs-Browser: http://svn.debian.org/wsvn/glibc-bsd/trunk/kfreebsd-7/
+Vcs-Svn: svn://svn.debian.org/glibc-bsd/trunk/kfreebsd-7/
+Build-Depends: debhelper (>= 4.1.0), bzip2, quilt, freebsd-buildutils (>= 7) [kfreebsd-i386 kfreebsd-amd64] | freebsd6-buildutils (>=  6.2) [kfreebsd-i386 kfreebsd-amd64], libdb-dev, flex-old | flex, libbsd-dev [kfreebsd-i386 kfreebsd-amd64], gcc-4.3 [kfreebsd-i386 kfreebsd-amd64], sharutils
+Standards-Version: 3.8.0
+
+Package: kfreebsd-source-7.0
+Architecture: all
+Section: devel
+Recommends: freebsd-buildutils (>= 7) | freebsd7-buildutils
+Provides: kfreebsd-source-7, kfreebsd-source
+Description: source code for kernel of FreeBSD 7.0 with Debian patches
+ This package provides the source code for kernel of FreeBSD 7.0, base of 
+ a GNU/kFreeBSD system.
+
+Package: kfreebsd-headers-7.0-1
+Architecture: kfreebsd-i386 kfreebsd-amd64
+Section: devel
+Description: Common architecture-specific header files for kernel of FreeBSD 7.0
+ This package provides the architecture-specific common kernel header files for 
+ kernel of FreeBSD 7.0, generally used for building out-of-tree kernel 
+ modules. To obtain a complete set of headers you also need to install the 
+ kfreebsd-headers-7.0-1-(flavour) package, matching the flavour of the
+ kernel you intend the build for. To obtain such a set for the currently running
+ kernel it is sufficient to run a command
+ .
+ apt-get install kfreebsd-headers-$(uname -r)
+ .
+ and it will be unpacked in /usr/src/kfreebsd-headers-7.0-1-(flavour)
+
+Package: kfreebsd-image-7.0-1-amd64-generic
+Architecture: kfreebsd-amd64
+Section: base
+Depends: freebsd-utils (>= 5), module-init-tools (>= 6.1-6)
+Conflicts: kfreebsd-loader (<< 5.4-1.3)
+Provides: kfreebsd-image-7, kfreebsd-image
+Recommends: 
+Description: kernel of FreeBSD 7.0 image
+ This package provides the binary image and pre-built loadable modules for 
+ the kernel of FreeBSD 7.0, base of a GNU/kFreeBSD system.
+ .
+ This package is compiled for a amd64-generic-class machine.
+
+Package: ndiswrapper-modules-7.0-1-amd64-generic
+Architecture: kfreebsd-amd64
+Section: contrib/net
+Priority: optional
+Depends: kfreebsd-image-7.0-1-amd64-generic
+Description: Ndiswrapper kFreeBSD module
+ This package contains the ndiswrapper loadable kernel modules for the
+ kfreebsd-image-7.0-1-amd64-generic package.
+
+Package: kfreebsd-image-7-amd64-generic
+Architecture: kfreebsd-amd64
+Section: base
+Depends: kfreebsd-image-7.0-1-amd64-generic
+Description: kernel of FreeBSD 7 image
+ This package depends on the latest binary image for kernel of FreeBSD 7 on
+ amd64-generic-class machines.
+
+Package: kfreebsd-headers-7.0-1-amd64-generic
+Architecture: kfreebsd-amd64
+Section: devel
+Provides: kfreebsd-headers-7
+Depends: kfreebsd-headers-7.0-1 (= ${binary:Version})
+Description: header files for kernel of FreeBSD 7.0
+ This package provides the header files for kernel of FreeBSD 7.0, generally 
+ used for building out-of-tree kernel modules. These files are going to be 
+ installed into /usr/src/kfreebsd-headers-7.0-1-amd64-generic, and can be 
+ used for building modules that load into the kernel provided by the 
+ kfreebsd-image-7.0-1-amd64-generic package.
+
+Package: kfreebsd-headers-7-amd64-generic
+Architecture: kfreebsd-amd64
+Section: devel
+Depends: kfreebsd-headers-7.0-1-amd64-generic
+Description: header files for kernel of FreeBSD 7
+ This package depends on the latest header files for kernel of FreeBSD 7 on
+ amd64-generic-class machines.
+  
+Package: kfreebsd-image-7.0-1-amd64-k8
+Architecture: kfreebsd-amd64
+Section: base
+Depends: freebsd-utils (>= 5), module-init-tools (>= 6.1-6)
+Conflicts: kfreebsd-loader (<< 5.4-1.3)
+Provides: kfreebsd-image-7, kfreebsd-image
+Recommends: 
+Description: kernel of FreeBSD 7.0 image
+ This package provides the binary image and pre-built loadable modules for 
+ the kernel of FreeBSD 7.0, base of a GNU/kFreeBSD system.
+ .
+ This package is compiled for a amd64-k8-class machine.
+
+Package: ndiswrapper-modules-7.0-1-amd64-k8
+Architecture: kfreebsd-amd64
+Section: contrib/net
+Priority: optional
+Depends: kfreebsd-image-7.0-1-amd64-k8
+Description: Ndiswrapper kFreeBSD module
+ This package contains the ndiswrapper loadable kernel modules for the
+ kfreebsd-image-7.0-1-amd64-k8 package.
+
+Package: kfreebsd-image-7-amd64-k8
+Architecture: kfreebsd-amd64
+Section: base
+Depends: kfreebsd-image-7.0-1-amd64-k8
+Description: kernel of FreeBSD 7 image
+ This package depends on the latest binary image for kernel of FreeBSD 7 on
+ amd64-k8-class machines.
+
+Package: kfreebsd-headers-7.0-1-amd64-k8
+Architecture: kfreebsd-amd64
+Section: devel
+Provides: kfreebsd-headers-7
+Depends: kfreebsd-headers-7.0-1 (= ${binary:Version})
+Description: header files for kernel of FreeBSD 7.0
+ This package provides the header files for kernel of FreeBSD 7.0, generally 
+ used for building out-of-tree kernel modules. These files are going to be 
+ installed into /usr/src/kfreebsd-headers-7.0-1-amd64-k8, and can be 
+ used for building modules that load into the kernel provided by the 
+ kfreebsd-image-7.0-1-amd64-k8 package.
+
+Package: kfreebsd-headers-7-amd64-k8
+Architecture: kfreebsd-amd64
+Section: devel
+Depends: kfreebsd-headers-7.0-1-amd64-k8
+Description: header files for kernel of FreeBSD 7
+ This package depends on the latest header files for kernel of FreeBSD 7 on
+ amd64-k8-class machines.
+  
+Package: kfreebsd-image-7.0-1-amd64-k8-smp
+Architecture: kfreebsd-amd64
+Section: base
+Depends: freebsd-utils (>= 5), module-init-tools (>= 6.1-6)
+Conflicts: kfreebsd-loader (<< 5.4-1.3)
+Provides: kfreebsd-image-7, kfreebsd-image
+Recommends: 
+Description: kernel of FreeBSD 7.0 image
+ This package provides the binary image and pre-built loadable modules for 
+ the kernel of FreeBSD 7.0, base of a GNU/kFreeBSD system.
+ .
+ This package is compiled for a amd64-k8-smp-class machine.
+
+Package: ndiswrapper-modules-7.0-1-amd64-k8-smp
+Architecture: kfreebsd-amd64
+Section: contrib/net
+Priority: optional
+Depends: kfreebsd-image-7.0-1-amd64-k8-smp
+Description: Ndiswrapper kFreeBSD module
+ This package contains the ndiswrapper loadable kernel modules for the
+ kfreebsd-image-7.0-1-amd64-k8-smp package.
+
+Package: kfreebsd-image-7-amd64-k8-smp
+Architecture: kfreebsd-amd64
+Section: base
+Depends: kfreebsd-image-7.0-1-amd64-k8-smp
+Description: kernel of FreeBSD 7 image
+ This package depends on the latest binary image for kernel of FreeBSD 7 on
+ amd64-k8-smp-class machines.
+
+Package: kfreebsd-headers-7.0-1-amd64-k8-smp
+Architecture: kfreebsd-amd64
+Section: devel
+Provides: kfreebsd-headers-7
+Depends: kfreebsd-headers-7.0-1 (= ${binary:Version})
+Description: header files for kernel of FreeBSD 7.0
+ This package provides the header files for kernel of FreeBSD 7.0, generally 
+ used for building out-of-tree kernel modules. These files are going to be 
+ installed into /usr/src/kfreebsd-headers-7.0-1-amd64-k8-smp, and can be 
+ used for building modules that load into the kernel provided by the 
+ kfreebsd-image-7.0-1-amd64-k8-smp package.
+
+Package: kfreebsd-headers-7-amd64-k8-smp
+Architecture: kfreebsd-amd64
+Section: devel
+Depends: kfreebsd-headers-7.0-1-amd64-k8-smp
+Description: header files for kernel of FreeBSD 7
+ This package depends on the latest header files for kernel of FreeBSD 7 on
+ amd64-k8-smp-class machines.
+  
+Package: kfreebsd-image-7.0-1-em64t-p4
+Architecture: kfreebsd-amd64
+Section: base
+Depends: freebsd-utils (>= 5), module-init-tools (>= 6.1-6)
+Conflicts: kfreebsd-loader (<< 5.4-1.3)
+Provides: kfreebsd-image-7, kfreebsd-image
+Recommends: 
+Description: kernel of FreeBSD 7.0 image
+ This package provides the binary image and pre-built loadable modules for 
+ the kernel of FreeBSD 7.0, base of a GNU/kFreeBSD system.
+ .
+ This package is compiled for a em64t-p4-class machine.
+
+Package: ndiswrapper-modules-7.0-1-em64t-p4
+Architecture: kfreebsd-amd64
+Section: contrib/net
+Priority: optional
+Depends: kfreebsd-image-7.0-1-em64t-p4
+Description: Ndiswrapper kFreeBSD module
+ This package contains the ndiswrapper loadable kernel modules for the
+ kfreebsd-image-7.0-1-em64t-p4 package.
+
+Package: kfreebsd-image-7-em64t-p4
+Architecture: kfreebsd-amd64
+Section: base
+Depends: kfreebsd-image-7.0-1-em64t-p4
+Description: kernel of FreeBSD 7 image
+ This package depends on the latest binary image for kernel of FreeBSD 7 on
+ em64t-p4-class machines.
+
+Package: kfreebsd-headers-7.0-1-em64t-p4
+Architecture: kfreebsd-amd64
+Section: devel
+Provides: kfreebsd-headers-7
+Depends: kfreebsd-headers-7.0-1 (= ${binary:Version})
+Description: header files for kernel of FreeBSD 7.0
+ This package provides the header files for kernel of FreeBSD 7.0, generally 
+ used for building out-of-tree kernel modules. These files are going to be 
+ installed into /usr/src/kfreebsd-headers-7.0-1-em64t-p4, and can be 
+ used for building modules that load into the kernel provided by the 
+ kfreebsd-image-7.0-1-em64t-p4 package.
+
+Package: kfreebsd-headers-7-em64t-p4
+Architecture: kfreebsd-amd64
+Section: devel
+Depends: kfreebsd-headers-7.0-1-em64t-p4
+Description: header files for kernel of FreeBSD 7
+ This package depends on the latest header files for kernel of FreeBSD 7 on
+ em64t-p4-class machines.
+  
+Package: kfreebsd-image-7.0-1-em64t-p4-smp
+Architecture: kfreebsd-amd64
+Section: base
+Depends: freebsd-utils (>= 5), module-init-tools (>= 6.1-6)
+Conflicts: kfreebsd-loader (<< 5.4-1.3)
+Provides: kfreebsd-image-7, kfreebsd-image
+Recommends: 
+Description: kernel of FreeBSD 7.0 image
+ This package provides the binary image and pre-built loadable modules for 
+ the kernel of FreeBSD 7.0, base of a GNU/kFreeBSD system.
+ .
+ This package is compiled for a em64t-p4-smp-class machine.
+
+Package: ndiswrapper-modules-7.0-1-em64t-p4-smp
+Architecture: kfreebsd-amd64
+Section: contrib/net
+Priority: optional
+Depends: kfreebsd-image-7.0-1-em64t-p4-smp
+Description: Ndiswrapper kFreeBSD module
+ This package contains the ndiswrapper loadable kernel modules for the
+ kfreebsd-image-7.0-1-em64t-p4-smp package.
+
+Package: kfreebsd-image-7-em64t-p4-smp
+Architecture: kfreebsd-amd64
+Section: base
+Depends: kfreebsd-image-7.0-1-em64t-p4-smp
+Description: kernel of FreeBSD 7 image
+ This package depends on the latest binary image for kernel of FreeBSD 7 on
+ em64t-p4-smp-class machines.
+
+Package: kfreebsd-headers-7.0-1-em64t-p4-smp
+Architecture: kfreebsd-amd64
+Section: devel
+Provides: kfreebsd-headers-7
+Depends: kfreebsd-headers-7.0-1 (= ${binary:Version})
+Description: header files for kernel of FreeBSD 7.0
+ This package provides the header files for kernel of FreeBSD 7.0, generally 
+ used for building out-of-tree kernel modules. These files are going to be 
+ installed into /usr/src/kfreebsd-headers-7.0-1-em64t-p4-smp, and can be 
+ used for building modules that load into the kernel provided by the 
+ kfreebsd-image-7.0-1-em64t-p4-smp package.
+
+Package: kfreebsd-headers-7-em64t-p4-smp
+Architecture: kfreebsd-amd64
+Section: devel
+Depends: kfreebsd-headers-7.0-1-em64t-p4-smp
+Description: header files for kernel of FreeBSD 7
+ This package depends on the latest header files for kernel of FreeBSD 7 on
+ em64t-p4-smp-class machines.
+  
+Package: kfreebsd-image-7.0-1-486
+Architecture: kfreebsd-i386
+Section: base
+Depends: freebsd-utils (>= 5), module-init-tools (>= 6.1-6)
+Conflicts: kfreebsd-loader (<< 5.4-1.3)
+Provides: kfreebsd-image-7, kfreebsd-image
+Recommends: 
+Description: kernel of FreeBSD 7.0 image
+ This package provides the binary image and pre-built loadable modules for 
+ the kernel of FreeBSD 7.0, base of a GNU/kFreeBSD system.
+ .
+ This package is compiled for a 486-class machine.
+
+Package: ndiswrapper-modules-7.0-1-486
+Architecture: kfreebsd-i386
+Section: contrib/net
+Priority: optional
+Depends: kfreebsd-image-7.0-1-486
+Description: Ndiswrapper kFreeBSD module
+ This package contains the ndiswrapper loadable kernel modules for the
+ kfreebsd-image-7.0-1-486 package.
+
+Package: kfreebsd-image-7-486
+Architecture: kfreebsd-i386
+Section: base
+Depends: kfreebsd-image-7.0-1-486
+Description: kernel of FreeBSD 7 image
+ This package depends on the latest binary image for kernel of FreeBSD 7 on
+ 486-class machines.
+
+Package: kfreebsd-headers-7.0-1-486
+Architecture: kfreebsd-i386
+Section: devel
+Provides: kfreebsd-headers-7
+Depends: kfreebsd-headers-7.0-1 (= ${binary:Version})
+Description: header files for kernel of FreeBSD 7.0
+ This package provides the header files for kernel of FreeBSD 7.0, generally 
+ used for building out-of-tree kernel modules. These files are going to be 
+ installed into /usr/src/kfreebsd-headers-7.0-1-486, and can be 
+ used for building modules that load into the kernel provided by the 
+ kfreebsd-image-7.0-1-486 package.
+
+Package: kfreebsd-headers-7-486
+Architecture: kfreebsd-i386
+Section: devel
+Depends: kfreebsd-headers-7.0-1-486
+Description: header files for kernel of FreeBSD 7
+ This package depends on the latest header files for kernel of FreeBSD 7 on
+ 486-class machines.
+  
+Package: kfreebsd-image-7.0-1-586
+Architecture: kfreebsd-i386
+Section: base
+Depends: freebsd-utils (>= 5), module-init-tools (>= 6.1-6)
+Conflicts: kfreebsd-loader (<< 5.4-1.3)
+Provides: kfreebsd-image-7, kfreebsd-image
+Recommends: 
+Description: kernel of FreeBSD 7.0 image
+ This package provides the binary image and pre-built loadable modules for 
+ the kernel of FreeBSD 7.0, base of a GNU/kFreeBSD system.
+ .
+ This package is compiled for a 586-class machine.
+
+Package: ndiswrapper-modules-7.0-1-586
+Architecture: kfreebsd-i386
+Section: contrib/net
+Priority: optional
+Depends: kfreebsd-image-7.0-1-586
+Description: Ndiswrapper kFreeBSD module
+ This package contains the ndiswrapper loadable kernel modules for the
+ kfreebsd-image-7.0-1-586 package.
+
+Package: kfreebsd-image-7-586
+Architecture: kfreebsd-i386
+Section: base
+Depends: kfreebsd-image-7.0-1-586
+Description: kernel of FreeBSD 7 image
+ This package depends on the latest binary image for kernel of FreeBSD 7 on
+ 586-class machines.
+
+Package: kfreebsd-headers-7.0-1-586
+Architecture: kfreebsd-i386
+Section: devel
+Provides: kfreebsd-headers-7
+Depends: kfreebsd-headers-7.0-1 (= ${binary:Version})
+Description: header files for kernel of FreeBSD 7.0
+ This package provides the header files for kernel of FreeBSD 7.0, generally 
+ used for building out-of-tree kernel modules. These files are going to be 
+ installed into /usr/src/kfreebsd-headers-7.0-1-586, and can be 
+ used for building modules that load into the kernel provided by the 
+ kfreebsd-image-7.0-1-586 package.
+
+Package: kfreebsd-headers-7-586
+Architecture: kfreebsd-i386
+Section: devel
+Depends: kfreebsd-headers-7.0-1-586
+Description: header files for kernel of FreeBSD 7
+ This package depends on the latest header files for kernel of FreeBSD 7 on
+ 586-class machines.
+  
+Package: kfreebsd-image-7.0-1-586-smp
+Architecture: kfreebsd-i386
+Section: base
+Depends: freebsd-utils (>= 5), module-init-tools (>= 6.1-6)
+Conflicts: kfreebsd-loader (<< 5.4-1.3)
+Provides: kfreebsd-image-7, kfreebsd-image
+Recommends: 
+Description: kernel of FreeBSD 7.0 image
+ This package provides the binary image and pre-built loadable modules for 
+ the kernel of FreeBSD 7.0, base of a GNU/kFreeBSD system.
+ .
+ This package is compiled for a 586-smp-class machine.
+
+Package: ndiswrapper-modules-7.0-1-586-smp
+Architecture: kfreebsd-i386
+Section: contrib/net
+Priority: optional
+Depends: kfreebsd-image-7.0-1-586-smp
+Description: Ndiswrapper kFreeBSD module
+ This package contains the ndiswrapper loadable kernel modules for the
+ kfreebsd-image-7.0-1-586-smp package.
+
+Package: kfreebsd-image-7-586-smp
+Architecture: kfreebsd-i386
+Section: base
+Depends: kfreebsd-image-7.0-1-586-smp
+Description: kernel of FreeBSD 7 image
+ This package depends on the latest binary image for kernel of FreeBSD 7 on
+ 586-smp-class machines.
+
+Package: kfreebsd-headers-7.0-1-586-smp
+Architecture: kfreebsd-i386
+Section: devel
+Provides: kfreebsd-headers-7
+Depends: kfreebsd-headers-7.0-1 (= ${binary:Version})
+Description: header files for kernel of FreeBSD 7.0
+ This package provides the header files for kernel of FreeBSD 7.0, generally 
+ used for building out-of-tree kernel modules. These files are going to be 
+ installed into /usr/src/kfreebsd-headers-7.0-1-586-smp, and can be 
+ used for building modules that load into the kernel provided by the 
+ kfreebsd-image-7.0-1-586-smp package.
+
+Package: kfreebsd-headers-7-586-smp
+Architecture: kfreebsd-i386
+Section: devel
+Depends: kfreebsd-headers-7.0-1-586-smp
+Description: header files for kernel of FreeBSD 7
+ This package depends on the latest header files for kernel of FreeBSD 7 on
+ 586-smp-class machines.
+  
+Package: kfreebsd-image-7.0-1-686
+Architecture: kfreebsd-i386
+Section: base
+Depends: freebsd-utils (>= 5), module-init-tools (>= 6.1-6)
+Conflicts: kfreebsd-loader (<< 5.4-1.3)
+Provides: kfreebsd-image-7, kfreebsd-image
+Recommends: libc0.1-i686
+Description: kernel of FreeBSD 7.0 image
+ This package provides the binary image and pre-built loadable modules for 
+ the kernel of FreeBSD 7.0, base of a GNU/kFreeBSD system.
+ .
+ This package is compiled for a 686-class machine.
+
+Package: ndiswrapper-modules-7.0-1-686
+Architecture: kfreebsd-i386
+Section: contrib/net
+Priority: optional
+Depends: kfreebsd-image-7.0-1-686
+Description: Ndiswrapper kFreeBSD module
+ This package contains the ndiswrapper loadable kernel modules for the
+ kfreebsd-image-7.0-1-686 package.
+
+Package: kfreebsd-image-7-686
+Architecture: kfreebsd-i386
+Section: base
+Depends: kfreebsd-image-7.0-1-686
+Description: kernel of FreeBSD 7 image
+ This package depends on the latest binary image for kernel of FreeBSD 7 on
+ 686-class machines.
+
+Package: kfreebsd-headers-7.0-1-686
+Architecture: kfreebsd-i386
+Section: devel
+Provides: kfreebsd-headers-7
+Depends: kfreebsd-headers-7.0-1 (= ${binary:Version})
+Description: header files for kernel of FreeBSD 7.0
+ This package provides the header files for kernel of FreeBSD 7.0, generally 
+ used for building out-of-tree kernel modules. These files are going to be 
+ installed into /usr/src/kfreebsd-headers-7.0-1-686, and can be 
+ used for building modules that load into the kernel provided by the 
+ kfreebsd-image-7.0-1-686 package.
+
+Package: kfreebsd-headers-7-686
+Architecture: kfreebsd-i386
+Section: devel
+Depends: kfreebsd-headers-7.0-1-686
+Description: header files for kernel of FreeBSD 7
+ This package depends on the latest header files for kernel of FreeBSD 7 on
+ 686-class machines.
+  
+Package: kfreebsd-image-7.0-1-686-smp
+Architecture: kfreebsd-i386
+Section: base
+Depends: freebsd-utils (>= 5), module-init-tools (>= 6.1-6)
+Conflicts: kfreebsd-loader (<< 5.4-1.3)
+Provides: kfreebsd-image-7, kfreebsd-image
+Recommends: libc0.1-i686
+Description: kernel of FreeBSD 7.0 image
+ This package provides the binary image and pre-built loadable modules for 
+ the kernel of FreeBSD 7.0, base of a GNU/kFreeBSD system.
+ .
+ This package is compiled for a 686-smp-class machine.
+
+Package: ndiswrapper-modules-7.0-1-686-smp
+Architecture: kfreebsd-i386
+Section: contrib/net
+Priority: optional
+Depends: kfreebsd-image-7.0-1-686-smp
+Description: Ndiswrapper kFreeBSD module
+ This package contains the ndiswrapper loadable kernel modules for the
+ kfreebsd-image-7.0-1-686-smp package.
+
+Package: kfreebsd-image-7-686-smp
+Architecture: kfreebsd-i386
+Section: base
+Depends: kfreebsd-image-7.0-1-686-smp
+Description: kernel of FreeBSD 7 image
+ This package depends on the latest binary image for kernel of FreeBSD 7 on
+ 686-smp-class machines.
+
+Package: kfreebsd-headers-7.0-1-686-smp
+Architecture: kfreebsd-i386
+Section: devel
+Provides: kfreebsd-headers-7
+Depends: kfreebsd-headers-7.0-1 (= ${binary:Version})
+Description: header files for kernel of FreeBSD 7.0
+ This package provides the header files for kernel of FreeBSD 7.0, generally 
+ used for building out-of-tree kernel modules. These files are going to be 
+ installed into /usr/src/kfreebsd-headers-7.0-1-686-smp, and can be 
+ used for building modules that load into the kernel provided by the 
+ kfreebsd-image-7.0-1-686-smp package.
+
+Package: kfreebsd-headers-7-686-smp
+Architecture: kfreebsd-i386
+Section: devel
+Depends: kfreebsd-headers-7.0-1-686-smp
+Description: header files for kernel of FreeBSD 7
+ This package depends on the latest header files for kernel of FreeBSD 7 on
+ 686-smp-class machines.
+  
--- kfreebsd-7-7.0.orig/debian/control.in
+++ kfreebsd-7-7.0/debian/control.in
@@ -0,0 +1,34 @@
+Source: kfreebsd-@major@
+Section: devel
+Priority: optional
+Maintainer: GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>
+Uploaders: Aurelien Jarno <aurel32@debian.org>, Guillem Jover <guillem@debian.org>
+Vcs-Browser: http://svn.debian.org/wsvn/glibc-bsd/trunk/kfreebsd-@major@/
+Vcs-Svn: svn://svn.debian.org/glibc-bsd/trunk/kfreebsd-@major@/
+Build-Depends: debhelper (>= 4.1.0), bzip2, quilt, freebsd-buildutils (>= @major@) [kfreebsd-i386 kfreebsd-amd64] | freebsd6-buildutils (>=  6.2) [kfreebsd-i386 kfreebsd-amd64], libdb-dev, flex-old | flex, libbsd-dev [kfreebsd-i386 kfreebsd-amd64], gcc-4.3 [kfreebsd-i386 kfreebsd-amd64], sharutils
+Standards-Version: 3.8.0
+
+Package: kfreebsd-source-@version@
+Architecture: all
+Section: devel
+Recommends: freebsd-buildutils (>= @major@) | freebsd@major@-buildutils
+Provides: kfreebsd-source-@major@, kfreebsd-source
+Description: source code for kernel of FreeBSD @version@ with Debian patches
+ This package provides the source code for kernel of FreeBSD @version@, base of 
+ a GNU/kFreeBSD system.
+
+Package: kfreebsd-headers-@version@-@abiname@
+Architecture: kfreebsd-i386 kfreebsd-amd64
+Section: devel
+Description: Common architecture-specific header files for kernel of FreeBSD @version@
+ This package provides the architecture-specific common kernel header files for 
+ kernel of FreeBSD @version@, generally used for building out-of-tree kernel 
+ modules. To obtain a complete set of headers you also need to install the 
+ kfreebsd-headers-@version@-@abiname@-(flavour) package, matching the flavour of the
+ kernel you intend the build for. To obtain such a set for the currently running
+ kernel it is sufficient to run a command
+ .
+ apt-get install kfreebsd-headers-$(uname -r)
+ .
+ and it will be unpacked in /usr/src/kfreebsd-headers-@version@-@abiname@-(flavour)
+
--- kfreebsd-7-7.0.orig/debian/control.flavor.in
+++ kfreebsd-7-7.0/debian/control.flavor.in
@@ -0,0 +1,50 @@
+Package: kfreebsd-image-@version@-@abiname@-@flavor@
+Architecture: kfreebsd-@arch@
+Section: base
+Depends: freebsd-utils (>= 5), module-init-tools (>= 6.1-6)
+Conflicts: kfreebsd-loader (<< 5.4-1.3)
+Provides: kfreebsd-image-@major@, kfreebsd-image
+Recommends: @recommends@
+Description: kernel of FreeBSD @version@ image
+ This package provides the binary image and pre-built loadable modules for 
+ the kernel of FreeBSD @version@, base of a GNU/kFreeBSD system.
+ .
+ This package is compiled for a @flavor@-class machine.
+
+Package: ndiswrapper-modules-@version@-@abiname@-@flavor@
+Architecture: kfreebsd-@arch@
+Section: contrib/net
+Priority: optional
+Depends: kfreebsd-image-@version@-@abiname@-@flavor@
+Description: Ndiswrapper kFreeBSD module
+ This package contains the ndiswrapper loadable kernel modules for the
+ kfreebsd-image-@version@-@abiname@-@flavor@ package.
+
+Package: kfreebsd-image-@major@-@flavor@
+Architecture: kfreebsd-@arch@
+Section: base
+Depends: kfreebsd-image-@version@-@abiname@-@flavor@
+Description: kernel of FreeBSD @major@ image
+ This package depends on the latest binary image for kernel of FreeBSD @major@ on
+ @flavor@-class machines.
+
+Package: kfreebsd-headers-@version@-@abiname@-@flavor@
+Architecture: kfreebsd-@arch@
+Section: devel
+Provides: kfreebsd-headers-@major@
+Depends: kfreebsd-headers-@version@-@abiname@ (= ${binary:Version})
+Description: header files for kernel of FreeBSD @version@
+ This package provides the header files for kernel of FreeBSD @version@, generally 
+ used for building out-of-tree kernel modules. These files are going to be 
+ installed into /usr/src/kfreebsd-headers-@version@-@abiname@-@flavor@, and can be 
+ used for building modules that load into the kernel provided by the 
+ kfreebsd-image-@version@-@abiname@-@flavor@ package.
+
+Package: kfreebsd-headers-@major@-@flavor@
+Architecture: kfreebsd-@arch@
+Section: devel
+Depends: kfreebsd-headers-@version@-@abiname@-@flavor@
+Description: header files for kernel of FreeBSD @major@
+ This package depends on the latest header files for kernel of FreeBSD @major@ on
+ @flavor@-class machines.
+  
--- kfreebsd-7-7.0.orig/debian/copyright
+++ kfreebsd-7-7.0/debian/copyright
@@ -0,0 +1,64 @@
+This package was debianized by Nathan Hawkins <utsl@debian.org> on
+Thu, 18 Jul 2002 12:43:02 -0400.
+
+It was downloaded from FreeBSD CVS (http://www.freebsd.org/)
+
+Upstream Author: The FreeBSD Project
+
+Copyright:
+  Copyright (c) 1992-2008 The FreeBSD Project.
+  Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
+          The Regents of the University of California. All rights reserved.
+
+License:
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted under the terms of the BSD License.
+
+    THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+    ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+    ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+    FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+    OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+    SUCH DAMAGE.
+
+On Debian GNU systems, the complete text of the BSD License can be 
+found in `/usr/share/common-licenses/BSD'.
+
+There are, however, some exceptions. Parts of this package are distributed
+under other licenses:
+
+  Sources in `src/gnu' directory are licensed under the GNU General Public
+  License. On Debian GNU systems, the complete text of the GNU General Public
+  License can be found in `/usr/share/common-licenses/GPL'.
+
+  Sources/Binaries in the following directories are licensed under
+  DFSG-incompatible terms and were therefore removed from the package
+  (and disabled in the build system):
+
+src/sys/compat/opensolaris
+src/sys/contrib/dev/ath
+src/sys/contrib/dev/nve
+src/sys/contrib/dev/oltr
+src/sys/contrib/opensolaris
+src/sys/dev/hptmv
+src/sys/dev/hptrr
+src/sys/dev/rr232x
+
+  The following directories contained code that is itself free, but depends
+  on the above cited non-free sources and was also removed (and disabled):
+
+src/sys/dev/ath
+src/sys/dev/nve
+src/sys/modules/ath
+src/sys/modules/ath_hal
+src/sys/modules/hptmv
+src/sys/modules/hptrr
+src/sys/modules/nve
+src/sys/modules/oltr
+src/sys/modules/rr232x
+src/sys/modules/zfs
--- kfreebsd-7-7.0.orig/debian/kfreebsd-image.postinst.in
+++ kfreebsd-7-7.0/debian/kfreebsd-image.postinst.in
@@ -0,0 +1,64 @@
+#! /bin/bash
+# postinst script
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+
+case "$1" in
+    configure)
+	for i in kernel.gz acpi.ko ; do
+		if test -e /boot/kernel/$i && ! test -L /boot/kernel/$i ; then
+			echo "What happen!! /boot/kernel/$i exists but is not a symlink."
+			exit 1
+		fi
+	done
+
+	if [ "$(readlink -f /boot/kernel/kernel.gz)" != "/boot/kfreebsd-@RELEASE@.gz" ] ; then
+		rm -f /boot/kernel/kernel{,.gz}.old{,.gz}
+		if [ -L /boot/kernel/kernel.gz ] ; then
+			mv /boot/kernel/kernel{,.old}.gz
+		fi
+		ln -s /boot/kfreebsd-@RELEASE@.gz /boot/kernel/kernel.gz
+	fi
+
+	# acpi MUST be within kfreebsd-loader reach
+	if [ "$(readlink -f /boot/kernel/acpi.ko)" != "/lib/modules/@RELEASE@/acpi.ko" ] ; then
+		rm -f /boot/kernel/acpi.ko.old
+		if [ -L /boot/kernel/acpi.ko ] ; then
+			mv /boot/kernel/acpi.ko{,.old}
+		fi
+		ln -s /lib/modules/@RELEASE@/acpi.ko /boot/kernel/acpi.ko
+	fi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
--- kfreebsd-7-7.0.orig/debian/kfreebsd-image.overrides
+++ kfreebsd-7-7.0/debian/kfreebsd-image.overrides
@@ -0,0 +1,3 @@
+shlib-with-non-pic-code
+shared-lib-without-dependency-information
+
--- kfreebsd-7-7.0.orig/debian/changelog
+++ kfreebsd-7-7.0/debian/changelog
@@ -0,0 +1,621 @@
+kfreebsd-7 (7.0-7) unstable; urgency=low
+
+  [ Petr Salinger ]
+  * libdb-dev is now a real package, build-depend only on it.
+    Closes: #501420.
+  * use and prefer freebsd-buildutils over freebsd7-buildutils.
+    Closes: #474762.
+  * add Vcs-* fields into debian/control.
+
+  [ Aurelien Jarno ]
+  * Bumped Standards-Version to 3.8.0 (no changes).
+
+ -- Aurelien Jarno <aurel32@debian.org>  Tue, 07 Oct 2008 14:23:26 +0200
+
+kfreebsd-7 (7.0-6) unstable; urgency=high
+
+  * Fix IPv6 Neighbor Discovery Protocol routing vulnerability
+    (FreeBSD-SA-08:10.nd6 / CVE-2008-2476).
+
+ -- Aurelien Jarno <aurel32@debian.org>  Mon, 06 Oct 2008 15:35:56 +0200
+
+kfreebsd-7 (7.0-5) unstable; urgency=high
+
+  * Fix amd64 swapgs local privilege escalation 
+    (FreeBSD-SA-08:07.amd64 / CVE-2008-3890).
+  * Fix nmount(2) local arbitrary code execution 
+    (FreeBSD-SA-08:08.nmount / CVE-2008-3531).
+  * Fix remote kernel panics on IPv6 connections 
+    (FreeBSD-SA-08:09.icmp6 /CVE-2008-3530).
+
+ -- Aurelien Jarno <aurel32@debian.org>  Thu, 04 Sep 2008 11:49:44 +0200
+
+kfreebsd-7 (7.0-4) unstable; urgency=medium
+
+  [ Petr Salinger ]
+  * Fix subsecond timestamp resolution handling for *times(arg, NULL)
+    syscall family. Exposed by touch. Closes: #489894.
+
+  [ Aurelien Jarno ]
+  * Build by gcc-4.3
+
+ -- Aurelien Jarno <aurel32@debian.org>  Thu, 10 Jul 2008 11:11:11 +0200
+
+kfreebsd-7 (7.0-3) unstable; urgency=medium
+
+  * Fix tcp options padding (FreeBSD-EN-08:02.tcp).
+
+ -- Aurelien Jarno <aurel32@debian.org>  Tue, 24 Jun 2008 10:44:25 +0200
+
+kfreebsd-7 (7.0-2) unstable; urgency=low
+
+  * 030_abi_cld.diff: new patch to clear the direction flag before calling
+    a signal handler (Closes: bug#469565).
+  * Fix debian/copyright.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Thu, 06 Mar 2008 01:17:26 +0100
+
+kfreebsd-7 (7.0-1) unstable; urgency=low
+
+  [ Petr Salinger ]
+  * New upstream version (RELENG_7_0_0_RELEASE)
+     - update of some patches
+
+ -- Aurelien Jarno <aurel32@debian.org>  Wed, 27 Feb 2008 21:10:03 +0100
+
+kfreebsd-7 (7.0~cvs20080107-1) unstable; urgency=low
+
+  [ Petr Salinger ]
+  * New upstream snapshot (RELENG_7_0)
+  * Disable non-free "hptrr" driver - another Highpoint RocketRAID
+
+  [ Aurelien Jarno ]
+  * Refresh all patches.
+  * Bumped Standards-Version to 3.7.3 (no changes). 
+
+ -- Aurelien Jarno <aurel32@debian.org>  Mon, 07 Jan 2008 11:48:14 +0100
+
+kfreebsd-7 (7.0~cvs20071209-1) experimental; urgency=low
+
+  [ Petr Salinger ]
+  * New upstream snapshot of RELENG_7
+     - update of some patches
+  * Reorder freebsd6-buildutils and freebsd7-buildutils in Build-Depends
+  * Add build-dependency on quilt, and use quilt in debian/rules
+  * arch/i386/586.config and arch/i386/586-smp.config: also support i686 CPU.
+  * Changed building rules to be correctly buildable with current binutils
+     - add 020_linker.diff and gen-ld-u-options
+     - extend 912_binutils.diff
+
+ -- Aurelien Jarno <aurel32@debian.org>  Sun, 09 Dec 2007 00:41:25 +0100
+
+kfreebsd-7 (7.0~cvs20071023-1) experimental; urgency=low
+
+  [ Aurelien Jarno ]
+  * Initial upload to experimental.
+
+  [ Petr Salinger ]
+  * New upstream snapshot of RELENG_7
+     - refresh of some patches
+  * Restrict some Build-Depends only for kfreebsd architectures
+
+ -- Aurelien Jarno <aurel32@debian.org>  Tue, 23 Oct 2007 17:20:02 +0200
+
+kfreebsd-7 (7.0~cvs20070710-1) unreleased; urgency=low
+
+  [ Petr Salinger ]
+  * New upstream snapshot of HEAD
+     - drop 000_* patches (already in upstream)
+     - drop obsolete 005_grow_arg_max patch
+     - update of some remaining patches
+  * Disable GPL incompatible "zfs"
+  * Build by gcc-4.2
+
+ -- Aurelien Jarno <aurel32@debian.org>  Wed, 11 Jul 2007 07:22:03 +0200
+
+kfreebsd-6 (6.2-3) unreleased; urgency=low
+
+  * debian/rules:
+    - add support for ~ in the version number.
+    - remove the hack for preliminar snapshots.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Wed, 11 Jul 2007 05:12:02 +0200
+
+kfreebsd-6 (6.2-2) unreleased; urgency=low
+
+  * Fix a possible DoS using IPv6 Routing Header 0 (FreeBSD-SA-07:03.ipv6
+    / CVE-2007-2242).
+
+ -- Aurelien Jarno <aurel32@debian.org>  Thu, 03 May 2007 16:05:58 +0200
+
+kfreebsd-6 (6.2-1) unreleased; urgency=low
+
+  [ Petr Salinger ]
+  * New upstream version (RELENG_6_2_0_RELEASE)
+     - drop obsolete 000_kmem, 000_net, 000_ppp, 000_smbfs,
+                     002_glibc_dev_isp, 006_proc_mounts patches
+     - update 009_disable_duped_modules, 
+              903_disable_non-free_drivers,
+              999_config patches
+
+ -- Aurelien Jarno <aurel32@debian.org>  Thu,  4 Jan 2007 21:56:16 +0100
+
+kfreebsd-6 (6.1-4) unreleased; urgency=low
+
+  [ Petr Salinger ]
+  * restrict renaming of ld.so only for native FreeBSD libc
+
+ -- Aurelien Jarno <aurel32@debian.org>  Thu,  4 Jan 2007 21:56:16 +0100
+
+kfreebsd-6 (6.1-3) unreleassed; urgency=low
+
+  * Remove the CVS/ directory from kfreebsd-source-6.
+  * Change the linker script from from elf64-x86-64 to elf64-x86-64-freebsd.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Tue,  2 Jan 2007 00:37:24 +0100
+
+kfreebsd-6 (6.1-2) unreleased; urgency=low
+
+  * Remove kldutils from the dependencies alternatives.
+  * Remove kfreebsd-common from the dependencies now that module-init-tools
+    does the job, and bump the dependency on module-init-tools to (>= 6.1-6).
+  * Create a /boot/kernel/ directory.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Mon,  1 Jan 2007 23:15:59 +0100
+
+kfreebsd-6 (6.1-1) unreleased; urgency=low
+
+  * Urgency set to high as this fixes a security bug.
+  * Fix a memory disclosure in firewire (FreeBSD-SA-06:25.kmem
+    / CVE-2006-6013).
+
+ -- Aurelien Jarno <aurel32@debian.org>  Mon, 11 Dec 2006 11:34:26 +0100
+
+kfreebsd-6 (6.1-0.4) unreleased; urgency=low
+
+  * Backport the NVIDIA nForce MCP Ethernet driver from FREEBSD-7.0.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Fri,  3 Nov 2006 18:23:17 +0100
+
+kfreebsd-6 (6.1-0.3) unreleased; urgency=low
+
+  * Relax the conflict with kfreebsd-loader to (<< 5.4-1.3). 
+
+ -- Aurelien Jarno <aurel32@debian.org>  Thu, 12 Oct 2006 16:19:38 +0200
+
+kfreebsd-6 (6.1-0.2) unreleased; urgency=low
+
+  [ Aurelien Jarno ]
+  * patches/999_config.diff: remove COMPAT_LINUX from amd64.
+  * Make the images conflict with kfreebsd-loader (<< 5.4-3).
+
+  [ Petr Salinger ]
+  * Fix buffer overflow in sppp (FreeBSD-SA-06:08.ppp / CVE-2006-4304).
+  * Fix networking issues (FreeBSD-EN-06:02.net).
+
+ -- Aurelien Jarno <aurel32@debian.org>  Tue, 10 Oct 2006 11:47:04 +0200
+
+kfreebsd-6 (6.1-0.1) unreleased; urgency=low
+
+  [ Petr Salinger ]
+  * New upstream version (RELENG_6_1_0_RELEASE)
+     - drop 000_* patches (already in upstream)
+     - rework 010_ET_DYN.diff
+     - update remaining patches (with great help from quilt)
+     - add 018_genassym_MAXCPU.diff
+  * Fix smbfs chroot escape (FreeBSD-SA-06:16.smbfs / CVE-2006-2654).
+  * Re-enable hwpmc driver
+  * Disable non-free "rr232x" driver - another Highpoint RocketRAID
+  * Do not load directly executed shared library (e.g. ld.so) at base addr 0
+
+  [ Aurelien Jarno ]
+  * Bumped Standards-Version to 3.7.2 (no changes). 
+
+ -- Aurelien Jarno <aurel32@debian.org>  Tue, 25 Jul 2006 00:58:48 +0200
+
+kfreebsd-6 (6.0-0.4) unreleased; urgency=low
+
+  * Re-enable atapi{fd,st}, ppc and psm, since they aren't being built
+    as modules (Oh my god! My mouse, printer and/or ultra-weird storage device
+    stopped working!).
+  * Fix broken perms (644) in module dir.
+
+ -- Robert Millan <rmh@aybabtu.com>  Fri, 28 Apr 2006 15:47:45 +0200
+
+kfreebsd-6 (6.0-0.3) unreleased; urgency=low
+
+  * Finaly, multiple kernels can coexist on your system!
+    - Disable /boot/loader.conf (provided in kfreebsd-loader now).
+    - Get rid of /boot/device.hints (now embedded in kernel image).
+    - Move modules to /lib/modules/@RELEASE@.
+    - Move kernel image to /boot/kfreebsd-@RELEASE@.
+  * patches/999_config.diff: Refurbish.  Now builds linprocfs/linux into
+    the kernel (since it's always used), and removes a bunch of non-
+    essential stuff (use kfreebsd-common to load them as modules).
+    Network and storage drivers _are_ still present (untill we port
+    hotplug/discover).  On -486, this saves 544 KB in kernel.gz.
+
+ -- Robert Millan <rmh@aybabtu.com>  Thu, 27 Apr 2006 18:56:22 +0200
+
+kfreebsd-6 (6.0-0.2) unreleased; urgency=low
+
+  * First "normal" upload to unreleased.
+
+ -- Robert Millan <rmh@aybabtu.com>  Wed, 26 Apr 2006 14:55:28 +0200
+
+kfreebsd-6 (6.0-0.1) unreleased; urgency=low
+
+  [ Robert Edmonds ]
+  * New upstream version pulled from RELENG_6 CVSup.
+    - ReiserFS support.  (Closes: #335019)
+  * Disabled the non-compiling hwpmc driver.
+
+  [ Robert Millan ]
+  * Merge 5.x branch changes (from rev 654 to rev 1058)
+  * Add src/usr.sbin/config into the source and build/use it dynamicaly.
+  * Fix IEEE 802.11 buffer overflow (FreeBSD-SA-06:05.80211 / CVE-2006-0226).
+  * Fix local kernel memory disclosure (FreeBSD-SA-06:06.kmem / CVE-2006-0379
+    / CVE-2006-0380).
+  * Fix IP fragment handling panic in pf (FreeBSD-SA-06:07.pf / CVE-2006-0381).
+  * Disable "nve" driver.
+    - copyright: Add nve to list of non-free components.
+    - patches/903_disable_non-free_drivers.diff: Disable nve.
+    - arch/i386/486.config: Ditto.
+  * control.in:
+    - (Build-Depends-Indep): Remove patchutils and sharutils (not really
+    needed).
+    - (Build-Depends): Ditto.  Also update libdb4.4-dev.
+    - (Replaces): Remove kfreebsd@major@-source (it never existed for 6.x).
+  * rules: When obtaining major/version numbers, if this is a preliminar
+    snapshot (e.g. 6.99+20060217), pretend this is the actual release.
+  * autopatch.sh: Merge into rules.  This allows us to use $(major) instead
+    of a hardcoded number.
+  * patches/001_misc.diff: Make this patch more upstream-friendly.
+  * Fix /dev permissions in userland.
+    - control.flavor.in (Depends): Add kfreebsd-common.
+    - patches/900_devfs_perm_fixes.diff: Remove.
+  * rules: Run patch with --dry-run first.  This way if a patch fails
+    the tree isn't left in an inconsistent state.
+  * Add ndiswrapper-modules package.
+    - rules: Install ndis.ko and if_ndis.ko there.
+    - control.flavor.in: Add ndiswrapper-modules flavor.
+  * AMD64 support.
+    - patches/*.diff: Add amd64-specific hunks for patches that hack i386 files.
+    - arch/amd64/amd64-generic.config: New.  Generic x86_64 config.
+    - arch/amd64/amd64-k8.config: New.  K8 config.
+    - arch/amd64/amd64-k8-smp.config: New.  K8 SMP config.
+    - arch/amd64/em64t-p4.config: New.  P4 config.
+    - arch/amd64/em64t-p4-smp.config: New.  P4 SMP config.
+    - patches/binutils.diff: Add binutils fixes for amd64 code.
+    - rules: Replace all "dh_* -a" with "dh_* -s".  -a should NEVER be used.
+      See debhelper(7).
+  * Simplify/refurbish kernel config files by using the "include" command.
+    - patches/999_config.diff: New.  Incorporate common changes in GENERIC.
+    - debian/rules: Copy all our config files into the tree, then symlink.
+    - debian/arch/*/*.config: Refurbish.
+  * Upstream now builds with "-O2 -frename-registers" so let's do that
+    as well.
+    - arch/*/*.config
+  * Disable build of modules that are already part of the kernel image.
+    This gives the .deb a size loss of ~1600 KB (~4 MB once installed).
+    - patches/009_disable_duped_modules.diff
+  * Build 486 and 586* flavors with -Os.  This saves 400 KB, out of
+    which 240 KB are in kernel.gz.  Rationale:
+    - 486 tiny flavor is needed for d-i.
+    - On old hardware, your amount of memory is likely to be utter crap.  So
+    this is preferable to -O2 no matter the benchmarks.
+
+  [ Aurelien Jarno ]
+  * Fix a remote denial of service in NFS server (FreeBSD-SA-06:10.nfs /
+    CVE-2006-0900).
+  * Fix an IPsec replay attack vulnerability (FreeBSD-SA-06:11.ipsec /
+    CVE-2006-0905).
+  * Fix an FPU information disclosure on AMD processors (FreeBSD-SA-06:14.fpu /
+    CVE-2006-1056).
+
+ -- Robert Millan <rmh@aybabtu.com>  Wed, 26 Apr 2006 12:06:11 +0200
+
+kfreebsd-5 (5.3-6) unstable; urgency=low
+
+  * Changed SCSI_DELAY to 2000. Users that need a longer time could
+    change this value in /boot/loader.conf (closes: bug#323155).
+
+ -- Aurelien Jarno <aurel32@debian.org>  Mon, 29 Aug 2005 14:25:44 +0200
+
+kfreebsd-5 (5.3-5) unstable; urgency=low
+
+  * Enabled atapicam driver (closes: bug#323155).
+  * Allow the kernel to execve ET_DYN files. 
+
+ -- Aurelien Jarno <aurel32@debian.org>  Wed, 17 Aug 2005 15:44:18 +0200
+
+kfreebsd-5 (5.3-4) unstable; urgency=low
+
+  * Added OSS_GETVERSION ioctl. Patch from Robert Millan (closes: 
+    bug#322197)
+
+ -- Aurelien Jarno <aurel32@debian.org>  Wed, 10 Aug 2005 00:56:00 +0200
+
+kfreebsd-5 (5.3-3) unstable; urgency=low
+
+  * Fixed the generation of the preinst script.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Sat,  6 Aug 2005 05:47:11 +0200
+
+kfreebsd-5 (5.3-2) unstable; urgency=low
+
+  [ Aurelien Jarno ]
+  * Provide the kernel sources as /usr/src/kfreebsd-source-5.3.tar.bz2
+  * Change the owner of the files inside kfreebsd-source-5.3.tar.bz2 to
+    root:src.
+  * Build a binary package kfreebsd-image-5.3 containing the kernel.
+  * Build a binary package kfreebsd-headers-5.3 containing the headers.
+  * Don't create kfreebsd.gz in postinst.
+  * Make the kfreebsd-source-5.3 buildable on non GNU/kFreeBSD systems.
+  * Added an abiname field.
+
+  [ Guillem Jover ]
+  * debian/rules:
+    - Use DEB_HOST_ARCH_CPU instead if DEB_HOST_GNU_CPU, fix amd64.
+    - Use SRC_PACKAGE instead of the tarball name.
+    - Use make -C option instead of "cd".
+  * General indentation fixes.
+
+  [ Robert Millan ]
+  * Put some drivers as modules.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Sat,  6 Aug 2005 00:09:57 +0200
+
+kfreebsd-5 (5.3-1) unstable; urgency=low
+
+  * Match linux kernel naming scheme:
+    - Renamed source package to kfreebsd-5.
+    - Renamed kfreebsd5-source to kfreebsd-source-5.
+  * Fix ipsec vulnerability (FreeBSD-SA-05:19.ipsec /
+  * CAN-2005-2359).
+    - patches/017_ipsec.diff
+
+ -- Aurelien Jarno <aurel32@debian.org>  Wed, 27 Jul 2005 17:44:01 +0200
+
+kfreebsd5-source (5.3-17) unstable; urgency=high
+
+  * Fix devfs ruleset bypass (FreeBSD-SA-05:17.devfs / CAN-2005-2218).
+    - patches/016_devfs.diff
+
+ -- Aurelien Jarno <aurel32@debian.org>  Wed, 20 Jul 2005 23:45:07 +0200
+
+kfreebsd5-source (5.3-16) unstable; urgency=low
+
+  * Fixed path of some patches.
+  * Don't change the build-dependencies at build-time.
+  * Bumped Standard-Version to 3.6.2.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Mon,  4 Jul 2005 01:18:41 +0200
+
+kfreebsd5-source (5.3-15) unstable; urgency=low
+
+  * Fix TCP denial of service (FreeBSD-SA-05:15.tcp / CAN-2005-0356).
+    - patches/015_tcp_dos.diff: New.  Patch from upstream.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Sat,  2 Jul 2005 15:29:27 +0200
+
+kfreebsd5-source (5.3-14) unstable; urgency=low
+
+  * Provides kfreebsd-source instead of kernel-source (closes: bug#312524).
+
+ -- Aurelien Jarno <aurel32@debian.org>  Fri, 10 Jun 2005 07:23:46 +0200
+
+kfreebsd5-source (5.3-13) unstable; urgency=low
+
+  * Changed to a team maintained package.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Mon,  6 Jun 2005 01:45:36 +0200
+
+kfreebsd5-source (5.3-12) unstable; urgency=low
+
+  * New maintainer. Thanks to Robert Millan for his great job.
+  * Added 014_ip_packed.diff to fix the build of MySQL on GNU/kFreeBSD.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Fri,  3 Jun 2005 07:52:08 +0200
+
+kfreebsd5-source (5.3-11) unstable; urgency=low
+
+  * Workaround hyperthreading CPU bug (FreeBSD-SA-05:09.htt / CAN-2005-0109).
+    - patches/013_hyperthreading_wa.diff: New.  Patch from upstream.
+
+ -- Robert Millan <rmh@debian.org>  Fri, 27 May 2005 14:07:37 +0200
+
+kfreebsd5-source (5.3-10) unstable; urgency=high
+
+  * Fix permissions in /dev/iir (FreeBSD-SA-05:06.iir / CAN-2005-1399).
+    - patches/010_iir_perms.diff:  New.  Patch from upstream.
+  * Fix memory leak in i386_get_ldt (FreeBSD-SA-05:07.ldt / CAN-2005-1400).
+    - patches/011_ldt_memleak.diff:  New.  Patch from upstream.
+  * Fix generic memory leak (FreeBSD-SA-05:08.kmem / CAN-2005-1406).
+    - patches/012_kmem_memleak.diff:  New.  Patch from upstream.
+
+ -- Robert Millan <rmh@debian.org>  Mon,  9 May 2005 12:25:31 +0200
+
+kfreebsd5-source (5.3-9) unstable; urgency=low
+
+  * Fix memory leak in ifconf (FreeBSD-SA-05:04.ifconf / Closes: #304766).
+    - patches/009_ifconf_memleak.diff:  New.  Patch from upstream.
+
+ -- Robert Millan <rmh@debian.org>  Fri, 15 Apr 2005 12:59:58 +0200
+
+kfreebsd5-source (5.3-8) unstable; urgency=low
+
+  * First upload to Debian.  (Closes: #267447)
+
+ -- Robert Millan <rmh@debian.org>  Thu,  7 Apr 2005 01:36:59 +0200
+
+kfreebsd5-source (5.3-7) unreleased; urgency=low
+
+  * Fix memory leak in sendfile (FreeBSD-SA-05:02.sendfile / CAN-2005-0708).
+    - patches/008_sendfile_memleak.diff:  New.  Patch from upstream.
+
+ -- Robert Millan <rmh@debian.org>  Tue,  5 Apr 2005 12:32:35 +0200
+
+kfreebsd5-source (5.3-6) unreleased; urgency=low
+
+  * control.in.in:  s/Build-Depends/&-Indep/g.
+  * control.in.in (Section):  Set to "devel".
+
+ -- Robert Millan <rmh@debian.org>  Wed, 23 Mar 2005 23:04:11 +0100
+
+kfreebsd5-source (5.3-5) unreleased; urgency=low
+
+  * patches/007_proc_mounts.diff:  New.  Rename /proc/mtab to /proc/mounts.
+
+ -- Robert Millan <rmh@debian.org>  Sat,  5 Mar 2005 19:56:20 +0100
+
+kfreebsd5-source (5.3-4) unreleased; urgency=low
+
+  * rules:  Use patchsys to test patches on every build.
+
+ -- Robert Millan <rmh@debian.org>  Wed,  2 Mar 2005 21:03:19 +0100
+
+kfreebsd5-source (5.3-3) unreleased; urgency=low
+
+  * Misc cleanup.
+  * patches/007_cpu_class.diff:  New.  Detect i*86 subarches in uname.
+
+ -- Robert Millan <rmh@debian.org>  Thu, 10 Feb 2005 15:25:58 +0100
+
+kfreebsd5-source (5.3-2) unreleased; urgency=low
+
+  * Grow Sysv IPC limits to reasonable values as advised in
+    postgresql documentation (kernel-resources.html#SYSVIPC-PARAMETERS).
+    - patches/906_grow_sysv_ipc_limits.diff
+
+ -- Robert Millan <rmh@debian.org>  Tue,  1 Feb 2005 21:48:07 +0100
+
+kfreebsd5-source (5.3-1) unreleased; urgency=low
+
+  * Package split.  Version rebumped.
+
+ -- Robert Millan <rmh@debian.org>  Tue, 25 Jan 2005 13:37:15 +0100
+
+kfreebsd5 (5.3+1-1) unreleased; urgency=low
+
+  * Add RTC (real time clock) driver implementation.
+    - rtc.tar.gz:  New.
+    - rules:  Build rtc.
+
+ -- Robert Millan <rmh@debian.org>  Tue, 28 Dec 2004 19:33:00 +0100
+
+kfreebsd5 (5.3-3) unreleased; urgency=low
+
+  * Set DEB_STRIP_EXCLUDE=/boot to avoid module inter-dependency problems.
+
+ -- Robert Millan <rmh@debian.org>  Mon, 27 Dec 2004 18:36:30 +0100
+
+kfreebsd5 (5.3-2) unreleased; urgency=low
+
+  * Fix memory leak in procfs (FreeBSD-SA-04:17.procfs / CAN-2004-1066).
+    - patches/006_procfs_memleak.diff:  New.  Patch from upstream.
+
+ -- Robert Millan <rmh@debian.org>  Thu,  2 Dec 2004 01:32:38 +0100
+
+kfreebsd5 (5.3-1) unreleased; urgency=low
+
+  * New upstream release.
+
+ -- Robert Millan <rmh@debian.org>  Fri, 26 Nov 2004 00:42:22 +0100
+
+kfreebsd5 (5.2.1-8) unreleased; urgency=low
+
+  * Bunch of miscellaneous fixes in preparation of 6.x branch split.
+
+ -- Robert Millan <rmh@debian.org>  Tue, 16 Nov 2004 17:13:46 +0100
+
+kfreebsd5 (5.2.1-7) unreleased; urgency=low
+
+  * Fix local memory leak vulnerability (FreeBSD-SA-04:15.syscons /
+    CAN-2004-0919).
+    - patches/000_syscons_vulnerability.diff: New.  Patch from upstream.
+  * Fix wrong permissions in some device files.
+    - patches/900_devfs_perm_fixes.diff: New.  Sync uids/gids of kernel devices
+      with debian base-passwd ones.
+  * Rename some patches to follow the guidelines in README.
+    - README: New.
+    - etc.
+  * Use cdbs debian/control autogen feature.
+    - control.in: Rename to control.in.in and set the @cdbs@ tag.
+    - rules: Set DEB_AUTO_UPDATE_DEBIAN_CONTROL = yes.
+    - mk/build.mk (clean): Generate control.in from control.in.in.
+
+ -- Robert Millan <rmh@debian.org>  Tue,  5 Oct 2004 00:58:50 +0200
+
+kfreebsd5 (5.2.1-6) unreleased; urgency=low
+
+  * Use type-handling to auto-generate kfreebsd-gnu architecture list for dpkg.
+    - control.in
+    - mk/build.mk
+  * Ensure patches/003_config.diff contains a hunk for your CPU.
+    - mk/build.mk
+  * Drop Conflicts on makedev.
+    - control.in
+  * Grow ARG_MAX value to match with Linux' (Fixes FTBFS on a number of
+    packages).
+    - patches/016_grow_arg_max.diff: New.
+
+ -- Robert Millan <rmh@debian.org>  Sat, 21 Aug 2004 18:35:01 +0200
+
+kfreebsd5 (5.2.1-5) unreleased; urgency=low
+
+  * patches/004_version.diff.in: New. Fix version information.
+  * mk/build.mk: Regenerate 004_version.diff with current debian revision.
+
+ -- Robert Millan <rmh@debian.org>  Sat, 17 Jul 2004 02:14:34 +0200
+
+kfreebsd5 (5.2.1-4) unreleased; urgency=low
+
+  * patches/015_dev_full.diff: New. Implement /dev/full.
+  * control (Build-Depends): Allow flex as alternative for flex-old.
+
+ -- Robert Millan <rmh@debian.org>  Mon, 12 Jul 2004 19:14:46 +0200
+
+kfreebsd5 (5.2.1-3) unreleased; urgency=low
+
+  * control: Make it an Essential package.
+
+ -- Robert Millan <rmh@debian.org>  Tue,  6 Jul 2004 01:54:47 +0200
+
+kfreebsd5 (5.2.1-2) unreleased; urgency=low
+
+  * control (Build-Depends): Add flex-old.
+  * control (Depends): Nuke kfreebsd-loader.
+  * control (Conflicts): Add makedev.
+  * mk/build.mk: Add /boot/kfreebsd.gz and dummy /sbin/fsck.cd9660.
+
+ -- Robert Millan <rmh@debian.org>  Wed, 30 Jun 2004 19:25:58 +0200
+
+kfreebsd5 (5.2.1-1) unreleased; urgency=low
+
+  * New upstream release.
+
+ -- Robert Millan <rmh@debian.org>  Tue,  4 May 2004 14:02:40 +0200
+
+freebsd-kernel (5.1-1) unstable; urgency=low
+
+  * New source package structure. Now build-depends on freebsd-source-5.1.
+  * Switched to cdbs.
+  * Updated to version 5.1
+
+ -- Nathan Hawkins <utsl@debian.org>  Tue,  7 Oct 2003 12:43:36 -0500
+
+freebsd-kernel (5.0-2) unstable; urgency=low
+
+  * Set maintainer to glibc-bsd-devel@lists.alioth.debian.org
+  * Added me to Uploaders.
+  * Turn into non-native package.
+  * Added missing package to Build-Depends (freebsd-gcc)
+
+ -- Robert Millan <rmh@debian.org>  Fri, 11 Jul 2003 05:50:58 +0200
+
+freebsd-kernel-5.0 (5.0-1) unstable; urgency=low
+
+  * Initial release.
+
+ -- Nathan Hawkins <utsl@debian.org>  Mon,  3 Jul 2003 13:12:00 -0400
--- kfreebsd-7-7.0.orig/debian/compat
+++ kfreebsd-7-7.0/debian/compat
@@ -0,0 +1 @@
+4
--- kfreebsd-7-7.0.orig/debian/gen-ld-u-options
+++ kfreebsd-7-7.0/debian/gen-ld-u-options
@@ -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
--- kfreebsd-7-7.0.orig/debian/rules
+++ kfreebsd-7-7.0/debian/rules
@@ -0,0 +1,254 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+SHELL = bash
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+full_version	:= $(shell dpkg-parsechangelog | grep ^Version: | sed -e 's/^.*: //g')
+version		:= $(shell echo $(full_version) | sed -e 's/[~+-].*//g')
+major           := $(shell echo $(version) | sed -e 's/\..*//g')
+revision	:= $(shell echo $(full_version) | sed -e 's/^[^+-]*//g')
+os		:= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+cpu		:= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
+config_files	:= $(wildcard debian/arch/$(cpu)/*.config)
+flavours	:= $(config_files:debian/arch/$(cpu)/%.config=%)
+configfile	:= DEBCUSTOM
+abiname		:= 1
+
+SOURCE_PACKAGE	:= $(CURDIR)/debian/kfreebsd-source-$(version)
+IMAGE_PACKAGE	:= $(CURDIR)/debian/kfreebsd-image-$(version)-$(abiname)
+HEADERS_PACKAGE	:= $(CURDIR)/debian/kfreebsd-headers-$(version)-$(abiname)
+NDIS_PACKAGE	:= $(CURDIR)/debian/ndiswrapper-modules-$(version)-$(abiname)
+SRC_TAR		:= kfreebsd-source-$(version).tar.bz2
+SRC_DIR		:= kfreebsd-source-$(version)
+HEADERS_DIR	:= kfreebsd-headers-$(version)-$(abiname)
+FLAVOR_DIR	:= flavor-$(version)-$(abiname)
+
+MAKE		:= make MACHINE_ARCH=$(cpu) CC=gcc-4.3 WERROR=
+PATH		:= $(CURDIR)/config:/usr/lib/freebsd:$(PATH)
+
+control: clean
+	sed -e "s/@major@/$(major)/g" -e "s/@version@/$(version)/g" -e "s/@abiname@/$(abiname)/g" -e "s/@flavor@/$$flavor/g" \
+		$(CURDIR)/debian/control.in > $(CURDIR)/debian/control
+	for arch in `ls $(CURDIR)/debian/arch/` ; do \
+		for config in `ls $(CURDIR)/debian/arch/$$arch/ | grep \.config` ; do \
+			flavor=$${config/.config/} ; \
+			test -f $(CURDIR)/debian/arch/$$arch/$$flavor.defines && recommends=`awk '/^Recommends: / {print $$2}' $(CURDIR)/debian/arch/$$arch/$$flavor.defines` ; \
+			sed -e "s/@major@/$(major)/g" -e "s/@version@/$(version)/g" -e "s/@abiname@/$(abiname)/g" -e "s/@flavor@/$$flavor/g" -e "s/@arch@/$$arch/g" -e "s/@recommends@/$$recommends/g" \
+				$(CURDIR)/debian/control.flavor.in >> $(CURDIR)/debian/control ; \
+		done ; \
+	done
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -rf .pc src kfreebsd-source-* flavor-* config
+	rm -f debian/kfreebsd-image-*.postinst
+
+	rm -f *-stamp
+	dh_clean
+
+src: src-stamp
+src-stamp:
+	tar xfj $(CURDIR)/src.tar.bz2
+	
+	set -e ; find src -type d -name CVS | xargs rm -rf
+
+	set -e ; find src -type f | (while read i ; do \
+		sed -i $$i \
+		-e 's/defined\( \|\t\)*(\( \|\t\)*__FreeBSD__\( \|\t\)*)/defined(__FreeBSD_kernel__)/g' \
+		-e 's/#\( \|\t\)*ifdef\( \|\t\)*__FreeBSD__/#ifdef __FreeBSD_kernel__/g' \
+		-e 's/#\( \|\t\)*ifndef\( \|\t\)*__FreeBSD__/#ifndef __FreeBSD_kernel__/g' \
+		-e 's/__FreeBSD__/$(major)/g' \
+		-e 's,#\( \|\t\)*include\( \|\t\)*<sys/device.h>,,g' \
+		-e 's,#\( \|\t\)*include\( \|\t\)*<dev/rndvar.h>,,g' \
+		-e 's,#\( \|\t\)*include\( \|\t\)*<sys/pool.h>,,g' \
+		-e 's,#\( \|\t\)*include\( \|\t\)*<netinet/ip_ipsp.h>,,g' \
+		-e 's,#\( \|\t\)*include\( \|\t\)*\(<\|"\)bpfilter.h\(>\|"\),,g' \
+		-e 's,#\( \|\t\)*include\( \|\t\)*\(<\|"\)pflog.h\(>\|"\),,g' \
+	; done)
+	
+	set -e ; cd $(CURDIR)/src ; QUILT_PC=$(CURDIR)/.pc QUILT_PATCHES=$(CURDIR)/debian/patches quilt push -a ; cd $(CURDIR)
+	install debian/gen-ld-u-options src/usr.sbin/config
+	grep -v ^__FBSDID src/sys/kern/subr_sbuf.c > src/usr.sbin/config/sbuf.c
+
+	touch src-stamp
+
+build-indep: build-indep-stamp
+build-indep-stamp: src
+	dh_testdir
+	
+	cp -af src $(SRC_DIR)
+
+	touch build-indep-stamp
+
+ifeq ($(os), kfreebsd)
+build: build-arch build-indep
+else
+build: build-indep
+endif
+
+install-indep: install-indep-stamp
+install-indep-stamp: build-indep
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs -i
+
+	mkdir -p $(SOURCE_PACKAGE)/usr/src
+	chown -R root.src $(SRC_DIR)
+	tar cfj $(SOURCE_PACKAGE)/usr/src/$(SRC_TAR) $(SRC_DIR)
+
+	touch install-indep-stamp
+
+config: src
+	cp -af src/usr.sbin/config config
+	$(MAKE) -C config
+
+build-arch: $(foreach flavor,$(flavours),build-flavor-$(flavor)-stamp)
+build-flavor-%-stamp: src config
+	cp -af src $(FLAVOR_DIR)-$*
+	
+	# Add the abiname and the flavor to the kernel version
+	sed -i -e 's/^RELEASE=".*"/RELEASE="$(version)-$(abiname)-$*"/g' $(FLAVOR_DIR)-$*/sys/conf/newvers.sh
+
+	# Set /lib/modules/${RELEASE} as module dir
+	sed -i -e 's,^KODIR?=.*,KODIR="/lib/modules/$(version)-$(abiname)-$*",g' $(FLAVOR_DIR)-$*/sys/conf/kern.pre.mk
+
+	# Configure the kernel
+	cp debian/arch/$(cpu)/*.config $(FLAVOR_DIR)-$*/sys/$(cpu)/conf/
+	ln -sf $*.config $(FLAVOR_DIR)-$*/sys/$(cpu)/conf/$(configfile)
+	cd $(FLAVOR_DIR)-$*/sys/$(cpu)/conf \
+		&& config $(configfile)
+
+	# Build it
+	$(MAKE) -C $(FLAVOR_DIR)-$*/sys/$(cpu)/compile/$(configfile)/ depend
+	$(MAKE) -C $(FLAVOR_DIR)-$*/sys/$(cpu)/compile/$(configfile)/
+
+	touch build-flavor-$*-stamp
+
+install-common-stamp: src
+	dh_testdir 
+	dh_testroot
+	mkdir -p $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR)
+	cd src \
+		&& find . -type f -name "*.h" -not -regex ".*modules.*" -not -regex ".*sys/$(cpu)/.*" -exec cp --parents {} $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR) \; 
+	find $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR) -type f -exec chmod 644 {} \;
+
+	touch install-common-stamp
+
+install-arch: $(foreach flavor,$(flavours),install-flavor-$(flavor)-stamp)
+install-flavor-%-stamp: install-common-stamp build-flavor-%-stamp
+	dh_testdir
+	dh_testroot
+	dh_clean -k -pkfreebsd-image-$(version)-$(abiname)-$*
+
+	mkdir -p $(IMAGE_PACKAGE)-$*/{boot,lib/modules/$(version)-$(abiname)-$*}
+
+	# make the install target happy
+	install -o root -g root -m 644 \
+		$(FLAVOR_DIR)-$*/sys/$(cpu)/conf/GENERIC.hints \
+		$(IMAGE_PACKAGE)-$*/boot/device.hints
+	install -o root -g root -m 644 \
+		$(FLAVOR_DIR)-$*/sys/boot/forth/loader.conf \
+		$(IMAGE_PACKAGE)-$*/boot/loader.conf
+	mkdir -p $(IMAGE_PACKAGE)-$*/boot/defaults
+	install -o root -g root -m 644 \
+		$(FLAVOR_DIR)-$*/sys/boot/forth/loader.conf \
+		$(IMAGE_PACKAGE)-$*/boot/defaults/loader.conf
+	
+	# now install the kernel
+	$(MAKE) -C $(FLAVOR_DIR)-$*/sys/$(cpu)/compile/$(configfile) DESTDIR=$(IMAGE_PACKAGE)-$* install
+	mv $(IMAGE_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$*/kernel $(IMAGE_PACKAGE)-$*/boot/kfreebsd-$(version)-$(abiname)-$*
+	chmod 644 $(IMAGE_PACKAGE)-$*/boot/kfreebsd-$(version)-$(abiname)-$*
+	gzip -9 $(IMAGE_PACKAGE)-$*/boot/kfreebsd-$(version)-$(abiname)-$*
+
+	# fix broken perms in module dir
+	chmod 644 $(IMAGE_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$*/*
+
+	# remove loader.conf (part of kfreebsd-loader)
+	rm -f $(IMAGE_PACKAGE)-$*/boot/loader.conf
+	rm -rf $(IMAGE_PACKAGE)-$*/boot/defaults
+
+	# create /boot/kernel/ directory
+	mkdir -p $(IMAGE_PACKAGE)-$*/boot/kernel/
+
+	# remove device.hints (built into kernel)
+	rm -f $(IMAGE_PACKAGE)-$*/boot/device.hints
+	
+	# override file
+	mkdir -p $(IMAGE_PACKAGE)-$*/usr/share/lintian/overrides
+	install -p -o root -g root -m 644 \
+		debian/kfreebsd-image.overrides \
+		$(IMAGE_PACKAGE)-$*/usr/share/lintian/overrides/kfreebsd-image-$(version)-$(abiname)-$*
+
+	# move ndis modules to their own package
+	mkdir -p $(NDIS_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$*
+	mv $(IMAGE_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$*/ndis.ko $(IMAGE_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$*/if_ndis.ko \
+		$(NDIS_PACKAGE)-$*/lib/modules/$(version)-$(abiname)-$*/
+
+	# scripts
+	sed -e "s/@RELEASE@/$(version)-$(abiname)-$*/g" debian/kfreebsd-image.postinst.in \
+		> debian/kfreebsd-image-$(version)-$(abiname)-$*.postinst
+	
+	# headers package
+	mkdir -p $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu)
+	cd $(FLAVOR_DIR)-$*/sys/$(cpu) \
+		&& find . -type f -name "*.h" -not -regex ".*modules.*" -exec cp --parents {} $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu) \; \
+		&& cp -d --parents compile/$(configfile)/machine $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu) \
+		&& cp -d --parents conf/$(configfile) $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu) 
+	find $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$(cpu) -type f -exec chmod 644 {} \;
+	for dir in `ls $(HEADERS_PACKAGE)/usr/src/$(HEADERS_DIR)/sys` ; do \
+		ln -s ../../$(HEADERS_DIR)/sys/$$dir $(HEADERS_PACKAGE)-$*/usr/src/$(HEADERS_DIR)-$*/sys/$$dir ; \
+	done
+
+	touch install-flavor-$*-stamp
+
+
+# Build architecture-independent files here.
+binary-indep: build-indep install-indep
+	dh_testdir
+	dh_testroot
+	dh_installdocs -i
+	dh_installchangelogs -i
+	dh_link -i
+	dh_strip -i
+	dh_compress -i
+	dh_fixperms -i
+	dh_makeshlibs -i
+	dh_installdeb -i
+	dh_shlibdeps -i
+	dh_gencontrol -i
+	dh_md5sums -i
+	dh_builddeb -i
+
+# Build architecture-dependent files here.
+ifeq ($(os), kfreebsd)
+binary-arch: build-arch install-arch
+	dh_testdir
+	dh_testroot
+	dh_installdocs -s
+	dh_installchangelogs -s
+	dh_link -s
+	dh_strip -s -X/boot -X/lib/modules
+	dh_compress -s
+	dh_fixperms -s
+	dh_makeshlibs -s
+	dh_installdeb -s
+	dh_shlibdeps -s -X/boot -X/lib/modules
+	dh_gencontrol -s
+	dh_md5sums -s
+	dh_builddeb -s
+else
+binary-arch:
+	# We have nothing to do
+endif	
+
+binary: binary-indep binary-arch
+
+.PHONY: clean build build-indep
+.PHONY: binary-indep binary-arch binary-indep binary-arch binary
+
--- kfreebsd-7-7.0.orig/debian/patches/030_abi_cld.diff
+++ kfreebsd-7-7.0/debian/patches/030_abi_cld.diff
@@ -0,0 +1,154 @@
+diff -Nurd sys/amd64/amd64/machdep.c sys/amd64/amd64/machdep.c
+--- sys/amd64/amd64/machdep.c	2008-01-19 19:15:01.000000000 +0100
++++ sys/amd64/amd64/machdep.c	2008-03-06 01:29:07.000000000 +0100
+@@ -357,7 +357,7 @@
+ 
+ 	regs->tf_rsp = (long)sfp;
+ 	regs->tf_rip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+-	regs->tf_rflags &= ~PSL_T;
++	regs->tf_rflags &= ~(PSL_T | PSL_D);
+ 	regs->tf_cs = _ucodesel;
+ 	PROC_LOCK(p);
+ 	mtx_lock(&psp->ps_mtx);
+diff -Nurd sys/amd64/ia32/ia32_signal.c sys/amd64/ia32/ia32_signal.c
+--- sys/amd64/ia32/ia32_signal.c	2006-10-05 03:56:10.000000000 +0200
++++ sys/amd64/ia32/ia32_signal.c	2008-03-06 01:29:07.000000000 +0100
+@@ -391,7 +391,7 @@
+ 
+ 	regs->tf_rsp = (uintptr_t)sfp;
+ 	regs->tf_rip = FREEBSD32_PS_STRINGS - sz_freebsd4_ia32_sigcode;
+-	regs->tf_rflags &= ~PSL_T;
++	regs->tf_rflags &= ~(PSL_T | PSL_D);
+ 	regs->tf_cs = _ucode32sel;
+ 	regs->tf_ss = _udatasel;
+ 	load_ds(_udatasel);
+@@ -511,7 +511,7 @@
+ 
+ 	regs->tf_rsp = (uintptr_t)sfp;
+ 	regs->tf_rip = FREEBSD32_PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+-	regs->tf_rflags &= ~PSL_T;
++	regs->tf_rflags &= ~(PSL_T | PSL_D);
+ 	regs->tf_cs = _ucode32sel;
+ 	regs->tf_ss = _udatasel;
+ 	load_ds(_udatasel);
+diff -Nurd sys/amd64/linux32/linux32_sysvec.c sys/amd64/linux32/linux32_sysvec.c
+--- sys/amd64/linux32/linux32_sysvec.c	2007-09-20 15:46:26.000000000 +0200
++++ sys/amd64/linux32/linux32_sysvec.c	2008-03-06 01:29:07.000000000 +0100
+@@ -402,7 +402,7 @@
+ 	regs->tf_rsp = PTROUT(fp);
+ 	regs->tf_rip = LINUX32_PS_STRINGS - *(p->p_sysent->sv_szsigcode) +
+ 	    linux_sznonrtsigcode;
+-	regs->tf_rflags &= ~PSL_T;
++	regs->tf_rflags &= ~(PSL_T | PSL_D);
+ 	regs->tf_cs = _ucode32sel;
+ 	regs->tf_ss = _udatasel;
+ 	load_ds(_udatasel);
+@@ -524,7 +524,7 @@
+ 	 */
+ 	regs->tf_rsp = PTROUT(fp);
+ 	regs->tf_rip = LINUX32_PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+-	regs->tf_rflags &= ~PSL_T;
++	regs->tf_rflags &= ~(PSL_T | PSL_D);
+ 	regs->tf_cs = _ucode32sel;
+ 	regs->tf_ss = _udatasel;
+ 	load_ds(_udatasel);
+diff -Nurd sys/i386/i386/machdep.c sys/i386/i386/machdep.c
+--- sys/i386/i386/machdep.c	2008-01-19 19:15:03.000000000 +0100
++++ sys/i386/i386/machdep.c	2008-03-06 01:29:07.000000000 +0100
+@@ -416,7 +416,7 @@
+ 
+ 	regs->tf_esp = (int)fp;
+ 	regs->tf_eip = PS_STRINGS - szosigcode;
+-	regs->tf_eflags &= ~PSL_T;
++	regs->tf_eflags &= ~(PSL_T | PSL_D);
+ 	regs->tf_cs = _ucodesel;
+ 	regs->tf_ds = _udatasel;
+ 	regs->tf_es = _udatasel;
+@@ -537,7 +537,7 @@
+ 
+ 	regs->tf_esp = (int)sfp;
+ 	regs->tf_eip = PS_STRINGS - szfreebsd4_sigcode;
+-	regs->tf_eflags &= ~PSL_T;
++	regs->tf_eflags &= ~(PSL_T | PSL_D);
+ 	regs->tf_cs = _ucodesel;
+ 	regs->tf_ds = _udatasel;
+ 	regs->tf_es = _udatasel;
+@@ -673,7 +673,7 @@
+ 
+ 	regs->tf_esp = (int)sfp;
+ 	regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+-	regs->tf_eflags &= ~PSL_T;
++	regs->tf_eflags &= ~(PSL_T | PSL_D);
+ 	regs->tf_cs = _ucodesel;
+ 	regs->tf_ds = _udatasel;
+ 	regs->tf_es = _udatasel;
+diff -Nurd sys/i386/linux/linux_sysvec.c sys/i386/linux/linux_sysvec.c
+--- sys/i386/linux/linux_sysvec.c	2007-09-20 15:46:26.000000000 +0200
++++ sys/i386/linux/linux_sysvec.c	2008-03-06 01:29:07.000000000 +0100
+@@ -389,7 +389,7 @@
+ 	regs->tf_esp = (int)fp;
+ 	regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode) +
+ 	    linux_sznonrtsigcode;
+-	regs->tf_eflags &= ~(PSL_T | PSL_VM);
++	regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D);
+ 	regs->tf_cs = _ucodesel;
+ 	regs->tf_ds = _udatasel;
+ 	regs->tf_es = _udatasel;
+@@ -508,7 +508,7 @@
+ 	 */
+ 	regs->tf_esp = (int)fp;
+ 	regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+-	regs->tf_eflags &= ~(PSL_T | PSL_VM);
++	regs->tf_eflags &= ~(PSL_T | PSL_VM | PSL_D);
+ 	regs->tf_cs = _ucodesel;
+ 	regs->tf_ds = _udatasel;
+ 	regs->tf_es = _udatasel;
+diff -Nurd sys/i386/svr4/svr4_machdep.c sys/i386/svr4/svr4_machdep.c
+--- sys/i386/svr4/svr4_machdep.c	2005-10-19 16:59:54.000000000 +0200
++++ sys/i386/svr4/svr4_machdep.c	2008-03-06 01:29:07.000000000 +0100
+@@ -497,13 +497,13 @@
+ 	     svr4_szsigcode);
+ 	tf->tf_cs = GSEL(GUSERLDT_SEL, SEL_UPL);
+ 
+-	tf->tf_eflags &= ~(PSL_T|PSL_VM|PSL_AC);
++	tf->tf_eflags &= ~(PSL_T|PSL_VM|PSL_AC|PSL_D);
+ 	tf->tf_esp = (int)fp;
+ 	tf->tf_ss = GSEL(GUSERLDT_SEL, SEL_UPL);
+ #else
+ 	tf->tf_esp = (int)fp;
+ 	tf->tf_eip = (int)(((char *)PS_STRINGS) - *(p->p_sysent->sv_szsigcode));
+-	tf->tf_eflags &= ~PSL_T;
++	tf->tf_eflags &= ~(PSL_T | PSL_D);
+ 	tf->tf_cs = _ucodesel;
+ 	tf->tf_ds = _udatasel;
+ 	tf->tf_es = _udatasel;
+diff -Nurd sys/pc98/pc98/machdep.c sys/pc98/pc98/machdep.c
+--- sys/pc98/pc98/machdep.c	2008-01-19 19:15:05.000000000 +0100
++++ sys/pc98/pc98/machdep.c	2008-03-06 01:29:07.000000000 +0100
+@@ -388,7 +388,7 @@
+ 
+ 	regs->tf_esp = (int)fp;
+ 	regs->tf_eip = PS_STRINGS - szosigcode;
+-	regs->tf_eflags &= ~PSL_T;
++	regs->tf_eflags &= ~(PSL_T | PSL_D);
+ 	regs->tf_cs = _ucodesel;
+ 	regs->tf_ds = _udatasel;
+ 	regs->tf_es = _udatasel;
+@@ -509,7 +509,7 @@
+ 
+ 	regs->tf_esp = (int)sfp;
+ 	regs->tf_eip = PS_STRINGS - szfreebsd4_sigcode;
+-	regs->tf_eflags &= ~PSL_T;
++	regs->tf_eflags &= ~(PSL_T | PSL_D);
+ 	regs->tf_cs = _ucodesel;
+ 	regs->tf_ds = _udatasel;
+ 	regs->tf_es = _udatasel;
+@@ -645,7 +645,7 @@
+ 
+ 	regs->tf_esp = (int)sfp;
+ 	regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+-	regs->tf_eflags &= ~PSL_T;
++	regs->tf_eflags &= ~(PSL_T | PSL_D);
+ 	regs->tf_cs = _ucodesel;
+ 	regs->tf_ds = _udatasel;
+ 	regs->tf_es = _udatasel;
--- kfreebsd-7-7.0.orig/debian/patches/000_amd64.diff
+++ kfreebsd-7-7.0/debian/patches/000_amd64.diff
@@ -0,0 +1,25 @@
+Index: src/sys/amd64/amd64/exception.S
+===================================================================
+RCS file: /home/ncvs/src/sys/amd64/amd64/exception.S,v
+retrieving revision 1.132
+retrieving revision 1.133
+diff -u -d -r1.132 -r1.133
+--- src/sys/amd64/amd64/exception.S	24 May 2008 06:32:26 -0000	1.132
++++ src/sys/amd64/amd64/exception.S	18 Aug 2008 08:47:27 -0000	1.133
+@@ -636,13 +636,10 @@
+ 	.globl	doreti_iret_fault
+ doreti_iret_fault:
+ 	subq	$TF_RIP,%rsp		/* space including tf_err, tf_trapno */
+-	testb	$SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */
+-	jz	1f			/* already running with kernel GS.base */
+-	swapgs
+-1:	testl	$PSL_I,TF_RFLAGS(%rsp)
+-	jz	2f
++	testl	$PSL_I,TF_RFLAGS(%rsp)
++	jz	1f
+ 	sti
+-2:	movq	%rdi,TF_RDI(%rsp)
++1:	movq	%rdi,TF_RDI(%rsp)
+ 	movq	%rsi,TF_RSI(%rsp)
+ 	movq	%rdx,TF_RDX(%rsp)
+ 	movq	%rcx,TF_RCX(%rsp)
--- kfreebsd-7-7.0.orig/debian/patches/908_linprocfs_is_not_proc.diff
+++ kfreebsd-7-7.0/debian/patches/908_linprocfs_is_not_proc.diff
@@ -0,0 +1,15 @@
+Index: sys/compat/linprocfs/linprocfs.c
+===================================================================
+--- sys/compat/linprocfs/linprocfs.c.orig
++++ sys/compat/linprocfs/linprocfs.c
+@@ -336,10 +336,6 @@
+ 
+ 		/* determine fs type */
+ 		fstype = mp->mnt_stat.f_fstypename;
+-		if (strcmp(fstype, pn->pn_info->pi_name) == 0)
+-			mntfrom = fstype = "proc";
+-		else if (strcmp(fstype, "procfs") == 0)
+-			continue;
+ 
+ 		if (strcmp(fstype, "linsysfs") == 0) {
+ 			sbuf_printf(sb, "/sys %s sysfs %s", mntto,
--- kfreebsd-7-7.0.orig/debian/patches/904_dev_full.diff
+++ kfreebsd-7-7.0/debian/patches/904_dev_full.diff
@@ -0,0 +1,71 @@
+
+Status: Rejected in upstream (kern/68961)
+
+Index: sys/dev/null/null.c
+===================================================================
+--- sys/dev/null/null.c.orig
++++ sys/dev/null/null.c
+@@ -43,13 +43,16 @@
+ 
+ /* For use with destroy_dev(9). */
+ static struct cdev *null_dev;
++static struct cdev *full_dev;
+ static struct cdev *zero_dev;
+ 
+ static d_write_t null_write;
++static d_write_t full_write;
+ static d_ioctl_t null_ioctl;
+ static d_read_t zero_read;
+ 
+ #define NULL_MINOR	2
++#define FULL_MINOR	3
+ #define ZERO_MINOR	12
+ 
+ static struct cdevsw null_cdevsw = {
+@@ -60,6 +63,14 @@
+ 	.d_name =	"null",
+ };
+ 
++static struct cdevsw full_cdevsw = {
++	.d_version =	D_VERSION,
++	.d_read =	(d_read_t *)nullop,
++	.d_write =	full_write,
++	.d_ioctl =	null_ioctl,
++	.d_name =	"full",
++};
++
+ static struct cdevsw zero_cdevsw = {
+ 	.d_version =	D_VERSION,
+ 	.d_read =	zero_read,
+@@ -81,6 +92,15 @@
+ 
+ /* ARGSUSED */
+ static int
++full_write(struct cdev *dev __unused, struct uio *uio, int flags __unused)
++{
++	uio->uio_resid = 0;
++
++	return (ENOSPC);
++}
++
++/* ARGSUSED */
++static int
+ null_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data __unused,
+     int flags __unused, struct thread *td)
+ {
+@@ -117,12 +137,15 @@
+ 		zbuf = (void *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK | M_ZERO);
+ 		null_dev = make_dev(&null_cdevsw, NULL_MINOR, UID_ROOT,
+ 			GID_WHEEL, 0666, "null");
++		full_dev = make_dev(&full_cdevsw, FULL_MINOR, UID_ROOT,
++			GID_WHEEL, 0666, "full");
+ 		zero_dev = make_dev(&zero_cdevsw, ZERO_MINOR, UID_ROOT,
+ 			GID_WHEEL, 0666, "zero");
+ 		break;
+ 
+ 	case MOD_UNLOAD:
+ 		destroy_dev(null_dev);
++		destroy_dev(full_dev);
+ 		destroy_dev(zero_dev);
+ 		free(zbuf, M_TEMP);
+ 		break;
--- kfreebsd-7-7.0.orig/debian/patches/007_clone_signals.diff
+++ kfreebsd-7-7.0/debian/patches/007_clone_signals.diff
@@ -0,0 +1,32 @@
+Index: sys/kern/kern_fork.c
+===================================================================
+--- sys/kern/kern_fork.c.orig
++++ sys/kern/kern_fork.c
+@@ -485,7 +485,11 @@
+ 		p2->p_sigacts = newsigacts;
+ 	}
+ 	if (flags & RFLINUXTHPN) 
+-	        p2->p_sigparent = SIGUSR1;
++	{
++		int sig;
++		sig = RFTHPNSIGNUM(flags);
++	        p2->p_sigparent = sig ? sig : SIGUSR1;
++	}
+ 	else
+ 	        p2->p_sigparent = SIGCHLD;
+ 
+Index: sys/sys/unistd.h
+===================================================================
+--- sys/sys/unistd.h.orig
++++ sys/sys/unistd.h
+@@ -181,6 +181,10 @@
+ #define	RFHIGHPID	(1<<18)	/* use a pid higher then 10 (idleproc) */
+ #define	RFPPWAIT	(1<<31)	/* parent sleeps until child exits (vfork) */
+ #define	RFKERNELONLY	(RFSTOPPED | RFHIGHPID | RFPPWAIT)
++#define RFTHPNSHIFT	24	/* reserve bits 24-30 */
++#define RFTHPNMASK	0x7F    /* for compatibility with linuxthreads/clone()   */
++				/* allow to specify  "clone exit parent notification" signal */
++#define RFTHPNSIGNUM(flags)	(((flags) >> RFTHPNSHIFT) & RFTHPNMASK)
+ 
+ #endif /* __BSD_VISIBLE */
+ 
--- kfreebsd-7-7.0.orig/debian/patches/000_nd6.patch
+++ kfreebsd-7-7.0/debian/patches/000_nd6.patch
@@ -0,0 +1,87 @@
+Index: src/sys/netinet6/in6.h
+===================================================================
+RCS file: /home/ncvs/src/sys/netinet6/in6.h,v
+retrieving revision 1.51.2.1
+diff -u -p -r1.51.2.1 in6.h
+--- src/sys/netinet6/in6.h	1 Sep 2008 19:23:04 -0000	1.51.2.1
++++ src/sys/netinet6/in6.h	28 Sep 2008 21:07:34 -0000
+@@ -599,7 +599,9 @@ struct ip6_mtuinfo {
+ /* New entries should be added here from current IPV6CTL_MAXID value. */
+ /* to define items, should talk with KAME guys first, for *BSD compatibility */
+ #define IPV6CTL_STEALTH		45
+-#define IPV6CTL_MAXID		46
++
++#define	ICMPV6CTL_ND6_ONLINKNSRFC4861	47
++#define IPV6CTL_MAXID		48
+ #endif /* __BSD_VISIBLE */
+ 
+ /*
+Index: src/sys/netinet6/in6_proto.c
+===================================================================
+RCS file: /home/ncvs/src/sys/netinet6/in6_proto.c,v
+retrieving revision 1.46.2.2
+diff -u -p -r1.46.2.2 in6_proto.c
+--- src/sys/netinet6/in6_proto.c	1 Sep 2008 19:23:04 -0000	1.46.2.2
++++ src/sys/netinet6/in6_proto.c	28 Sep 2008 21:14:27 -0000
+@@ -394,6 +394,7 @@ time_t	ip6_log_time = (time_t)0L;
+ #ifdef IPSTEALTH
+ int	ip6stealth = 0;
+ #endif
++int	nd6_onlink_ns_rfc4861 = 0; /* allow 'on-link' nd6 NS (as in RFC 4861) */
+ 
+ /* icmp6 */
+ /*
+@@ -567,3 +568,6 @@ SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_N
+ 	nd6_maxnudhint, CTLFLAG_RW,	&nd6_maxnudhint, 0, "");
+ SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DEBUG,
+ 	nd6_debug, CTLFLAG_RW,	&nd6_debug,		0, "");
++SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_ONLINKNSRFC4861,
++	nd6_onlink_ns_rfc4861, CTLFLAG_RW, &nd6_onlink_ns_rfc4861, 0,
++	"Accept 'on-link' nd6 NS in compliance with RFC 4861.");
+Index: src/sys/netinet6/nd6.h
+===================================================================
+RCS file: /home/ncvs/src/sys/netinet6/nd6.h,v
+retrieving revision 1.21.2.1
+diff -u -p -r1.21.2.1 nd6.h
+--- src/sys/netinet6/nd6.h	1 Sep 2008 19:23:04 -0000	1.21.2.1
++++ src/sys/netinet6/nd6.h	28 Sep 2008 21:18:01 -0000
+@@ -339,6 +339,7 @@ extern struct llinfo_nd6 llinfo_nd6;
+ extern struct nd_drhead nd_defrouter;
+ extern struct nd_prhead nd_prefix;
+ extern int nd6_debug;
++extern int nd6_onlink_ns_rfc4861;
+ 
+ #define nd6log(x)	do { if (nd6_debug) log x; } while (/*CONSTCOND*/ 0)
+ 
+Index: src/sys/netinet6/nd6_nbr.c
+===================================================================
+RCS file: /home/ncvs/src/sys/netinet6/nd6_nbr.c,v
+retrieving revision 1.47.2.2
+diff -u -p -r1.47.2.2 nd6_nbr.c
+--- src/sys/netinet6/nd6_nbr.c	1 Sep 2008 19:23:04 -0000	1.47.2.2
++++ src/sys/netinet6/nd6_nbr.c	28 Sep 2008 21:14:44 -0000
+@@ -145,6 +145,24 @@ nd6_ns_input(struct mbuf *m, int off, in
+ 			    "(wrong ip6 dst)\n"));
+ 			goto bad;
+ 		}
++	} else if (!nd6_onlink_ns_rfc4861) {
++		struct sockaddr_in6 src_sa6;
++
++		/*
++		 * According to recent IETF discussions, it is not a good idea
++		 * to accept a NS from an address which would not be deemed
++		 * to be a neighbor otherwise.  This point is expected to be
++		 * clarified in future revisions of the specification.
++		 */
++		bzero(&src_sa6, sizeof(src_sa6));
++		src_sa6.sin6_family = AF_INET6;
++		src_sa6.sin6_len = sizeof(src_sa6);
++		src_sa6.sin6_addr = saddr6;
++		if (!nd6_is_addr_neighbor(&src_sa6, ifp)) {
++			nd6log((LOG_INFO, "nd6_ns_input: "
++				"NS packet from non-neighbor\n"));
++			goto bad;
++		}
+ 	}
+ 
+ 	if (IN6_IS_ADDR_MULTICAST(&taddr6)) {
--- kfreebsd-7-7.0.orig/debian/patches/101_subsecond_timestamp.diff
+++ kfreebsd-7-7.0/debian/patches/101_subsecond_timestamp.diff
@@ -0,0 +1,36 @@
+There is inconsistence in subsecond timestamp resolution handling. 
+See #489894, try to execute
+
+  touch k0;  echo > k1; touch k2; echo > k3; touch k4;  echo > k5
+  ls --full-time k? | cut -c25-
+
+The results are rather surprising:
+
+ 2008-07-10 00:55:01.020578000 +0200 k0
+ 2008-07-10 00:55:01.000000000 +0200 k1
+ 2008-07-10 00:55:01.022910000 +0200 k2
+ 2008-07-10 00:55:01.000000000 +0200 k3
+ 2008-07-10 00:55:01.023841000 +0200 k4
+ 2008-07-10 00:55:01.000000000 +0200 k5
+
+The problem seems to be in cooperating between vfs.timestamp_precision 
+and utimes/futimes syscalls. Passed NULL to them means "now",
+lets the "now" have precision according to vfs.timestamp_precision.
+
+Index: sys/kern/vfs_syscalls.c
+===================================================================
+--- sys/kern/vfs_syscalls.c.orig
++++ sys/kern/vfs_syscalls.c
+@@ -2819,8 +2819,7 @@
+ 	int error;
+ 
+ 	if (usrtvp == NULL) {
+-		microtime(&tv[0]);
+-		TIMEVAL_TO_TIMESPEC(&tv[0], &tsp[0]);
++		vfs_timestamp(&tsp[0]);
+ 		tsp[1] = tsp[0];
+ 	} else {
+ 		if (tvpseg == UIO_SYSSPACE) {
+
+
+
--- kfreebsd-7-7.0.orig/debian/patches/010_ET_DYN.diff
+++ kfreebsd-7-7.0/debian/patches/010_ET_DYN.diff
@@ -0,0 +1,85 @@
+
+
+Index: sys/kern/imgact_elf.c
+===================================================================
+--- sys/kern/imgact_elf.c.orig
++++ sys/kern/imgact_elf.c
+@@ -619,6 +619,8 @@
+ 	const char *note_name;
+ 	struct thread *td = curthread;
+ 	struct sysentvec *sv;
++	u_long rbase = 0;
++
+ 
+ 	/*
+ 	 * Do we have a valid ELF header ?
+@@ -660,11 +662,27 @@
+ 		    hdr->e_ident[EI_OSABI]);
+ 		return (ENOEXEC);
+ 	}
++#if 0
+ 	if (hdr->e_type == ET_DYN &&
+ 	    (brand_info->flags & BI_CAN_EXEC_DYN) == 0)
+ 		return (ENOEXEC);
++#endif
++	if (hdr->e_type == ET_DYN) {
++ 	    for (i = 0; i < hdr->e_phnum; i++) {
++		if (phdr[i].p_type == PT_LOAD) {
++			if (phdr[i].p_vaddr == 0) {
++				/* we have to load at base addr 0,
++				 * so relocate somewhere (at 512 MB)
++				 */
++				rbase = 512 * 1024 * 1024;
++				break;
++			}
++		}
++	    }
++	}
++
+ 	sv = brand_info->sysvec;
+-	if (interp != NULL && brand_info->interp_newpath != NULL)
++	if (interp != NULL && brand_info->interp_newpath != NULL && !strcmp(interp, "/libexec/ld-elf.so.1"))
+ 		interp = brand_info->interp_newpath;
+ 
+ 	/*
+@@ -706,7 +724,7 @@
+ 
+ 			if ((error = __elfN(load_section)(vmspace,
+ 			    imgp->object, phdr[i].p_offset,
+-			    (caddr_t)(uintptr_t)phdr[i].p_vaddr,
++			    (caddr_t)(uintptr_t)phdr[i].p_vaddr + rbase,
+ 			    phdr[i].p_memsz, phdr[i].p_filesz, prot,
+ 			    sv->sv_pagesize)) != 0)
+ 				return (error);
+@@ -720,11 +738,12 @@
+ 			if (phdr[i].p_offset == 0 &&
+ 			    hdr->e_phoff + hdr->e_phnum * hdr->e_phentsize
+ 				<= phdr[i].p_filesz)
+-				proghdr = phdr[i].p_vaddr + hdr->e_phoff;
++				proghdr = phdr[i].p_vaddr + rbase + hdr->e_phoff;
+ 
+ 			seg_addr = trunc_page(phdr[i].p_vaddr);
+ 			seg_size = round_page(phdr[i].p_memsz +
+ 			    phdr[i].p_vaddr - seg_addr);
++			seg_addr += rbase;
+ 
+ 			/*
+ 			 * Is this .text or .data?  We can't use
+@@ -746,7 +765,7 @@
+ 			    phdr[i].p_memsz)) {
+ 				text_size = seg_size;
+ 				text_addr = seg_addr;
+-				entry = (u_long)hdr->e_entry;
++				entry = (u_long)hdr->e_entry + rbase;
+ 			} else {
+ 				data_size = seg_size;
+ 				data_addr = seg_addr;
+@@ -754,7 +773,7 @@
+ 			total_size += seg_size;
+ 			break;
+ 		case PT_PHDR: 	/* Program header table info */
+-			proghdr = phdr[i].p_vaddr;
++			proghdr = phdr[i].p_vaddr + rbase;
+ 			break;
+ 		case PT_NOTE:
+ 			pnote = &phdr[i];
--- kfreebsd-7-7.0.orig/debian/patches/020_linker.diff
+++ kfreebsd-7-7.0/debian/patches/020_linker.diff
@@ -0,0 +1,35 @@
+
+  current ld provides magic symbols with names like __start_* and __stop_*
+  only if they are referenced, FreeBSD kernel needs them,
+  for details see http://sourceware.org/bugzilla/show_bug.cgi?id=5391
+
+
+Index: sys/conf/kern.post.mk
+===================================================================
+--- sys/conf/kern.post.mk.orig
++++ sys/conf/kern.post.mk
+@@ -95,7 +95,9 @@
+ ${FULLKERNEL}: ${SYSTEM_DEP} vers.o
+ 	@rm -f ${.TARGET}
+ 	@echo linking ${.TARGET}
+-	${SYSTEM_LD}
++	${SYSTEM_LD} -o ${.TARGET}.tmp
++	gen-ld-u-options ${.TARGET}.tmp > ${.TARGET}.lopt
++	${SYSTEM_LD} "@${.TARGET}.lopt"
+ .if !defined(DEBUG)
+ 	${OBJCOPY} --strip-debug ${.TARGET}
+ .endif
+Index: sys/conf/kmod.mk
+===================================================================
+--- sys/conf/kmod.mk.orig
++++ sys/conf/kmod.mk
+@@ -177,7 +177,8 @@
+ 
+ .if ${MACHINE_ARCH} != amd64
+ ${FULLPROG}: ${KMOD}.kld
+-	${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld
++	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
--- kfreebsd-7-7.0.orig/debian/patches/008_config.diff
+++ kfreebsd-7-7.0/debian/patches/008_config.diff
@@ -0,0 +1,60 @@
+
+Author: rmh
+Status: gotta uncomment WARNS (see #351366), and find a portable way to add
+  "-lbsd".  after this it can be sent upstream.
+
+Index: usr.sbin/config/Makefile
+===================================================================
+--- usr.sbin/config/Makefile.orig
++++ usr.sbin/config/Makefile
+@@ -9,11 +9,11 @@
+ kernconf.c: kernconf.tmpl
+ 	file2c 'char kernconfstr[] = {' ',0};' < ${.CURDIR}/kernconf.tmpl > kernconf.c
+ 
+-WARNS?=	6
+-CFLAGS+= -I. -I${.CURDIR}
++#WARNS?=	6
++CFLAGS+= -I. -I${.CURDIR} -D_GNU_SOURCE
+ 
+ DPADD=	${LIBL} ${LIBSBUF}
+-LDADD=	-ll -lsbuf
++LDADD=	-ll -lbsd
+ 
+ CLEANFILES+=	kernconf.c
+ 
+Index: usr.sbin/config/main.c
+===================================================================
+--- usr.sbin/config/main.c.orig
++++ usr.sbin/config/main.c
+@@ -41,12 +41,18 @@
+   "$FreeBSD: src/usr.sbin/config/main.c,v 1.76 2007/05/17 04:53:52 imp Exp $";
+ #endif /* not lint */
+ 
++#include <stdarg.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/sbuf.h>
+ #include <sys/file.h>
+ #include <sys/mman.h>
+-#include <sys/param.h>
++#include <sys/param.h> /* BSD */
++
++#ifndef BSD
++#include <bsd/string.h> /* strlcpy, strlcat */
++#include "sbuf.c"
++#endif
+ 
+ #include <assert.h>
+ #include <ctype.h>
+@@ -588,7 +594,11 @@
+ 	if ((dirp = opendir(p)) == NULL)
+ 		err(EX_OSERR, "opendir %s", p);
+ 	while ((dp = readdir(dirp)) != NULL) {
++#ifdef _DIRENT_HAVE_D_NAMLEN
+ 		i = dp->d_namlen - 2;
++#else
++		i = strlen (dp->d_name) - 2;
++#endif
+ 		/* Skip non-headers */
+ 		if (dp->d_name[i] != '.' || dp->d_name[i + 1] != 'h')
+ 			continue;
--- kfreebsd-7-7.0.orig/debian/patches/000_nmount.diff
+++ kfreebsd-7-7.0/debian/patches/000_nmount.diff
@@ -0,0 +1,17 @@
+Index: src/sys/kern/vfs_mount.c
+===================================================================
+RCS file: /usr/ncvs/src/sys/kern/vfs_mount.c,v
+retrieving revision 1.265.2.3
+diff -u -r1.265.2.3 vfs_mount.c
+--- src/sys/kern/vfs_mount.c	6 Apr 2008 10:02:20 -0000	1.265.2.3
++++ src/sys/kern/vfs_mount.c	17 Jul 2008 15:39:37 -0000
+@@ -1830,7 +1830,8 @@
+ 		}
+ 		if (*t != NULL)
+ 			continue;
+-		sprintf(errmsg, "mount option <%s> is unknown", p);
++		snprintf(errmsg, sizeof(errmsg),
++		    "mount option <%s> is unknown", p);
+ 		printf("%s\n", errmsg);
+ 		ret = EINVAL;
+ 	}
--- kfreebsd-7-7.0.orig/debian/patches/912_binutils.diff
+++ kfreebsd-7-7.0/debian/patches/912_binutils.diff
@@ -0,0 +1,29 @@
+Index: sys/conf/ldscript.amd64
+===================================================================
+--- sys/conf/ldscript.amd64.orig
++++ sys/conf/ldscript.amd64
+@@ -1,12 +1,12 @@
+ /* $FreeBSD: src/sys/conf/ldscript.amd64,v 1.9 2004/05/29 01:09:00 tjr Exp $ */
+-OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
++OUTPUT_FORMAT("elf64-x86-64-freebsd", "elf64-x86-64-freebsd", "elf64-x86-64-freebsd")
+ OUTPUT_ARCH(i386:x86-64)
+ ENTRY(btext)
+ SEARCH_DIR("/usr/lib");
+ SECTIONS
+ {
+   /* Read-only sections, merged into text segment: */
+-  . = kernbase + 0x00100000 + SIZEOF_HEADERS;
++  . = kernbase + CONSTANT (MAXPAGESIZE) + SIZEOF_HEADERS;
+   .interp         : { *(.interp) }
+   .hash           : { *(.hash) }
+   .dynsym         : { *(.dynsym) }
+@@ -61,7 +61,8 @@
+   .eh_frame_hdr : { *(.eh_frame_hdr) }
+   /* Adjust the address for the data segment.  We want to adjust up to
+      the same address within the page on the next page up.  */
+-  . = DATA_SEGMENT_ALIGN(0x100000, 0x1000);
++  . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1));
++  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
+   /* Ensure the __preinit_array_start label is properly aligned.  We
+      could instead move the label definition inside the section, but
+      the linker would then create the section even if it turns out to
--- kfreebsd-7-7.0.orig/debian/patches/003_glibc_dev_aicasm.diff
+++ kfreebsd-7-7.0/debian/patches/003_glibc_dev_aicasm.diff
@@ -0,0 +1,144 @@
+Index: sys/dev/aic7xxx/aicasm/Makefile
+===================================================================
+--- sys/dev/aic7xxx/aicasm/Makefile.orig
++++ sys/dev/aic7xxx/aicasm/Makefile
+@@ -14,7 +14,7 @@
+ SRCS=	${GENHDRS} ${CSRCS} ${YSRCS} ${LSRCS}
+ CLEANFILES+= ${GENHDRS} ${YSRCS:R:C/(.*)/\1.output/g}
+ DPADD=	${LIBL}
+-LDADD=	-ll
++LDADD=	-ll -ldb
+ 
+ # Correct path for kernel builds
+ # Don't rely on the kernel's .depend file
+@@ -23,13 +23,6 @@
+ DEPENDFILE=	.depend_aicasm
+ .endif
+ 
+-.if ${CC} == "icc"
+-CFLAGS+=	-restrict
+-NOSTDINC=	-X
+-.else
+-NOSTDINC=	-nostdinc
+-.endif
+-CFLAGS+= ${NOSTDINC} -I/usr/include -I.
+ .ifdef MAKESRCPATH
+ CFLAGS+= -I${MAKESRCPATH}
+ .endif
+Index: sys/dev/aic7xxx/aicasm/aicasm.h
+===================================================================
+--- sys/dev/aic7xxx/aicasm/aicasm.h.orig
++++ sys/dev/aic7xxx/aicasm/aicasm.h
+@@ -42,8 +42,9 @@
+  * $FreeBSD: src/sys/dev/aic7xxx/aicasm/aicasm.h,v 1.17 2005/01/06 01:42:27 imp Exp $
+  */
+ 
+-#ifdef __linux__
+-#include "../queue.h"
++#include <sys/param.h>		/* __GLIBC__ */
++#ifdef __GLIBC__
++#include <bsd/queue.h>
+ #else
+ #include <sys/queue.h>
+ #endif
+Index: sys/dev/aic7xxx/aicasm/aicasm_gram.y
+===================================================================
+--- sys/dev/aic7xxx/aicasm/aicasm_gram.y.orig
++++ sys/dev/aic7xxx/aicasm/aicasm_gram.y
+@@ -52,8 +52,9 @@
+ #include <string.h>
+ #include <sysexits.h>
+ 
+-#ifdef __linux__
+-#include "../queue.h"
++#include <sys/param.h>		/* __GLIBC__ */
++#ifdef __GLIBC__
++#include <bsd/queue.h>
+ #else
+ #include <sys/queue.h>
+ #endif
+Index: sys/dev/aic7xxx/aicasm/aicasm_macro_gram.y
+===================================================================
+--- sys/dev/aic7xxx/aicasm/aicasm_macro_gram.y.orig
++++ sys/dev/aic7xxx/aicasm/aicasm_macro_gram.y
+@@ -52,8 +52,9 @@
+ #include <string.h>
+ #include <sysexits.h>
+ 
+-#ifdef __linux__
+-#include "../queue.h"
++#include <sys/param.h>		/* __GLIBC__ */
++#ifdef __GLIBC__
++#include <bsd/queue.h>
+ #else
+ #include <sys/queue.h>
+ #endif
+Index: sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l
+===================================================================
+--- sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l.orig
++++ sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l
+@@ -51,8 +51,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sysexits.h>
+-#ifdef __linux__
+-#include "../queue.h"
++
++#include <sys/param.h>		/* __GLIBC__ */
++#ifdef __GLIBC__
++#include <bsd/queue.h>
+ #else
+ #include <sys/queue.h>
+ #endif
+Index: sys/dev/aic7xxx/aicasm/aicasm_scan.l
+===================================================================
+--- sys/dev/aic7xxx/aicasm/aicasm_scan.l.orig
++++ sys/dev/aic7xxx/aicasm/aicasm_scan.l
+@@ -51,8 +51,10 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <sysexits.h>
+-#ifdef __linux__
+-#include "../queue.h"
++
++#include <sys/param.h>		/* __GLIBC__ */
++#ifdef __GLIBC__
++#include <bsd/queue.h>
+ #else
+ #include <sys/queue.h>
+ #endif
+Index: sys/dev/aic7xxx/aicasm/aicasm_symbol.c
+===================================================================
+--- sys/dev/aic7xxx/aicasm/aicasm_symbol.c.orig
++++ sys/dev/aic7xxx/aicasm/aicasm_symbol.c
+@@ -44,10 +44,11 @@
+ 
+ #include <sys/types.h>
+ 
+-#ifdef __linux__
+-#include "aicdb.h"
++#include <sys/param.h>		/* BSD */
++#ifdef BSD
++#include <db.h>			/* BSD native libdb */
+ #else
+-#include <db.h>
++#include <db_185.h>		/* Sleepycat 1.85 compat */
+ #endif
+ #include <fcntl.h>
+ #include <inttypes.h>
+Index: sys/dev/aic7xxx/aicasm/aicasm_symbol.h
+===================================================================
+--- sys/dev/aic7xxx/aicasm/aicasm_symbol.h.orig
++++ sys/dev/aic7xxx/aicasm/aicasm_symbol.h
+@@ -42,8 +42,9 @@
+  * $FreeBSD: src/sys/dev/aic7xxx/aicasm/aicasm_symbol.h,v 1.17 2005/01/06 01:42:27 imp Exp $
+  */
+ 
+-#ifdef __linux__
+-#include "../queue.h"
++#include <sys/param.h>		/* __GLIBC__ */
++#ifdef __GLIBC__
++#include <bsd/queue.h>
+ #else
+ #include <sys/queue.h>
+ #endif
--- kfreebsd-7-7.0.orig/debian/patches/910_GENERIC_hints.diff
+++ kfreebsd-7-7.0/debian/patches/910_GENERIC_hints.diff
@@ -0,0 +1,24 @@
+Index: sys/i386/conf/GENERIC.hints
+===================================================================
+--- sys/i386/conf/GENERIC.hints.orig
++++ sys/i386/conf/GENERIC.hints
+@@ -27,6 +27,7 @@
+ hint.atkbd.0.irq="1"
+ hint.psm.0.at="atkbdc"
+ hint.psm.0.irq="12"
++hint.psm.0.flags="0x100"
+ hint.vga.0.at="isa"
+ hint.sc.0.at="isa"
+ hint.sc.0.flags="0x100"
+Index: sys/amd64/conf/GENERIC.hints
+===================================================================
+--- sys/amd64/conf/GENERIC.hints.orig
++++ sys/amd64/conf/GENERIC.hints
+@@ -13,6 +13,7 @@
+ hint.atkbd.0.irq="1"
+ hint.psm.0.at="atkbdc"
+ hint.psm.0.irq="12"
++hint.psm.0.flags="0x100"
+ hint.vga.0.at="isa"
+ hint.sc.0.at="isa"
+ hint.sc.0.flags="0x100"
--- kfreebsd-7-7.0.orig/debian/patches/009_disable_duped_modules.diff
+++ kfreebsd-7-7.0/debian/patches/009_disable_duped_modules.diff
@@ -0,0 +1,144 @@
+
+Status: in upstream BTS
+
+Index: sys/conf/Makefile.amd64
+===================================================================
+--- sys/conf/Makefile.amd64.orig
++++ sys/conf/Makefile.amd64
+@@ -38,6 +38,8 @@
+ 
+ MKMODULESENV+= MACHINE=amd64
+ 
++%WITHOUT_MODULES
++
+ %BEFORE_DEPEND
+ 
+ %OBJS
+Index: sys/conf/Makefile.arm
+===================================================================
+--- sys/conf/Makefile.arm.orig
++++ sys/conf/Makefile.arm
+@@ -109,6 +109,8 @@
+ 	rm ${KERNEL_KO}.tmp.gz ${KERNEL_KO}.tramp.noheader opt_kernname.h \
+ 	inflate-tramp.o tmphack.S
+ 
++%WITHOUT_MODULES
++
+ %BEFORE_DEPEND
+ 
+ %OBJS
+Index: sys/conf/Makefile.i386
+===================================================================
+--- sys/conf/Makefile.i386.orig
++++ sys/conf/Makefile.i386
+@@ -34,6 +34,8 @@
+ 
+ MKMODULESENV+=	MACHINE=${MACHINE}
+ 
++%WITHOUT_MODULES
++
+ %BEFORE_DEPEND
+ 
+ %OBJS
+Index: sys/conf/Makefile.ia64
+===================================================================
+--- sys/conf/Makefile.ia64.orig
++++ sys/conf/Makefile.ia64
+@@ -36,6 +36,8 @@
+ 
+ ASM_CFLAGS= -x assembler-with-cpp -Wa,-x -DLOCORE ${CFLAGS}
+ 
++%WITHOUT_MODULES
++
+ %BEFORE_DEPEND
+ 
+ %OBJS
+Index: sys/conf/Makefile.pc98
+===================================================================
+--- sys/conf/Makefile.pc98.orig
++++ sys/conf/Makefile.pc98
+@@ -34,6 +34,8 @@
+ 
+ MKMODULESENV+=	MACHINE=${MACHINE}
+ 
++%WITHOUT_MODULES
++
+ %BEFORE_DEPEND
+ 
+ %OBJS
+Index: sys/conf/Makefile.powerpc
+===================================================================
+--- sys/conf/Makefile.powerpc.orig
++++ sys/conf/Makefile.powerpc
+@@ -37,6 +37,8 @@
+ CFLAGS+=	-fno-omit-frame-pointer
+ .endif
+ 
++%WITHOUT_MODULES
++
+ %BEFORE_DEPEND
+ 
+ %OBJS
+Index: sys/conf/Makefile.sparc64
+===================================================================
+--- sys/conf/Makefile.sparc64.orig
++++ sys/conf/Makefile.sparc64
+@@ -32,6 +32,8 @@
+ 
+ MDOBJS=	exception.o interrupt.o
+ 
++%WITHOUT_MODULES
++
+ %BEFORE_DEPEND
+ 
+ %OBJS
+Index: usr.sbin/config/mkmakefile.c
+===================================================================
+--- usr.sbin/config/mkmakefile.c.orig
++++ usr.sbin/config/mkmakefile.c
+@@ -70,6 +70,7 @@
+ static void do_rules(FILE *);
+ static void do_xxfiles(char *, FILE *);
+ static void do_objs(FILE *);
++static void do_without_modules(FILE *);
+ static void do_before_depend(FILE *);
+ static int opteq(const char *, const char *);
+ static void read_files(void);
+@@ -142,6 +143,8 @@
+ 		}
+ 		if (eq(line, "%BEFORE_DEPEND\n"))
+ 			do_before_depend(ofp);
++		else if (eq(line, "%WITHOUT_MODULES\n"))
++			do_without_modules(ofp);
+ 		else if (eq(line, "%OBJS\n"))
+ 			do_objs(ofp);
+ 		else if (strncmp(line, "%FILES.", 7) == 0)
+@@ -622,6 +625,28 @@
+ }
+ 
+ static void
++do_without_modules(FILE *fp)
++{
++	struct device *dp;
++	int lpos, len;
++	char *cp, *sp;
++
++	fprintf(fp, "MKMODULESENV+= WITHOUT_MODULES=\"");
++	lpos = 34;
++	STAILQ_FOREACH(dp, &dtab, d_next) {
++		sp = dp->d_name;
++		cp = sp + (len = strlen(sp)) - 1;
++		if (len + lpos > 72) {
++			lpos = 8;
++			fprintf(fp, "\\\n\t");
++		}
++		fprintf(fp, "%s ", sp);
++		lpos += len + 1;
++	}
++	fprintf(fp, "\"\n");
++}
++
++static void
+ do_xxfiles(char *tag, FILE *fp)
+ {
+ 	struct file_list *tp;
--- kfreebsd-7-7.0.orig/debian/patches/004_xargs.diff
+++ kfreebsd-7-7.0/debian/patches/004_xargs.diff
@@ -0,0 +1,35 @@
+
+Status: xargs -J option requested to both upstream and debian.
+
+Index: sys/conf/kmod.mk
+===================================================================
+--- sys/conf/kmod.mk.orig
++++ sys/conf/kmod.mk
+@@ -204,7 +204,7 @@
+ 	grep -v '^#' < ${EXPORT_SYMS} > export_syms
+ .endif
+ 	awk -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET} \
+-	    export_syms | xargs -J% ${OBJCOPY} % ${.TARGET}
++	    export_syms | xargs -I% ${OBJCOPY} % ${.TARGET}
+ .endif
+ .endif
+ .if !defined(DEBUG_FLAGS) && ${MACHINE_ARCH} == amd64
+Index: sys/contrib/dev/acpica/acpica_prep.sh
+===================================================================
+--- sys/contrib/dev/acpica/acpica_prep.sh.orig
++++ sys/contrib/dev/acpica/acpica_prep.sh
+@@ -55,12 +55,12 @@
+ 
+ echo copying full dirs
+ for i in ${fulldirs}; do
+-	find ${wrk} -name ${i} -type d | xargs -J % mv % ${dst}
++	find ${wrk} -name ${i} -type d | xargs -I % mv % ${dst}
+ done
+ 
+ # move files to destination
+ echo copying flat dirs
+-find ${wrk} -type f | xargs -J % mv % ${dst}
++find ${wrk} -type f | xargs -I % mv % ${dst}
+ mv ${dst}/changes.txt ${dst}/CHANGES.txt
+ 
+ # update src/headers for appropriate paths
--- kfreebsd-7-7.0.orig/debian/patches/907_cpu_class.diff
+++ kfreebsd-7-7.0/debian/patches/907_cpu_class.diff
@@ -0,0 +1,31 @@
+
+Status: Rejected in upstream (kern/77355).
+
+Index: sys/i386/i386/identcpu.c
+===================================================================
+--- sys/i386/i386/identcpu.c.orig
++++ sys/i386/i386/identcpu.c
+@@ -643,6 +643,7 @@
+ #if defined(I486_CPU)
+ 	case CPUCLASS_486:
+ 		printf("486");
++		machine[1] = '4';
+ 		bzero_vector = i486_bzero;
+ 		break;
+ #endif
+@@ -653,6 +654,7 @@
+ 		       (intmax_t)(tsc_freq + 4999) / 1000000,
+ 		       (u_int)((tsc_freq + 4999) / 10000) % 100);
+ 		printf("586");
++		machine[1] = '5';
+ 		break;
+ #endif
+ #if defined(I686_CPU)
+@@ -662,6 +664,7 @@
+ 		       (intmax_t)(tsc_freq + 4999) / 1000000,
+ 		       (u_int)((tsc_freq + 4999) / 10000) % 100);
+ 		printf("686");
++		machine[1] = '6';
+ 		break;
+ #endif
+ 	default:
--- kfreebsd-7-7.0.orig/debian/patches/913_uudecode.diff
+++ kfreebsd-7-7.0/debian/patches/913_uudecode.diff
@@ -0,0 +1,119 @@
+Index: sys/modules/cxgb/Makefile
+===================================================================
+--- sys/modules/cxgb/Makefile.orig
++++ sys/modules/cxgb/Makefile
+@@ -18,21 +18,21 @@
+ .if ${MACHINE_ARCH} != "ia64"
+ # ld is broken on ia64
+ t3fw-4.7.0.bin: ${CXGB}/t3fw-4.7.0.bin.gz.uu
+-	uudecode -p < ${CXGB}/t3fw-4.7.0.bin.gz.uu \
++	uudecode -o- < ${CXGB}/t3fw-4.7.0.bin.gz.uu \
+ 	| gzip -dc > ${.TARGET}
+ 
+ FIRMWS= t3fw-4.7.0.bin:t3fw470
+ CLEANFILES+= t3fw-4.7.0.bin
+ 
+ t3b_protocol_sram-1.1.0.bin: ${CXGB}/t3b_protocol_sram-1.1.0.bin.gz.uu
+-	uudecode -p < ${CXGB}/t3b_protocol_sram-1.1.0.bin.gz.uu \
++	uudecode -o- < ${CXGB}/t3b_protocol_sram-1.1.0.bin.gz.uu \
+ 	| gzip -dc > ${.TARGET}
+ 
+ FIRMWS+= t3b_protocol_sram-1.1.0.bin:t3bps110
+ CLEANFILES+= t3b_protocol_sram-1.1.0.bin
+ 
+ t3b_tp_eeprom-1.1.0.bin: ${CXGB}/t3b_tp_eeprom-1.1.0.bin.gz.uu
+-	uudecode -p < ${CXGB}/t3b_tp_eeprom-1.1.0.bin.gz.uu \
++	uudecode -o- < ${CXGB}/t3b_tp_eeprom-1.1.0.bin.gz.uu \
+ 	| gzip -dc > ${.TARGET}
+ 
+ FIRMWS+= t3b_tp_eeprom-1.1.0.bin:t3btpe110
+Index: sys/modules/ipwfw/ipw_bss/Makefile
+===================================================================
+--- sys/modules/ipwfw/ipw_bss/Makefile.orig
++++ sys/modules/ipwfw/ipw_bss/Makefile
+@@ -9,7 +9,7 @@
+ CLEANFILES=	ipw_bss
+ 
+ ipw_bss: ${.CURDIR}/../../../contrib/dev/ipw/ipw2100-1.3.fw.uu
+-	uudecode -p ${.CURDIR}/../../../contrib/dev/ipw/ipw2100-1.3.fw.uu > ${.TARGET}
++	uudecode -o- ${.CURDIR}/../../../contrib/dev/ipw/ipw2100-1.3.fw.uu > ${.TARGET}
+ 
+ .include <bsd.kmod.mk>
+ 
+Index: sys/modules/ipwfw/ipw_ibss/Makefile
+===================================================================
+--- sys/modules/ipwfw/ipw_ibss/Makefile.orig
++++ sys/modules/ipwfw/ipw_ibss/Makefile
+@@ -9,7 +9,7 @@
+ CLEANFILES=	ipw_ibss
+ 
+ ipw_ibss: ${.CURDIR}/../../../contrib/dev/ipw/ipw2100-1.3-i.fw.uu
+-	uudecode -p ${.CURDIR}/../../../contrib/dev/ipw/ipw2100-1.3-i.fw.uu > ${.TARGET}
++	uudecode -o- ${.CURDIR}/../../../contrib/dev/ipw/ipw2100-1.3-i.fw.uu > ${.TARGET}
+ 
+ .include <bsd.kmod.mk>
+ 
+Index: sys/modules/ipwfw/ipw_monitor/Makefile
+===================================================================
+--- sys/modules/ipwfw/ipw_monitor/Makefile.orig
++++ sys/modules/ipwfw/ipw_monitor/Makefile
+@@ -9,7 +9,7 @@
+ CLEANFILES=	ipw_monitor
+ 
+ ipw_monitor: ${.CURDIR}/../../../contrib/dev/ipw/ipw2100-1.3-p.fw.uu
+-	uudecode -p ${.CURDIR}/../../../contrib/dev/ipw/ipw2100-1.3-p.fw.uu > ${.TARGET}
++	uudecode -o- ${.CURDIR}/../../../contrib/dev/ipw/ipw2100-1.3-p.fw.uu > ${.TARGET}
+ 
+ .include <bsd.kmod.mk>
+ 
+Index: sys/modules/iwifw/iwi_bss/Makefile
+===================================================================
+--- sys/modules/iwifw/iwi_bss/Makefile.orig
++++ sys/modules/iwifw/iwi_bss/Makefile
+@@ -9,7 +9,7 @@
+ CLEANFILES=	iwi_bss
+ 
+ iwi_bss: ${.CURDIR}/../../../contrib/dev/iwi/ipw2200-bss.fw.uu
+-	uudecode -p ${.CURDIR}/../../../contrib/dev/iwi/ipw2200-bss.fw.uu > ${.TARGET}
++	uudecode -o- ${.CURDIR}/../../../contrib/dev/iwi/ipw2200-bss.fw.uu > ${.TARGET}
+ 
+ .include <bsd.kmod.mk>
+ 
+Index: sys/modules/iwifw/iwi_ibss/Makefile
+===================================================================
+--- sys/modules/iwifw/iwi_ibss/Makefile.orig
++++ sys/modules/iwifw/iwi_ibss/Makefile
+@@ -9,7 +9,7 @@
+ CLEANFILES=	iwi_fw
+ 
+ iwi_ibss: ${.CURDIR}/../../../contrib/dev/iwi/ipw2200-ibss.fw.uu
+-	uudecode -p ${.CURDIR}/../../../contrib/dev/iwi/ipw2200-ibss.fw.uu > ${.TARGET}
++	uudecode -o- ${.CURDIR}/../../../contrib/dev/iwi/ipw2200-ibss.fw.uu > ${.TARGET}
+ 
+ .include <bsd.kmod.mk>
+ 
+Index: sys/modules/iwifw/iwi_monitor/Makefile
+===================================================================
+--- sys/modules/iwifw/iwi_monitor/Makefile.orig
++++ sys/modules/iwifw/iwi_monitor/Makefile
+@@ -9,7 +9,7 @@
+ CLEANFILES=	iwi_monitor
+ 
+ iwi_monitor: ${.CURDIR}/../../../contrib/dev/iwi/ipw2200-sniffer.fw.uu
+-	uudecode -p ${.CURDIR}/../../../contrib/dev/iwi/ipw2200-sniffer.fw.uu > ${.TARGET}
++	uudecode -o- ${.CURDIR}/../../../contrib/dev/iwi/ipw2200-sniffer.fw.uu > ${.TARGET}
+ 
+ .include <bsd.kmod.mk>
+ 
+Index: sys/modules/wpifw/Makefile
+===================================================================
+--- sys/modules/wpifw/Makefile.orig
++++ sys/modules/wpifw/Makefile
+@@ -9,6 +9,6 @@
+ CLEANFILES=	iwlwifi-3945-2.14.4.fw
+ 
+ iwlwifi-3945-2.14.4.fw: ${.CURDIR}/../../contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu
+-	uudecode -p ${.CURDIR}/../../contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu > ${.TARGET}
++	uudecode -o- ${.CURDIR}/../../contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu > ${.TARGET}
+ 
+ .include <bsd.kmod.mk>
--- kfreebsd-7-7.0.orig/debian/patches/902_version.diff
+++ kfreebsd-7-7.0/debian/patches/902_version.diff
@@ -0,0 +1,13 @@
+Index: sys/conf/newvers.sh
+===================================================================
+--- sys/conf/newvers.sh.orig
++++ sys/conf/newvers.sh
+@@ -89,7 +89,7 @@
+ cat << EOF > vers.c
+ $COPYRIGHT
+ #define SCCSSTR "@(#)${VERSION} #${v}: ${t}"
+-#define VERSTR "${VERSION} #${v}: ${t}\\n    ${u}@${h}:${d}\\n"
++#define VERSTR "#${v} ${t}\\n"
+ #define RELSTR "${RELEASE}"
+ 
+ char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;
--- kfreebsd-7-7.0.orig/debian/patches/README
+++ kfreebsd-7-7.0/debian/patches/README
@@ -0,0 +1,9 @@
+
+For the patch directory we follow these guidelines, inspired by the ones in
+xfree86 package (thanks Branden):
+
+  000:      patches from upstream or merged in upstream.
+  001-899:  patches that should be merged in upstream.
+  900-999:  patches that are specific to debian or were rejected by upstream.
+
+ -- Robert Millan <rmh@debian.org>  Tue,  5 Oct 2004 00:58:50 +0200
--- kfreebsd-7-7.0.orig/debian/patches/000_tcp.diff
+++ kfreebsd-7-7.0/debian/patches/000_tcp.diff
@@ -0,0 +1,94 @@
+Index: sys/netinet/tcp.h
+===================================================================
+RCS file: /home/ncvs/src/sys/netinet/tcp.h,v
+retrieving revision 1.40
+diff -p -u -I__FBSDID -I$FreeBSD -r1.40 tcp.h
+--- sys/netinet/tcp.h	25 May 2007 21:28:49 -0000	1.40
++++ sys/netinet/tcp.h	18 Jun 2008 05:36:20 -0000
+@@ -78,6 +78,8 @@ struct tcphdr {
+ 
+ #define	TCPOPT_EOL		0
+ #define	   TCPOLEN_EOL			1
++#define	TCPOPT_PAD		0		/* padding after EOL */
++#define	   TCPOLEN_PAD			1
+ #define	TCPOPT_NOP		1
+ #define	   TCPOLEN_NOP			1
+ #define	TCPOPT_MAXSEG		2
+Index: sys/netinet/tcp_output.c
+===================================================================
+RCS file: /home/ncvs/src/sys/netinet/tcp_output.c,v
+retrieving revision 1.141.2.3
+diff -p -u -I__FBSDID -I$FreeBSD -r1.141.2.3 tcp_output.c
+--- sys/netinet/tcp_output.c	5 Dec 2007 10:37:17 -0000	1.141.2.3
++++ sys/netinet/tcp_output.c	18 Jun 2008 05:36:21 -0000
+@@ -1280,12 +1280,16 @@ tcp_addoptions(struct tcpopt *to, u_char
+ 	for (mask = 1; mask < TOF_MAXOPT; mask <<= 1) {
+ 		if ((to->to_flags & mask) != mask)
+ 			continue;
++		if (optlen == TCP_MAXOLEN)
++			break;
+ 		switch (to->to_flags & mask) {
+ 		case TOF_MSS:
+ 			while (optlen % 4) {
+ 				optlen += TCPOLEN_NOP;
+ 				*optp++ = TCPOPT_NOP;
+ 			}
++			if (TCP_MAXOLEN - optlen < TCPOLEN_MAXSEG)
++				continue;
+ 			optlen += TCPOLEN_MAXSEG;
+ 			*optp++ = TCPOPT_MAXSEG;
+ 			*optp++ = TCPOLEN_MAXSEG;
+@@ -1298,6 +1302,8 @@ tcp_addoptions(struct tcpopt *to, u_char
+ 				optlen += TCPOLEN_NOP;
+ 				*optp++ = TCPOPT_NOP;
+ 			}
++			if (TCP_MAXOLEN - optlen < TCPOLEN_WINDOW)
++				continue;
+ 			optlen += TCPOLEN_WINDOW;
+ 			*optp++ = TCPOPT_WINDOW;
+ 			*optp++ = TCPOLEN_WINDOW;
+@@ -1308,6 +1314,8 @@ tcp_addoptions(struct tcpopt *to, u_char
+ 				optlen += TCPOLEN_NOP;
+ 				*optp++ = TCPOPT_NOP;
+ 			}
++			if (TCP_MAXOLEN - optlen < TCPOLEN_SACK_PERMITTED)
++				continue;
+ 			optlen += TCPOLEN_SACK_PERMITTED;
+ 			*optp++ = TCPOPT_SACK_PERMITTED;
+ 			*optp++ = TCPOLEN_SACK_PERMITTED;
+@@ -1317,6 +1325,8 @@ tcp_addoptions(struct tcpopt *to, u_char
+ 				optlen += TCPOLEN_NOP;
+ 				*optp++ = TCPOPT_NOP;
+ 			}
++			if (TCP_MAXOLEN - optlen < TCPOLEN_TIMESTAMP)
++				continue;
+ 			optlen += TCPOLEN_TIMESTAMP;
+ 			*optp++ = TCPOPT_TIMESTAMP;
+ 			*optp++ = TCPOLEN_TIMESTAMP;
+@@ -1355,7 +1365,7 @@ tcp_addoptions(struct tcpopt *to, u_char
+ 				optlen += TCPOLEN_NOP;
+ 				*optp++ = TCPOPT_NOP;
+ 			}
+-			if (TCP_MAXOLEN - optlen < 2 + TCPOLEN_SACK)
++			if (TCP_MAXOLEN - optlen < TCPOLEN_SACKHDR + TCPOLEN_SACK)
+ 				continue;
+ 			optlen += TCPOLEN_SACKHDR;
+ 			*optp++ = TCPOPT_SACK;
+@@ -1386,9 +1396,15 @@ tcp_addoptions(struct tcpopt *to, u_char
+ 		optlen += TCPOLEN_EOL;
+ 		*optp++ = TCPOPT_EOL;
+ 	}
++	/*
++	 * According to RFC 793 (STD0007):
++	 *   "The content of the header beyond the End-of-Option option
++	 *    must be header padding (i.e., zero)."
++	 *   and later: "The padding is composed of zeros."
++	 */
+ 	while (optlen % 4) {
+-		optlen += TCPOLEN_NOP;
+-		*optp++ = TCPOPT_NOP;
++		optlen += TCPOLEN_PAD;
++		*optp++ = TCPOPT_PAD;
+ 	}
+ 
+ 	KASSERT(optlen <= TCP_MAXOLEN, ("%s: TCP options too long", __func__));
--- kfreebsd-7-7.0.orig/debian/patches/903_disable_non-free_drivers.diff
+++ kfreebsd-7-7.0/debian/patches/903_disable_non-free_drivers.diff
@@ -0,0 +1,348 @@
+Index: sys/conf/files
+===================================================================
+--- sys/conf/files.orig
++++ sys/conf/files
+@@ -469,17 +469,6 @@
+ dev/ata/atapi-cd.c		optional atapicd
+ dev/ata/atapi-fd.c		optional atapifd
+ dev/ata/atapi-tape.c		optional atapist
+-dev/ath/ah_osdep.c optional ath_hal \
+-	compile-with "${NORMAL_C} -I$S/dev/ath"
+-dev/ath/ath_rate/amrr/amrr.c	optional ath_rate_amrr
+-dev/ath/ath_rate/onoe/onoe.c	optional ath_rate_onoe \
+-	compile-with "${NORMAL_C} -I$S/dev/ath"
+-dev/ath/ath_rate/sample/sample.c	optional ath_rate_sample \
+-	compile-with "${NORMAL_C} -I$S/dev/ath"
+-dev/ath/if_ath.c		optional ath \
+-	compile-with "${NORMAL_C} -I$S/dev/ath"
+-dev/ath/if_ath_pci.c		optional ath pci \
+-	compile-with "${NORMAL_C} -I$S/dev/ath"
+ dev/awi/am79c930.c		optional awi
+ dev/awi/awi.c			optional awi
+ dev/awi/if_awi_pccard.c		optional awi pccard
+Index: sys/conf/files.i386
+===================================================================
+--- sys/conf/files.i386.orig
++++ sys/conf/files.i386
+@@ -46,42 +46,6 @@
+ 	no-obj no-implicit-rule before-depend				\
+ 	clean		"ukbdmap.h"
+ #
+-trlld.o				optional	oltr			\
+-	dependency	"$S/contrib/dev/oltr/i386-elf.trlld.o.uu"	\
+-	compile-with	"uudecode < $S/contrib/dev/oltr/i386-elf.trlld.o.uu"	\
+-	no-implicit-rule
+-#
+-hal.o				optional	ath_hal			\
+-	dependency	"$S/contrib/dev/ath/public/i386-elf.hal.o.uu"	\
+-	compile-with	"uudecode < $S/contrib/dev/ath/public/i386-elf.hal.o.uu" \
+-	no-implicit-rule
+-opt_ah.h			optional	ath_hal			\
+-	dependency	"$S/contrib/dev/ath/public/i386-elf.opt_ah.h"	\
+-	compile-with	"rm -f opt_ah.h; cp $S/contrib/dev/ath/public/i386-elf.opt_ah.h opt_ah.h" \
+-	no-obj no-implicit-rule before-depend				\
+-	clean		"opt_ah.h"
+-#
+-nvenetlib.o			optional	nve pci			\
+-	dependency	"$S/contrib/dev/nve/i386/nvenetlib.o.bz2.uu"	\
+-	compile-with	"uudecode $S/contrib/dev/nve/i386/nvenetlib.o.bz2.uu ; bzip2 -df nvenetlib.o.bz2" \
+-	no-implicit-rule
+-#
+-os+%DIKED-nve.h		optional	nve pci			\
+-	dependency	"$S/contrib/dev/nve/os.h"			\
+-	compile-with	"sed -e 's/^.*#include.*phy\.h.*$$//' $S/contrib/dev/nve/os.h > os+%DIKED-nve.h" \
+-	no-implicit-rule no-obj before-depend				\
+-	clean		"os+%DIKED-nve.h"
+-#
+-hptrr_lib.o			optional	hptrr			\
+-	dependency	"$S/dev/hptrr/i386-elf.hptrr_lib.o.uu"		\
+-	compile-with	"uudecode < $S/dev/hptrr/i386-elf.hptrr_lib.o.uu" \
+-	no-implicit-rule
+-#
+-hptmvraid.o			optional	hptmv			\
+-	dependency	"$S/dev/hptmv/i386-elf.raid.o.uu"	\
+-	compile-with	"uudecode < $S/dev/hptmv/i386-elf.raid.o.uu" \
+-	no-implicit-rule
+-#
+ #
+ compat/linprocfs/linprocfs.c	optional linprocfs
+ compat/linsysfs/linsysfs.c	optional linsysfs
+@@ -179,14 +143,6 @@
+ dev/fdc/fdc_isa.c		optional fdc isa
+ dev/fdc/fdc_pccard.c		optional fdc pccard
+ dev/fe/if_fe_isa.c		optional fe isa
+-dev/hptmv/entry.c		optional hptmv
+-dev/hptmv/mv.c			optional hptmv
+-dev/hptmv/gui_lib.c		optional hptmv
+-dev/hptmv/hptproc.c		optional hptmv
+-dev/hptmv/ioctl.c		optional hptmv
+-dev/hptrr/hptrr_os_bsd.c	optional hptrr
+-dev/hptrr/hptrr_osm_bsd.c	optional hptrr
+-dev/hptrr/hptrr_config.c	optional hptrr
+ dev/hwpmc/hwpmc_amd.c		optional hwpmc
+ dev/hwpmc/hwpmc_pentium.c	optional hwpmc
+ dev/hwpmc/hwpmc_piv.c		optional hwpmc
+@@ -213,7 +169,6 @@
+ dev/mse/mse.c			optional mse
+ dev/mse/mse_isa.c		optional mse isa
+ dev/nfe/if_nfe.c		optional nfe pci
+-dev/nve/if_nve.c		optional nve pci
+ dev/nvram/nvram.c		optional nvram isa
+ dev/pcf/pcf_isa.c		optional pcf
+ dev/random/nehemiah.c		optional random
+Index: sys/conf/kern.pre.mk
+===================================================================
+--- sys/conf/kern.pre.mk.orig
++++ sys/conf/kern.pre.mk
+@@ -67,9 +67,6 @@
+ # ... and the same for pf
+ INCLUDES+= -I$S/contrib/pf
+ 
+-# ... and the same for Atheros HAL
+-INCLUDES+= -I$S/dev/ath
+-
+ # ... and the same for the NgATM stuff
+ INCLUDES+= -I$S/contrib/ngatm
+ 
+Index: sys/i386/conf/GENERIC
+===================================================================
+--- sys/i386/conf/GENERIC.orig
++++ sys/i386/conf/GENERIC
+@@ -128,8 +128,6 @@
+ device		asr		# DPT SmartRAID V, VI and Adaptec SCSI RAID
+ device		ciss		# Compaq Smart RAID 5*
+ device		dpt		# DPT Smartcache III, IV - See NOTES for options
+-device		hptmv		# Highpoint RocketRAID 182x
+-device		hptrr		# Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx
+ device		iir		# Intel Integrated RAID
+ device		ips		# IBM (Adaptec) ServeRAID
+ device		mly		# Mylex AcceleRAID/eXtremeRAID
+Index: sys/modules/Makefile
+===================================================================
+--- sys/modules/Makefile.orig
++++ sys/modules/Makefile
+@@ -25,11 +25,6 @@
+ 	${_arl} \
+ 	${_asr} \
+ 	ata \
+-	${_ath} \
+-	${_ath_hal} \
+-	${_ath_rate_amrr} \
+-	${_ath_rate_onoe} \
+-	${_ath_rate_sample} \
+ 	aue \
+ 	${_auxio} \
+ 	${_awi} \
+@@ -95,8 +90,6 @@
+ 	hifn \
+ 	hme \
+ 	${_hptiop} \
+-	${_hptmv} \
+-	${_hptrr} \
+ 	hwpmc \
+ 	${_i2c} \
+ 	${_ibcs2} \
+@@ -189,10 +182,8 @@
+ 	ntfs_iconv \
+ 	${_nxge} \
+ 	nullfs \
+-	${_nve} \
+ 	${_nvram} \
+ 	${_nwfs} \
+-	${_oltr} \
+ 	${_padlock} \
+ 	patm \
+ 	${_pccard} \
+@@ -313,7 +304,6 @@
+ 	${_xe} \
+ 	xfs \
+ 	xl \
+-	${_zfs} \
+ 	zlib \
+ 	zyd
+ 
+@@ -363,11 +353,6 @@
+ _apm=		apm
+ _ar=		ar
+ _arcnet=	arcnet
+-_ath=		ath
+-_ath_hal=	ath_hal
+-_ath_rate_amrr=	ath_rate_amrr
+-_ath_rate_onoe=	ath_rate_onoe
+-_ath_rate_sample=ath_rate_sample
+ _awi=		awi
+ _bktr=		bktr
+ _cardbus=	cardbus
+@@ -406,7 +391,6 @@
+ .if ${MK_NCP} != "no"
+ _nwfs=		nwfs
+ .endif
+-_oltr=		oltr
+ _pccard=	pccard
+ _pcfclock=	pcfclock
+ _pecoff=	pecoff
+@@ -427,9 +411,6 @@
+ _tmpfs= 	tmpfs
+ _wi=		wi
+ _xe=		xe
+-.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
+-_zfs=		zfs
+-.endif
+ .if ${MACHINE} == "i386"
+ _aac=		aac
+ _acpi=		acpi
+@@ -446,8 +427,6 @@
+ _dpt=		dpt
+ _ex=		ex
+ _hptiop=	hptiop
+-_hptmv=		hptmv
+-_hptrr=		hptrr
+ _ichwd=		ichwd
+ _ida=		ida
+ # Disabled due to non-MPSAFEty in 7.0
+@@ -462,7 +441,6 @@
+ _ixgb=   	ixgb
+ _mly=		mly
+ _nfe=		nfe
+-_nve=		nve
+ _nvram=		nvram
+ _nxge=		nxge
+ _wpi=		wpi
+@@ -489,11 +467,6 @@
+ _agp=		agp
+ _an=		an
+ _arcmsr=	arcmsr
+-_ath=		ath
+-_ath_hal=	ath_hal
+-_ath_rate_amrr=	ath_rate_amrr
+-_ath_rate_onoe=	ath_rate_onoe
+-_ath_rate_sample=ath_rate_sample
+ _cardbus=	cardbus
+ _cbb=		cbb
+ _ciss=		ciss
+@@ -506,8 +479,6 @@
+ _exca=		exca
+ _ext2fs=	ext2fs
+ _hptiop=	hptiop
+-_hptmv=		hptmv
+-_hptrr=		hptrr
+ _i2c=		i2c
+ _ichwd=		ichwd
+ _ida=		ida
+@@ -525,7 +496,6 @@
+ _mly=		mly
+ _ndis=		ndis
+ _nfe=		nfe
+-_nve=		nve
+ _nvram=		nvram
+ _nxge=		nxge
+ _pccard=	pccard
+@@ -540,9 +510,6 @@
+ _wi=		wi
+ _wpi=		wpi
+ _wpifw=		wpifw
+-.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
+-_zfs=		zfs
+-.endif
+ .endif
+ 
+ .if ${MACHINE_ARCH} == "ia64"
+@@ -583,21 +550,11 @@
+ 
+ .if ${MACHINE_ARCH} == "powerpc"
+ _an=		an
+-_ath=		ath
+-_ath_hal=	ath_hal
+-_ath_rate_amrr=	ath_rate_amrr
+-_ath_rate_onoe=	ath_rate_onoe
+-_ath_rate_sample=ath_rate_sample
+ _nvram=		powermac_nvram
+ _smbfs=		smbfs
+ .endif
+ 
+ .if ${MACHINE_ARCH} == "sparc64"
+-_ath=		ath
+-_ath_hal=	ath_hal
+-_ath_rate_amrr=	ath_rate_amrr
+-_ath_rate_onoe=	ath_rate_onoe
+-_ath_rate_sample=ath_rate_sample
+ _auxio=		auxio
+ _em=		em
+ _i2c=		i2c
+Index: sys/amd64/conf/GENERIC
+===================================================================
+--- sys/amd64/conf/GENERIC.orig
++++ sys/amd64/conf/GENERIC
+@@ -121,8 +121,6 @@
+ device		arcmsr		# Areca SATA II RAID
+ device		ciss		# Compaq Smart RAID 5*
+ device		dpt		# DPT Smartcache III, IV - See NOTES for options
+-device		hptmv		# Highpoint RocketRAID 182x
+-device		hptrr		# Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx
+ device		iir		# Intel Integrated RAID
+ device		ips		# IBM (Adaptec) ServeRAID
+ device		mly		# Mylex AcceleRAID/eXtremeRAID
+Index: sys/conf/files.amd64
+===================================================================
+--- sys/conf/files.amd64.orig
++++ sys/conf/files.amd64
+@@ -47,37 +47,6 @@
+ 	no-obj no-implicit-rule before-depend				\
+ 	clean		"ukbdmap.h"
+ #
+-hal.o				optional	ath_hal			\
+-	dependency	"$S/contrib/dev/ath/public/x86_64-elf.hal.o.uu"	\
+-	compile-with	"uudecode < $S/contrib/dev/ath/public/x86_64-elf.hal.o.uu" \
+-	no-implicit-rule
+-opt_ah.h			optional	ath_hal			\
+-	dependency	"$S/contrib/dev/ath/public/x86_64-elf.opt_ah.h"	\
+-	compile-with	"rm -f opt_ah.h; cp $S/contrib/dev/ath/public/x86_64-elf.opt_ah.h opt_ah.h" \
+-	no-obj no-implicit-rule before-depend				\
+-	clean		"opt_ah.h"
+-#
+-nvenetlib.o			optional	nve pci			\
+-	dependency	"$S/contrib/dev/nve/amd64/nvenetlib.o.bz2.uu"	\
+-	compile-with	"uudecode $S/contrib/dev/nve/amd64/nvenetlib.o.bz2.uu ; bzip2 -df nvenetlib.o.bz2" \
+- 	no-implicit-rule
+-#
+-os+%DIKED-nve.h		optional	nve pci			\
+-	dependency	"$S/contrib/dev/nve/os.h"			\
+-	compile-with	"sed -e 's/^.*#include.*phy\.h.*$$//' $S/contrib/dev/nve/os.h > os+%DIKED-nve.h" \
+-	no-implicit-rule no-obj before-depend				\
+-	clean		"os+%DIKED-nve.h"
+-#
+-hptmvraid.o			optional	hptmv			\
+-	dependency	"$S/dev/hptmv/amd64-elf.raid.o.uu"	\
+-	compile-with	"uudecode < $S/dev/hptmv/amd64-elf.raid.o.uu" \
+-	no-implicit-rule
+-#
+-hptrr_lib.o			optional	hptrr			\
+-	dependency	"$S/dev/hptrr/amd64-elf.hptrr_lib.o.uu"		\
+-	compile-with	"uudecode < $S/dev/hptrr/amd64-elf.hptrr_lib.o.uu" \
+-	no-implicit-rule
+-#
+ #
+ amd64/acpica/OsdEnvironment.c	optional	acpi
+ amd64/acpica/acpi_machdep.c	optional	acpi
+@@ -175,21 +144,12 @@
+ dev/fdc/fdc_acpi.c		optional	fdc
+ dev/fdc/fdc_isa.c		optional	fdc isa
+ dev/fdc/fdc_pccard.c		optional	fdc pccard
+-dev/hptmv/entry.c		optional	hptmv
+-dev/hptmv/mv.c			optional	hptmv
+-dev/hptmv/gui_lib.c		optional	hptmv
+-dev/hptmv/hptproc.c		optional	hptmv
+-dev/hptmv/ioctl.c		optional	hptmv
+-dev/hptrr/hptrr_os_bsd.c	optional	hptrr
+-dev/hptrr/hptrr_osm_bsd.c	optional	hptrr
+-dev/hptrr/hptrr_config.c	optional	hptrr
+ dev/hwpmc/hwpmc_amd.c		optional	hwpmc
+ dev/hwpmc/hwpmc_piv.c		optional	hwpmc
+ dev/hwpmc/hwpmc_x86.c		optional	hwpmc
+ dev/kbd/kbd.c			optional	atkbd | sc | ukbd
+ dev/mem/memutil.c		optional	mem
+ dev/nfe/if_nfe.c		optional	nfe pci
+-dev/nve/if_nve.c		optional	nve pci
+ dev/nvram/nvram.c		optional	nvram isa
+ dev/sio/sio.c			optional	sio
+ dev/sio/sio_isa.c		optional	sio isa
--- kfreebsd-7-7.0.orig/debian/patches/001_misc.diff
+++ kfreebsd-7-7.0/debian/patches/001_misc.diff
@@ -0,0 +1,108 @@
+
+Status: chflags is BSD-specific.  We could add it to freebsd-utils.
+  The rest has been rejected (kern/93502)
+
+Index: sys/conf/kern.mk
+===================================================================
+--- sys/conf/kern.mk.orig
++++ sys/conf/kern.mk
+@@ -1,5 +1,9 @@
+ # $FreeBSD: src/sys/conf/kern.mk,v 1.52 2007/05/24 21:53:42 obrien Exp $
+ 
++.if !defined(OPSYS)
++OPSYS!=		uname -s
++.endif
++
+ #
+ # Warning flags for compiling the kernel and components of the kernel.
+ #
+@@ -9,10 +13,14 @@
+ .if ${CC} == "icc"
+ #CWARNFLAGS=	-w2	# use this if you are terribly bored
+ CWARNFLAGS=
+-.else
++elif !defined(CWARNFLAGS)
+ 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 ${OPSYS} == "FreeBSD"
++# FreeBSD extensions, not available in upstream GCC
++CWARNFLAGS+=  -fformat-extensions
++.endif
+ .if !defined(WITH_GCC3)
+ _Wno_pointer_sign=-Wno-pointer-sign
+ .endif
+@@ -36,8 +44,12 @@
+ # 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
++.if ${OPSYS} == "FreeBSD"
++# FreeBSD extensions, not available in upstream GCC
++CFLAGS+=      -mno-align-long-strings
++.endif
+ INLINE_LIMIT?=	8000
+ .endif
+ 
+Index: sys/conf/kern.post.mk
+===================================================================
+--- sys/conf/kern.post.mk.orig
++++ sys/conf/kern.post.mk
+@@ -1,5 +1,15 @@
+ # $FreeBSD: src/sys/conf/kern.post.mk,v 1.100 2007/03/23 21:55:59 imp Exp $
+ 
++.if !defined(OPSYS)
++OPSYS!=		uname -s
++.endif
++
++.if ${OPSYS} == "FreeBSD"
++WHEEL_GROUP?=	wheel
++.else
++WHEEL_GROUP?=	root
++.endif
++
+ # Part of a unified Makefile for building kernels.  This part includes all
+ # the definitions that need to be after all the % directives except %RULES
+ # and ones that act like they are part of %RULES.
+@@ -208,11 +218,9 @@
+ .if exists(${DESTDIR}${KODIR})
+ 	-thiskernel=`sysctl -n kern.bootfile` ; \
+ 	if [ ! "`dirname "$$thiskernel"`" -ef ${DESTDIR}${KODIR} ] ; then \
+-		chflags -R noschg ${DESTDIR}${KODIR} ; \
+ 		rm -rf ${DESTDIR}${KODIR} ; \
+ 	else \
+ 		if [ -d ${DESTDIR}${KODIR}.old ] ; then \
+-			chflags -R noschg ${DESTDIR}${KODIR}.old ; \
+ 			rm -rf ${DESTDIR}${KODIR}.old ; \
+ 		fi ; \
+ 		mv ${DESTDIR}${KODIR} ${DESTDIR}${KODIR}.old ; \
+@@ -220,21 +228,21 @@
+ 	fi
+ .endif
+ 	mkdir -p ${DESTDIR}${KODIR}
+-	${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO} ${DESTDIR}${KODIR}
++	${INSTALL} -p -m 555 -o root -g ${WHEEL_GROUP} ${KERNEL_KO} ${DESTDIR}${KODIR}
+ .if defined(DEBUG) && !defined(INSTALL_NODEBUG)
+-	${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO}.symbols ${DESTDIR}${KODIR}
++	${INSTALL} -p -m 555 -o root -g ${WHEEL_GROUP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR}
+ .endif
+ .if defined(KERNEL_EXTRA_INSTALL)
+-	${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_EXTRA_INSTALL} ${DESTDIR}${KODIR}
++	${INSTALL} -p -m 555 -o root -g ${WHEEL_GROUP} ${KERNEL_EXTRA_INSTALL} ${DESTDIR}${KODIR}
+ .endif
+ 
+ 
+ 
+ kernel-reinstall:
+ 	@-chflags -R noschg ${DESTDIR}${KODIR}
+-	${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO} ${DESTDIR}${KODIR}
++	${INSTALL} -p -m 555 -o root -g ${WHEEL_GROUP} ${KERNEL_KO} ${DESTDIR}${KODIR}
+ .if defined(DEBUG) && !defined(INSTALL_NODEBUG)
+-	${INSTALL} -p -m 555 -o root -g wheel ${KERNEL_KO}.symbols ${DESTDIR}${KODIR}
++	${INSTALL} -p -m 555 -o root -g ${WHEEL_GROUP} ${KERNEL_KO}.symbols ${DESTDIR}${KODIR}
+ .endif
+ 
+ config.o env.o hints.o vers.o vnode_if.o:
--- kfreebsd-7-7.0.orig/debian/patches/000_icmp6.diff
+++ kfreebsd-7-7.0/debian/patches/000_icmp6.diff
@@ -0,0 +1,23 @@
+Index: src/sys/netinet6/icmp6.c
+===================================================================
+RCS file: /home/ncvs/src/sys/netinet6/icmp6.c,v
+retrieving revision 1.80.2.4
+diff -u -p -r1.80.2.4 icmp6.c
+--- src/sys/netinet6/icmp6.c	31 Aug 2008 21:54:24 -0000	1.80.2.4
++++ src/sys/netinet6/icmp6.c	1 Sep 2008 23:03:44 -0000
+@@ -1117,6 +1117,15 @@ icmp6_mtudisc_update(struct ip6ctlparam 
+ 	if (!validated)
+ 		return;
+ 
++	/*
++	 * In case the suggested mtu is less than IPV6_MMTU, we
++	 * only need to remember that it was for above mentioned
++	 * "alwaysfrag" case.
++	 * Try to be as close to the spec as possible.
++	 */
++	if (mtu < IPV6_MMTU)
++		mtu = IPV6_MMTU - 8;
++
+ 	bzero(&inc, sizeof(inc));
+ 	inc.inc_flags = 1; /* IPv6 */
+ 	inc.inc6_faddr = *dst;
--- kfreebsd-7-7.0.orig/debian/patches/017_oss_compat.diff
+++ kfreebsd-7-7.0/debian/patches/017_oss_compat.diff
@@ -0,0 +1,13 @@
+Index: sys/sys/soundcard.h
+===================================================================
+--- sys/sys/soundcard.h.orig
++++ sys/sys/soundcard.h
+@@ -813,6 +813,8 @@
+     /* Has a coprocessor, sometimes it's a DSP but usually not */
+ #define DSP_CAP_TRIGGER		0x00001000 /* Supports SETTRIGGER */
+ #define DSP_CAP_MMAP 0x00002000 /* Supports mmap() */
++#define DSP_CAP_MULTI		0x00004000 /* Supports multiple open */
++#define DSP_CAP_BIND		0x00008000 /* Channel binding to front/rear/cneter/lfe */
+ 
+ /*
+  * What do these function do ?
--- kfreebsd-7-7.0.orig/debian/patches/005_binutils.diff
+++ kfreebsd-7-7.0/debian/patches/005_binutils.diff
@@ -0,0 +1,345 @@
+
+Status: Reported as kern/93331
+
+Index: sys/i386/i386/locore.s
+===================================================================
+--- sys/i386/i386/locore.s.orig
++++ sys/i386/i386/locore.s
+@@ -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. */
+Index: sys/i386/i386/swtch.s
+===================================================================
+--- sys/i386/i386/swtch.s.orig
++++ sys/i386/i386/swtch.s
+@@ -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)
+ 
+Index: sys/i386/include/cpufunc.h
+===================================================================
+--- sys/i386/include/cpufunc.h.orig
++++ sys/i386/include/cpufunc.h
+@@ -452,7 +452,7 @@
+ rfs(void)
+ {
+ 	u_int sel;
+-	__asm __volatile("movl %%fs,%0" : "=rm" (sel));
++	__asm __volatile("mov %%fs,%0" : "=rm" (sel));
+ 	return (sel);
+ }
+ 
+@@ -468,7 +468,7 @@
+ rgs(void)
+ {
+ 	u_int sel;
+-	__asm __volatile("movl %%gs,%0" : "=rm" (sel));
++	__asm __volatile("mov %%gs,%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("mov %0,%%fs" : : "rm" (sel));
+ }
+ 
+ static __inline void
+ load_gs(u_int sel)
+ {
+-	__asm __volatile("movl %0,%%gs" : : "rm" (sel));
++	__asm __volatile("mov %0,%%gs" : : "rm" (sel));
+ }
+ 
+ static __inline void
+Index: sys/i386/linux/linux_locore.s
+===================================================================
+--- sys/i386/linux/linux_locore.s.orig
++++ sys/i386/linux/linux_locore.s
+@@ -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() */
+@@ -19,7 +19,7 @@
+ linux_rt_sigcode:
+ 	call	*LINUX_RT_SIGF_HANDLER(%esp)
+ 	leal	LINUX_RT_SIGF_UC(%esp),%ebx	/* linux ucp */
+-	movl	LINUX_SC_GS(%ebx),%gs
++	movw	LINUX_SC_GS(%ebx),%gs
+ 	push	%eax				/* fake ret addr */
+ 	movl	$LINUX_SYS_linux_rt_sigreturn,%eax   /* linux_rt_sigreturn() */
+ 	int	$0x80				/* enter kernel with args */
+Index: sys/compat/ndis/winx32_wrap.S
+===================================================================
+--- sys/compat/ndis/winx32_wrap.S.orig
++++ sys/compat/ndis/winx32_wrap.S
+@@ -369,7 +369,7 @@
+ 	ret
+ 
+ ENTRY(x86_setfs)
+-	movl	4(%esp),%fs
++	movw	4(%esp),%fs
+ 	ret
+ 
+ ENTRY(x86_gettid)
+Index: sys/amd64/amd64/cpu_switch.S
+===================================================================
+--- sys/amd64/amd64/cpu_switch.S.orig
++++ sys/amd64/amd64/cpu_switch.S
+@@ -110,7 +110,7 @@
+ 	jz	1f				/* no, skip over */
+ 
+ 	/* Save userland %gs */
+-	movl	%gs,PCB_GS(%r8)
++	movw	%gs,PCB_GS(%r8)
+ 	movq	PCB_GS32P(%r8),%rax
+ 	movq	(%rax),%rax
+ 	movq	%rax,PCB_GS32SD(%r8)
+@@ -220,7 +220,7 @@
+ 	movq	%rbx,(%rax)
+ 	movl	$MSR_GSBASE,%ecx
+ 	rdmsr
+-	movl	PCB_GS(%r8),%gs
++	movw	PCB_GS(%r8),%gs
+ 	wrmsr
+ 
+ 1:
+Index: sys/amd64/ia32/ia32_signal.c
+===================================================================
+--- sys/amd64/ia32/ia32_signal.c.orig
++++ sys/amd64/ia32/ia32_signal.c
+@@ -328,8 +328,8 @@
+ 	sf.sf_uc.uc_mcontext.mc_onstack = (oonstack) ? 1 : 0;
+ 	sf.sf_uc.uc_mcontext.mc_gs = rgs();
+ 	sf.sf_uc.uc_mcontext.mc_fs = rfs();
+-	__asm __volatile("movl %%es,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_es));
+-	__asm __volatile("movl %%ds,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_ds));
++	__asm __volatile("mov %%es,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_es));
++	__asm __volatile("mov %%ds,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_ds));
+ 	sf.sf_uc.uc_mcontext.mc_edi = regs->tf_rdi;
+ 	sf.sf_uc.uc_mcontext.mc_esi = regs->tf_rsi;
+ 	sf.sf_uc.uc_mcontext.mc_ebp = regs->tf_rbp;
+@@ -443,8 +443,8 @@
+ 	sf.sf_uc.uc_mcontext.mc_onstack = (oonstack) ? 1 : 0;
+ 	sf.sf_uc.uc_mcontext.mc_gs = rgs();
+ 	sf.sf_uc.uc_mcontext.mc_fs = rfs();
+-	__asm __volatile("movl %%es,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_es));
+-	__asm __volatile("movl %%ds,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_ds));
++	__asm __volatile("mov %%es,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_es));
++	__asm __volatile("mov %%ds,%0" : "=rm" (sf.sf_uc.uc_mcontext.mc_ds));
+ 	sf.sf_uc.uc_mcontext.mc_edi = regs->tf_rdi;
+ 	sf.sf_uc.uc_mcontext.mc_esi = regs->tf_rsi;
+ 	sf.sf_uc.uc_mcontext.mc_ebp = regs->tf_rbp;
+Index: sys/amd64/include/cpufunc.h
+===================================================================
+--- sys/amd64/include/cpufunc.h.orig
++++ sys/amd64/include/cpufunc.h
+@@ -482,7 +482,7 @@
+ rfs(void)
+ {
+ 	u_int sel;
+-	__asm __volatile("movl %%fs,%0" : "=rm" (sel));
++	__asm __volatile("mov %%fs,%0" : "=rm" (sel));
+ 	return (sel);
+ }
+ 
+@@ -490,7 +490,7 @@
+ rgs(void)
+ {
+ 	u_int sel;
+-	__asm __volatile("movl %%gs,%0" : "=rm" (sel));
++	__asm __volatile("mov %%gs,%0" : "=rm" (sel));
+ 	return (sel);
+ }
+ 
+@@ -498,20 +498,20 @@
+ rss(void)
+ {
+ 	u_int sel;
+-	__asm __volatile("movl %%ss,%0" : "=rm" (sel));
++	__asm __volatile("mov %%ss,%0" : "=rm" (sel));
+ 	return (sel);
+ }
+ 
+ static __inline void
+ load_ds(u_int sel)
+ {
+-	__asm __volatile("movl %0,%%ds" : : "rm" (sel));
++	__asm __volatile("mov %0,%%ds" : : "rm" (sel));
+ }
+ 
+ static __inline void
+ load_es(u_int sel)
+ {
+-	__asm __volatile("movl %0,%%es" : : "rm" (sel));
++	__asm __volatile("mov %0,%%es" : : "rm" (sel));
+ }
+ 
+ #ifdef _KERNEL
+@@ -526,7 +526,7 @@
+ 
+ 	/* Preserve the fsbase value across the selector load */
+ 	fsbase = MSR_FSBASE;
+-        __asm __volatile("rdmsr; movl %0,%%fs; wrmsr"
++        __asm __volatile("rdmsr; mov %0,%%fs; wrmsr"
+             : : "rm" (sel), "c" (fsbase) : "eax", "edx");
+ }
+ 
+@@ -544,7 +544,7 @@
+ 	 * being trashed happens to be the kernel gsbase at the time.
+ 	 */
+ 	gsbase = MSR_GSBASE;
+-        __asm __volatile("pushfq; cli; rdmsr; movl %0,%%gs; wrmsr; popfq"
++        __asm __volatile("pushfq; cli; rdmsr; mov %0,%%gs; wrmsr; popfq"
+             : : "rm" (sel), "c" (gsbase) : "eax", "edx");
+ }
+ #else
+@@ -552,13 +552,13 @@
+ static __inline void
+ load_fs(u_int sel)
+ {
+-	__asm __volatile("movl %0,%%fs" : : "rm" (sel));
++	__asm __volatile("mov %0,%%fs" : : "rm" (sel));
+ }
+ 
+ static __inline void
+ load_gs(u_int sel)
+ {
+-	__asm __volatile("movl %0,%%gs" : : "rm" (sel));
++	__asm __volatile("mov %0,%%gs" : : "rm" (sel));
+ }
+ #endif
+ 
+Index: sys/amd64/linux32/linux32_sysvec.c
+===================================================================
+--- sys/amd64/linux32/linux32_sysvec.c.orig
++++ sys/amd64/linux32/linux32_sysvec.c
+@@ -355,9 +355,9 @@
+ 	frame.sf_sc.uc_mcontext.sc_mask   = frame.sf_sc.uc_sigmask.__bits[0];
+         frame.sf_sc.uc_mcontext.sc_gs     = rgs();
+         frame.sf_sc.uc_mcontext.sc_fs     = rfs();
+-        __asm __volatile("movl %%es,%0" :
++        __asm __volatile("mov %%es,%0" :
+ 	    "=rm" (frame.sf_sc.uc_mcontext.sc_es));
+-        __asm __volatile("movl %%ds,%0" :
++        __asm __volatile("mov %%ds,%0" :
+ 	    "=rm" (frame.sf_sc.uc_mcontext.sc_ds));
+ 	frame.sf_sc.uc_mcontext.sc_edi    = regs->tf_rdi;
+ 	frame.sf_sc.uc_mcontext.sc_esi    = regs->tf_rsi;
+@@ -489,8 +489,8 @@
+ 	frame.sf_sc.sc_mask   = lmask.__bits[0];
+         frame.sf_sc.sc_gs     = rgs();
+         frame.sf_sc.sc_fs     = rfs();
+-        __asm __volatile("movl %%es,%0" : "=rm" (frame.sf_sc.sc_es));
+-        __asm __volatile("movl %%ds,%0" : "=rm" (frame.sf_sc.sc_ds));
++        __asm __volatile("mov %%es,%0" : "=rm" (frame.sf_sc.sc_es));
++        __asm __volatile("mov %%ds,%0" : "=rm" (frame.sf_sc.sc_ds));
+ 	frame.sf_sc.sc_edi    = regs->tf_rdi;
+ 	frame.sf_sc.sc_esi    = regs->tf_rsi;
+ 	frame.sf_sc.sc_ebp    = regs->tf_rbp;
+Index: sys/amd64/ia32/ia32_sigtramp.S
+===================================================================
+--- sys/amd64/ia32/ia32_sigtramp.S.orig
++++ sys/amd64/ia32/ia32_sigtramp.S
+@@ -45,8 +45,8 @@
+ 	calll	*IA32_SIGF_HANDLER(%esp)
+ 	leal	IA32_SIGF_UC(%esp),%eax	/* get ucontext */
+ 	pushl	%eax
+-	movl	IA32_UC_ES(%eax),%es	/* restore %es */
+-	movl	IA32_UC_DS(%eax),%ds	/* restore %ds */
++	mov	IA32_UC_ES(%eax),%es	/* restore %es */
++	mov	IA32_UC_DS(%eax),%ds	/* restore %ds */
+ 	movl	$SYS_sigreturn,%eax
+ 	pushl	%eax			/* junk to fake return addr. */
+ 	int	$0x80			/* enter kernel with args */
+@@ -60,8 +60,8 @@
+ 	calll	*IA32_SIGF_HANDLER(%esp)
+ 	leal	IA32_SIGF_UC4(%esp),%eax/* get ucontext */
+ 	pushl	%eax
+-	movl	IA32_UC4_ES(%eax),%es	/* restore %es */
+-	movl	IA32_UC4_DS(%eax),%ds	/* restore %ds */
++	mov	IA32_UC4_ES(%eax),%es	/* restore %es */
++	mov	IA32_UC4_DS(%eax),%ds	/* restore %ds */
+ 	movl	$344,%eax		/* 4.x SYS_sigreturn */
+ 	pushl	%eax			/* junk to fake return addr. */
+ 	int	$0x80			/* enter kernel with args */
+Index: sys/amd64/linux32/linux32_locore.s
+===================================================================
+--- sys/amd64/linux32/linux32_locore.s.orig
++++ sys/amd64/linux32/linux32_locore.s
+@@ -11,8 +11,8 @@
+ NON_GPROF_ENTRY(linux_sigcode)
+ 	call	*LINUX_SIGF_HANDLER(%esp)
+ 	leal	LINUX_SIGF_SC(%esp),%ebx	/* linux scp */
+-	movl	LINUX_SC_ES(%ebx),%es
+-	movl	LINUX_SC_DS(%ebx),%ds
++	mov	LINUX_SC_ES(%ebx),%es
++	mov	LINUX_SC_DS(%ebx),%ds
+ 	movl	%esp, %ebx			/* pass sigframe */
+ 	push	%eax				/* fake ret addr */
+ 	movl	$LINUX_SYS_linux_sigreturn,%eax	/* linux_sigreturn() */
+@@ -23,8 +23,8 @@
+ linux_rt_sigcode:
+ 	call	*LINUX_RT_SIGF_HANDLER(%esp)
+ 	leal	LINUX_RT_SIGF_UC(%esp),%ebx	/* linux ucp */
+-	movl	LINUX_SC_ES(%ebx),%es
+-	movl	LINUX_SC_DS(%ebx),%ds
++	mov	LINUX_SC_ES(%ebx),%es
++	mov	LINUX_SC_DS(%ebx),%ds
+ 	push	%eax				/* fake ret addr */
+ 	movl	$LINUX_SYS_linux_rt_sigreturn,%eax   /* linux_rt_sigreturn() */
+ 	int	$0x80				/* enter kernel with args */
--- kfreebsd-7-7.0.orig/debian/patches/013_ip_packed.diff
+++ kfreebsd-7-7.0/debian/patches/013_ip_packed.diff
@@ -0,0 +1,13 @@
+Index: sys/netinet/ip.h
+===================================================================
+--- sys/netinet/ip.h.orig
++++ sys/netinet/ip.h
+@@ -67,7 +67,7 @@
+ 	u_char	ip_p;			/* protocol */
+ 	u_short	ip_sum;			/* checksum */
+ 	struct	in_addr ip_src,ip_dst;	/* source and dest address */
+-} __packed __aligned(4);
++}  __attribute__((__packed__)) __attribute__((__aligned__(4)));
+ 
+ #ifdef CTASSERT
+ CTASSERT(sizeof (struct ip) == 20);
--- kfreebsd-7-7.0.orig/debian/patches/906_grow_sysv_ipc_limits.diff
+++ kfreebsd-7-7.0/debian/patches/906_grow_sysv_ipc_limits.diff
@@ -0,0 +1,62 @@
+
+Status: Rejected in upstream (kern/77353)
+
+postgresql documentation encourages to grow SysV IPC limits on *BSD systems
+(which obviously applies to GNU/k*BSD ones too):
+
+<quote>
+    The options SYSVSHM and SYSVSEM need to be enabled when the kernel is compiled. (They are by default.) The maximum size of shared memory is determined by the option SHMMAXPGS (in pages). The following shows an example of how to set the various parameters:
+
+options         SYSVSHM
+options         SHMMAXPGS=4096
+options         SHMSEG=256
+
+options         SYSVSEM
+options         SEMMNI=256
+options         SEMMNS=512
+options         SEMMNU=256
+options         SEMMAP=256
+
+    (On NetBSD and OpenBSD the key word is actually option singular.)
+
+    You might also want to configure your kernel to lock shared memory into RAM and prevent it from being paged out to swap. Use the sysctl setting kern.ipc.shm_use_phys. 
+</quote>
+
+Index: sys/i386/conf/GENERIC
+===================================================================
+--- sys/i386/conf/GENERIC.orig
++++ sys/i386/conf/GENERIC
+@@ -55,8 +55,14 @@
+ options 	SCSI_DELAY=5000		# Delay (in ms) before probing SCSI
+ options 	KTRACE			# ktrace(1) support
+ options 	SYSVSHM			# SYSV-style shared memory
++options         SHMMAXPGS=4096
++options         SHMSEG=256
+ options 	SYSVMSG			# SYSV-style message queues
+ options 	SYSVSEM			# SYSV-style semaphores
++options         SEMMNI=256
++options         SEMMNS=512
++options         SEMMNU=256
++options         SEMMAP=256
+ options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
+ options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
+ options 	ADAPTIVE_GIANT		# Giant mutex is adaptive.
+Index: sys/amd64/conf/GENERIC
+===================================================================
+--- sys/amd64/conf/GENERIC.orig
++++ sys/amd64/conf/GENERIC
+@@ -55,8 +55,14 @@
+ options 	SCSI_DELAY=5000		# Delay (in ms) before probing SCSI
+ options 	KTRACE			# ktrace(1) support
+ options 	SYSVSHM			# SYSV-style shared memory
++options         SHMMAXPGS=4096
++options         SHMSEG=256
+ options 	SYSVMSG			# SYSV-style message queues
+ options 	SYSVSEM			# SYSV-style semaphores
++options         SEMMNI=256
++options         SEMMNS=512
++options         SEMMNU=256
++options         SEMMAP=256
+ options 	_KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
+ options 	KBD_INSTALL_CDEV	# install a CDEV entry in /dev
+ options 	ADAPTIVE_GIANT		# Giant mutex is adaptive.
--- kfreebsd-7-7.0.orig/debian/patches/999_config.diff
+++ kfreebsd-7-7.0/debian/patches/999_config.diff
@@ -0,0 +1,235 @@
+Index: sys/amd64/conf/GENERIC
+===================================================================
+--- sys/amd64/conf/GENERIC.orig
++++ sys/amd64/conf/GENERIC
+@@ -18,13 +18,8 @@
+ #
+ # $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.484.2.1 2007/10/11 06:20:26 kensmith Exp $
+ 
+-cpu		HAMMER
+-ident		GENERIC
+-
+ # To statically compile in device wiring instead of /boot/device.hints
+-#hints		"GENERIC.hints"		# Default places to look for devices.
+-
+-makeoptions	DEBUG=-g		# Build kernel with gdb(1) debug symbols
++hints		"GENERIC.hints"		# Default places to look for devices.
+ 
+ options 	SCHED_4BSD		# 4BSD scheduler
+ options 	PREEMPTION		# Enable kernel thread preemption
+@@ -44,6 +39,8 @@
+ options 	MSDOSFS			# MSDOS Filesystem
+ options 	CD9660			# ISO 9660 Filesystem
+ options 	PROCFS			# Process filesystem (requires PSEUDOFS)
++options 	LINPROCFS
++options 	COMPAT_LINUX32
+ options 	PSEUDOFS		# Pseudo-filesystem framework
+ options 	GEOM_PART_GPT		# GUID Partition Tables.
+ options 	GEOM_LABEL		# Provides labelization
+@@ -52,7 +49,7 @@
+ options 	COMPAT_FREEBSD4		# Compatible with FreeBSD4
+ options 	COMPAT_FREEBSD5		# Compatible with FreeBSD5
+ options 	COMPAT_FREEBSD6		# Compatible with FreeBSD6
+-options 	SCSI_DELAY=5000		# Delay (in ms) before probing SCSI
++options 	SCSI_DELAY=2000		# Delay (in ms) before probing SCSI
+ options 	KTRACE			# ktrace(1) support
+ options 	SYSVSHM			# SYSV-style shared memory
+ options         SHMMAXPGS=4096
+@@ -79,9 +76,6 @@
+ device		acpi
+ device		pci
+ 
+-# Floppy drives
+-device		fdc
+-
+ # ATA and ATAPI devices
+ device		ata
+ device		atadisk		# ATA disk drives
+@@ -89,6 +83,8 @@
+ device		atapicd		# ATAPI CDROM drives
+ device		atapifd		# ATAPI floppy drives
+ device		atapist		# ATAPI tape drives
++device		atapicam	# emulate ATAPI devices as SCSI via CAM
++				# needs CAM to be present (scbus && pass)
+ options 	ATA_STATIC_ID	# Static device numbering
+ 
+ # SCSI Controllers
+@@ -171,10 +167,6 @@
+ # Parallel port
+ device		ppc
+ device		ppbus		# Parallel port bus (required)
+-device		lpt		# Printer
+-device		plip		# TCP/IP over parallel
+-device		ppi		# Parallel port interface device
+-#device		vpo		# Requires scbus and da
+ 
+ # If you've got a "dumb" serial or parallel PCI card that is
+ # supported by the puc(4) glue driver, uncomment the following
+@@ -236,9 +228,6 @@
+ device		wlan_scan_ap	# 802.11 AP mode scanning
+ device		wlan_scan_sta	# 802.11 STA mode scanning
+ device		an		# Aironet 4500/4800 802.11 wireless NICs.
+-device		ath		# Atheros pci/cardbus NIC's
+-device		ath_hal		# Atheros HAL (Hardware Access Layer)
+-device		ath_rate_sample	# SampleRate tx rate control for ath
+ device		awi		# BayStack 660 and others
+ device		ral		# Ralink Technology RT2500 wireless NICs.
+ device		wi		# WaveLAN/Intersil/Symbol 802.11 wireless NICs.
+@@ -247,13 +236,8 @@
+ device		loop		# Network loopback
+ device		random		# Entropy device
+ device		ether		# Ethernet support
+-device		sl		# Kernel SLIP
+-device		ppp		# Kernel PPP
+-device		tun		# Packet tunnel.
+ device		pty		# Pseudo-ttys (telnet etc)
+ device		md		# Memory "disks"
+-device		gif		# IPv6 and IPv4 tunneling
+-device		faith		# IPv6-to-IPv4 relaying (translation)
+ device		firmware	# firmware assist module
+ 
+ # The `bpf' device enables the Berkeley Packet Filter.
+@@ -270,12 +254,8 @@
+ device		ugen		# Generic
+ device		uhid		# "Human Interface Devices"
+ device		ukbd		# Keyboard
+-device		ulpt		# Printer
+ device		umass		# Disks/Mass storage - Requires scbus and da
+-device		ums		# Mouse
+ device		ural		# Ralink Technology RT2500USB wireless NICs
+-device		urio		# Diamond Rio 500 MP3 player
+-device		uscanner	# Scanners
+ # USB Ethernet, requires miibus
+ device		aue		# ADMtek USB Ethernet
+ device		axe		# ASIX Electronics USB Ethernet
+@@ -291,3 +271,11 @@
+ device		fwip		# IP over FireWire (RFC 2734,3146)
+ device		dcons		# Dumb console driver
+ device		dcons_crom	# Configuration ROM for dcons
++
++# Alternate queueing
++options		ALTQ
++options		ALTQ_CBQ	# Class Bases Queuing (CBQ)
++options		ALTQ_RED	# Random Early Detection (RED)
++options		ALTQ_RIO	# RED In/Out
++options		ALTQ_HFSC	# Hierarchical Packet Scheduler (HFSC)
++options		ALTQ_PRIQ	# Priority Queuing (PRIQ)
+Index: sys/i386/conf/GENERIC
+===================================================================
+--- sys/i386/conf/GENERIC.orig
++++ sys/i386/conf/GENERIC
+@@ -18,15 +18,8 @@
+ #
+ # $FreeBSD: src/sys/i386/conf/GENERIC,v 1.474.2.1 2007/10/11 06:20:26 kensmith Exp $
+ 
+-cpu		I486_CPU
+-cpu		I586_CPU
+-cpu		I686_CPU
+-ident		GENERIC
+-
+ # To statically compile in device wiring instead of /boot/device.hints
+-#hints		"GENERIC.hints"		# Default places to look for devices.
+-
+-makeoptions	DEBUG=-g		# Build kernel with gdb(1) debug symbols
++hints		"GENERIC.hints"		# Default places to look for devices.
+ 
+ options 	SCHED_4BSD		# 4BSD scheduler
+ options 	PREEMPTION		# Enable kernel thread preemption
+@@ -45,6 +38,8 @@
+ options 	MSDOSFS			# MSDOS Filesystem
+ options 	CD9660			# ISO 9660 Filesystem
+ options 	PROCFS			# Process filesystem (requires PSEUDOFS)
++options		LINPROCFS
++options		COMPAT_LINUX		# Needed by LINPROCFS
+ options 	PSEUDOFS		# Pseudo-filesystem framework
+ options 	GEOM_PART_GPT		# GUID Partition Tables.
+ options 	GEOM_LABEL		# Provides labelization
+@@ -52,7 +47,7 @@
+ options 	COMPAT_FREEBSD4		# Compatible with FreeBSD4
+ options 	COMPAT_FREEBSD5		# Compatible with FreeBSD5
+ options 	COMPAT_FREEBSD6		# Compatible with FreeBSD6
+-options 	SCSI_DELAY=5000		# Delay (in ms) before probing SCSI
++options 	SCSI_DELAY=2000		# Delay (in ms) before probing SCSI
+ options 	KTRACE			# ktrace(1) support
+ options 	SYSVSHM			# SYSV-style shared memory
+ options         SHMMAXPGS=4096
+@@ -80,9 +75,6 @@
+ device		eisa
+ device		pci
+ 
+-# Floppy drives
+-device		fdc
+-
+ # ATA and ATAPI devices
+ device		ata
+ device		atadisk		# ATA disk drives
+@@ -90,6 +82,8 @@
+ device		atapicd		# ATAPI CDROM drives
+ device		atapifd		# ATAPI floppy drives
+ device		atapist		# ATAPI tape drives
++device		atapicam	# emulate ATAPI devices as SCSI via CAM
++				# needs CAM to be present (scbus && pass)
+ options 	ATA_STATIC_ID	# Static device numbering
+ 
+ # SCSI Controllers
+@@ -182,10 +176,6 @@
+ # Parallel port
+ device		ppc
+ device		ppbus		# Parallel port bus (required)
+-device		lpt		# Printer
+-device		plip		# TCP/IP over parallel
+-device		ppi		# Parallel port interface device
+-#device		vpo		# Requires scbus and da
+ 
+ # If you've got a "dumb" serial or parallel PCI card that is
+ # supported by the puc(4) glue driver, uncomment the following
+@@ -249,9 +239,6 @@
+ device		wlan_scan_ap	# 802.11 AP mode scanning
+ device		wlan_scan_sta	# 802.11 STA mode scanning
+ device		an		# Aironet 4500/4800 802.11 wireless NICs.
+-device		ath		# Atheros pci/cardbus NIC's
+-device		ath_hal		# Atheros HAL (Hardware Access Layer)
+-device		ath_rate_sample	# SampleRate tx rate control for ath
+ device		awi		# BayStack 660 and others
+ device		ral		# Ralink Technology RT2500 wireless NICs.
+ device		wi		# WaveLAN/Intersil/Symbol 802.11 wireless NICs.
+@@ -261,13 +248,8 @@
+ device		loop		# Network loopback
+ device		random		# Entropy device
+ device		ether		# Ethernet support
+-device		sl		# Kernel SLIP
+-device		ppp		# Kernel PPP
+-device		tun		# Packet tunnel.
+ device		pty		# Pseudo-ttys (telnet etc)
+ device		md		# Memory "disks"
+-device		gif		# IPv6 and IPv4 tunneling
+-device		faith		# IPv6-to-IPv4 relaying (translation)
+ device		firmware	# firmware assist module
+ 
+ # The `bpf' device enables the Berkeley Packet Filter.
+@@ -284,13 +266,9 @@
+ device		ugen		# Generic
+ device		uhid		# "Human Interface Devices"
+ device		ukbd		# Keyboard
+-device		ulpt		# Printer
+ device		umass		# Disks/Mass storage - Requires scbus and da
+-device		ums		# Mouse
+ device		ural		# Ralink Technology RT2500USB wireless NICs
+ device		rum		# Ralink Technology RT2501USB wireless NICs
+-device		urio		# Diamond Rio 500 MP3 player
+-device		uscanner	# Scanners
+ # USB Ethernet, requires miibus
+ device		aue		# ADMtek USB Ethernet
+ device		axe		# ASIX Electronics USB Ethernet
+@@ -306,3 +284,11 @@
+ device		fwip		# IP over FireWire (RFC 2734,3146)
+ device		dcons		# Dumb console driver
+ device		dcons_crom	# Configuration ROM for dcons
++
++# Alternate queueing
++options		ALTQ
++options		ALTQ_CBQ	# Class Bases Queuing (CBQ)
++options		ALTQ_RED	# Random Early Detection (RED)
++options		ALTQ_RIO	# RED In/Out
++options		ALTQ_HFSC	# Hierarchical Packet Scheduler (HFSC)
++options		ALTQ_PRIQ	# Priority Queuing (PRIQ)
--- kfreebsd-7-7.0.orig/debian/patches/911_no_werror.diff
+++ kfreebsd-7-7.0/debian/patches/911_no_werror.diff
@@ -0,0 +1,25 @@
+
+
+Index: sys/modules/hwpmc/Makefile
+===================================================================
+--- sys/modules/hwpmc/Makefile.orig
++++ sys/modules/hwpmc/Makefile
+@@ -9,6 +9,7 @@
+ SRCS=	hwpmc_mod.c hwpmc_logging.c vnode_if.h
+ 
+ WARNS?=	2
++NO_WERROR?= 1
+ 
+ .if ${MACHINE_ARCH} == "amd64"
+ SRCS+=	hwpmc_amd.c hwpmc_piv.c hwpmc_x86.c
+Index: sys/modules/geom/geom_eli/Makefile
+===================================================================
+--- sys/modules/geom/geom_eli/Makefile.orig
++++ sys/modules/geom/geom_eli/Makefile
+@@ -12,5 +12,6 @@
+ SRCS+=	pkcs5v2.c
+ SRCS+=	vnode_if.h
+ WARNS?=	2
++NO_WERROR?= 1
+ 
+ .include <bsd.kmod.mk>
--- kfreebsd-7-7.0.orig/debian/patches/series
+++ kfreebsd-7-7.0/debian/patches/series
@@ -0,0 +1,29 @@
+000_tcp.diff -p0
+000_amd64.diff -p1
+000_icmp6.diff -p1
+000_nmount.diff -p1
+000_nd6.patch -p1
+001_misc.diff -p0
+003_glibc_dev_aicasm.diff -p0
+004_xargs.diff -p0
+005_binutils.diff -p0
+007_clone_signals.diff -p0
+008_config.diff -p0
+009_disable_duped_modules.diff -p0
+010_ET_DYN.diff -p0
+013_ip_packed.diff -p0
+017_oss_compat.diff -p0
+020_linker.diff -p0
+030_abi_cld.diff -p0
+101_subsecond_timestamp.diff -p0
+902_version.diff -p0
+903_disable_non-free_drivers.diff -p0
+904_dev_full.diff -p0
+906_grow_sysv_ipc_limits.diff -p0
+907_cpu_class.diff -p0
+908_linprocfs_is_not_proc.diff -p0
+910_GENERIC_hints.diff -p0
+911_no_werror.diff -p0
+912_binutils.diff -p0
+913_uudecode.diff -p0
+999_config.diff -p0
--- kfreebsd-7-7.0.orig/debian/arch/amd64/em64t-p4.config
+++ kfreebsd-7-7.0/debian/arch/amd64/em64t-p4.config
@@ -0,0 +1,6 @@
+# Kernel for Debian GNU/kFreeBSD on Intel em64t P4 machines
+
+include		GENERIC
+cpu		HAMMER
+makeoptions	COPTFLAGS="-O2 -frename-registers -pipe -march=nocona"
+ident		Debian-em64t-p4
--- kfreebsd-7-7.0.orig/debian/arch/amd64/amd64-generic.config
+++ kfreebsd-7-7.0/debian/arch/amd64/amd64-generic.config
@@ -0,0 +1,5 @@
+# Kernel for Debian GNU/kFreeBSD on all x86-64 machines
+
+include		GENERIC
+cpu		HAMMER
+ident		Debian-amd64-generic
--- kfreebsd-7-7.0.orig/debian/arch/amd64/amd64-k8.config
+++ kfreebsd-7-7.0/debian/arch/amd64/amd64-k8.config
@@ -0,0 +1,6 @@
+# Kernel for Debian GNU/kFreeBSD on AMD64 K8 machines
+
+include		GENERIC
+cpu		HAMMER
+makeoptions	COPTFLAGS="-O2 -frename-registers -pipe -march=k8"
+ident		Debian-amd64-k8
--- kfreebsd-7-7.0.orig/debian/arch/amd64/em64t-p4-smp.config
+++ kfreebsd-7-7.0/debian/arch/amd64/em64t-p4-smp.config
@@ -0,0 +1,9 @@
+# Kernel for Debian GNU/kFreeBSD on Intel em64t P4 SMP machines
+
+include		GENERIC
+cpu		HAMMER
+makeoptions	COPTFLAGS="-O2 -frename-registers -pipe -march=nocona"
+ident		Debian-em64t-p4-SMP
+
+options		SMP		# Symmetric MultiProcessor Kernel
+options		ALTQ_NOPCC	# Required for SMP build
--- kfreebsd-7-7.0.orig/debian/arch/amd64/amd64-k8-smp.config
+++ kfreebsd-7-7.0/debian/arch/amd64/amd64-k8-smp.config
@@ -0,0 +1,9 @@
+# Kernel for Debian GNU/kFreeBSD on AMD64 K8 SMP machines
+
+include		GENERIC
+cpu		HAMMER
+makeoptions	COPTFLAGS="-O2 -frename-registers -pipe -march=k8"
+ident		Debian-amd64-k8-SMP
+
+options		SMP		# Symmetric MultiProcessor Kernel
+options		ALTQ_NOPCC	# Required for SMP build
--- kfreebsd-7-7.0.orig/debian/arch/i386/586-smp.config
+++ kfreebsd-7-7.0/debian/arch/i386/586-smp.config
@@ -0,0 +1,10 @@
+# Kernel for Debian GNU/kFreeBSD on an i586 SMP machine
+
+include		GENERIC
+cpu		I586_CPU
+cpu		I686_CPU
+makeoptions	COPTFLAGS="-Os -frename-registers -pipe -march=i586"
+ident		Debian-i586-SMP
+
+options		SMP		# Symmetric MultiProcessor Kernel
+options		ALTQ_NOPCC	# Required for SMP build
--- kfreebsd-7-7.0.orig/debian/arch/i386/486.config
+++ kfreebsd-7-7.0/debian/arch/i386/486.config
@@ -0,0 +1,13 @@
+# Kernel for Debian GNU/kFreeBSD on an i486 machine
+
+include		GENERIC
+cpu		I486_CPU
+cpu		I586_CPU
+cpu		I686_CPU
+makeoptions	COPTFLAGS="-Os -frename-registers -pipe -march=i486"
+ident		Debian-i486
+
+# Xbox support
+options 	XBOX
+device		xboxfb
+device		fb
--- kfreebsd-7-7.0.orig/debian/arch/i386/686.config
+++ kfreebsd-7-7.0/debian/arch/i386/686.config
@@ -0,0 +1,11 @@
+# Kernel for Debian GNU/kFreeBSD on an i686 machine
+
+include		GENERIC
+cpu		I686_CPU
+makeoptions	COPTFLAGS="-O2 -frename-registers -pipe -march=i686"
+ident		Debian-i686
+
+# Xbox support
+options 	XBOX
+device		xboxfb
+device		fb
--- kfreebsd-7-7.0.orig/debian/arch/i386/686.defines
+++ kfreebsd-7-7.0/debian/arch/i386/686.defines
@@ -0,0 +1 @@
+Recommends: libc0.1-i686
--- kfreebsd-7-7.0.orig/debian/arch/i386/586.config
+++ kfreebsd-7-7.0/debian/arch/i386/586.config
@@ -0,0 +1,7 @@
+# Kernel for Debian GNU/kFreeBSD on an i586 machine
+
+include		GENERIC
+cpu		I586_CPU
+cpu		I686_CPU
+makeoptions	COPTFLAGS="-Os -frename-registers -pipe -march=i586"
+ident		Debian-i586
--- kfreebsd-7-7.0.orig/debian/arch/i386/686-smp.defines
+++ kfreebsd-7-7.0/debian/arch/i386/686-smp.defines
@@ -0,0 +1 @@
+Recommends: libc0.1-i686
--- kfreebsd-7-7.0.orig/debian/arch/i386/686-smp.config
+++ kfreebsd-7-7.0/debian/arch/i386/686-smp.config
@@ -0,0 +1,9 @@
+# Kernel for Debian GNU/kFreeBSD on an i686 SMP machine
+
+include		GENERIC
+cpu		I686_CPU
+makeoptions	COPTFLAGS="-O2 -frename-registers -pipe -march=i686"
+ident		Debian-i686-SMP
+
+options		SMP		# Symmetric MultiProcessor Kernel
+options		ALTQ_NOPCC	# Required for SMP build
