]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Merge tag 'upstream/0.6.5.9'
authorAron Xu <aron@debian.org>
Mon, 6 Feb 2017 07:49:57 +0000 (15:49 +0800)
committerAron Xu <aron@debian.org>
Mon, 6 Feb 2017 07:49:57 +0000 (15:49 +0800)
Upstream version 0.6.5.9

33 files changed:
debian/README.Source [new file with mode: 0644]
debian/changelog [new file with mode: 0644]
debian/compat [new file with mode: 0644]
debian/control [new file with mode: 0644]
debian/control.in [new file with mode: 0644]
debian/control.modules.in [new file with mode: 0644]
debian/copyright [new file with mode: 0644]
debian/dkms [new file with mode: 0644]
debian/gbp.conf [new file with mode: 0644]
debian/patches/0001-Fix-crgetgroups-out-of-bound-and-misc-cred-fix.patch [new file with mode: 0644]
debian/patches/0002-Fix-splat-cred.c-cred-usage.patch [new file with mode: 0644]
debian/patches/0003-Linux-4.9-compat-group_info-changes.patch [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]
debian/rules [new file with mode: 0755]
debian/source/format [new file with mode: 0644]
debian/source/options [new file with mode: 0644]
debian/spl-dkms.install [new file with mode: 0644]
debian/spl-dkms.lintian-overrides [new file with mode: 0644]
debian/spl-modules-_KVERS_-di.dirs.in [new file with mode: 0644]
debian/spl-modules-_KVERS_-di.install.in [new file with mode: 0644]
debian/spl-modules-_KVERS_.dirs.in [new file with mode: 0644]
debian/spl-modules-_KVERS_.install.in [new file with mode: 0644]
debian/spl-modules-_KVERS_.postinst.in [new file with mode: 0644]
debian/spl-modules-_KVERS_.postrm.in [new file with mode: 0644]
debian/spl.install [new file with mode: 0644]
debian/spl.lintian-overrides [new file with mode: 0644]
debian/spl.postinst [new file with mode: 0644]
debian/spl.postrm [new file with mode: 0644]
debian/spl.preinst [new file with mode: 0644]
debian/tests/check.sh [new file with mode: 0644]
debian/tests/control [new file with mode: 0644]
debian/tests/dkms-test [new file with mode: 0755]
debian/watch [new file with mode: 0644]

diff --git a/debian/README.Source b/debian/README.Source
new file mode 100644 (file)
index 0000000..295f5e8
--- /dev/null
@@ -0,0 +1,23 @@
+spl-linux for Debian
+
+Using DKMS is the recommended way of installing this kernel
+module, however if you do have the need of building deb/udeb
+packages containing the binary kernel module, here is the way.
+Be careful when proceed with this way, as your attention is 
+required when kernel ABI get changed on target system that this
+module needs to be rebuilt and it needs to replace the originally
+installed package with this newly built one on target system.
+
+You may first install all required build dependency on a machine
+that runs the very same kernel as on your target system, then
+execute following command at the top level directory of the
+decompressed debian source package. Do not install the generated 
+package with kernels that have different configuration, which is
+not supported and likely to break things.
+
+  * deb packages:
+    fakeroot debian/rules override_dh_binary-modules
+  * udeb packages:
+    fakeroot debian/rules override_dh_binary-modules-udeb
+
+ -- Aron Xu <aron@debian.org>  Sun, 14 July 2013 04:00:12 +0800
diff --git a/debian/changelog b/debian/changelog
new file mode 100644 (file)
index 0000000..c6ced62
--- /dev/null
@@ -0,0 +1,120 @@
+spl-linux (0.6.5.8-3) unstable; urgency=medium
+
+  * Fix Linux 4.9 compatibility (Closes: #851352)
+    Thanks to Fabian Grünbichler!
+
+ -- Aron Xu <aron@debian.org>  Tue, 17 Jan 2017 20:57:13 +0800
+
+spl-linux (0.6.5.8-2) unstable; urgency=medium
+
+  [ Petter Reinholdtsen ]
+  * Added d/gbp.conf to enforce the use of pristine-tar.
+  * Added extra autopkgtest script check.sh from the Ubuntu package.
+
+  [ Aron Xu ]
+  * Make use of dh-autoreconf
+  * Deal with /etc/hostid in postinst of spl package
+  * Add lintian-overrides: extra-license-file
+  * Simplify rules by merging Ubuntu one
+  * Handle the case /etc/hostid is being wrongly marked as conffile
+  * Install man pages for spl
+  * Move command-with-path-in-maintainer-script override to spl
+
+ -- Aron Xu <aron@debian.org>  Wed, 28 Sep 2016 05:02:06 +0800
+
+spl-linux (0.6.5.8-1) unstable; urgency=medium
+
+  [ Petter Reinholdtsen ]
+  * Fix invalid command in dkms (Closes: #836578)
+
+  [ Zhou Mo ]
+  * control: bump standards version to 3.9.8
+
+  [ Aron Xu ]
+  * Imported Upstream version 0.6.5.8 (Closes: #835992)
+  * rules: allow parallel building
+
+ -- Aron Xu <aron@debian.org>  Sun, 18 Sep 2016 01:06:04 +0800
+
+spl-linux (0.6.5.7-1) unstable; urgency=medium
+
+  * Imported Upstream version 0.6.5.7
+
+ -- Aron Xu <aron@debian.org>  Wed, 25 May 2016 12:17:05 +0800
+
+spl-linux (0.6.5.6-2) unstable; urgency=medium
+
+  * Add license names to entries missing it.
+  * Added autopkgtest using code from Ubuntu using dkms >= 2.2.0.3-3~.
+
+ -- Petter Reinholdtsen <pere@hungry.com>  Thu, 28 Apr 2016 20:21:29 +0800
+
+spl-linux (0.6.5.6-1) unstable; urgency=medium
+
+  * New upstream release
+
+ -- Aron Xu <aron@debian.org>  Thu, 24 Mar 2016 07:14:47 +0800
+
+spl-linux (0.6.5.5-1) unstable; urgency=medium
+
+  * New upstream release
+
+ -- Aron Xu <aron@debian.org>  Sun, 20 Mar 2016 22:50:26 +0800
+
+spl-linux (0.6.5.4-1) unstable; urgency=medium
+
+  * New upstream release
+
+ -- Aron Xu <aron@debian.org>  Sun, 10 Jan 2016 20:13:15 +0800
+
+spl-linux (0.6.5.3-1) unstable; urgency=medium
+
+  * New upstream release
+
+ -- Aron Xu <aron@debian.org>  Thu, 05 Nov 2015 21:08:25 +0800
+
+spl-linux (0.6.5.2-1) unstable; urgency=medium
+
+  * Imported Upstream version 0.6.5.2
+  * Add conflicts to splat (Closes: #769147)
+
+ -- Aron Xu <aron@debian.org>  Tue, 13 Oct 2015 15:26:33 +0100
+
+spl-linux (0.6.4.2-1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Aron Xu <aron@debian.org>  Thu, 13 Aug 2015 19:58:26 +0800
+
+spl-linux (0.6.4.1-1) experimental; urgency=medium
+
+  * New upstream release.
+
+ -- Aron Xu <aron@debian.org>  Sun, 17 May 2015 05:47:51 +0800
+
+spl-linux (0.6.2-2) experimental; urgency=low
+
+  * Add file and libc-dev to Depends of spl-dkms (Closes: #717565).
+
+ -- Aron Xu <aron@debian.org>  Sun, 25 Aug 2013 02:02:15 +0800
+
+spl-linux (0.6.2-1) experimental; urgency=low
+
+  * New upstream release.
+
+ -- Aron Xu <aron@debian.org>  Sat, 24 Aug 2013 14:30:25 +0800
+
+spl-linux (0.6.1-2) experimental; urgency=low
+
+  * Add license info for scripts/kmodtool
+  * Add linux 3.10 compatibility patch from upstream. (Closes: #717565)
+  * Add facility to build udeb and binary modules, thanks Turbo Fredriksson
+    for the work.
+
+ -- Aron Xu <aron@debian.org>  Mon, 29 Jul 2013 16:04:24 +0800
+
+spl-linux (0.6.1-1) experimental; urgency=low
+
+  * Initial Release (Closes: #686453)
+
+ -- Aron Xu <aron@debian.org>  Tue, 02 Apr 2013 01:03:05 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644 (file)
index 0000000..52c1660
--- /dev/null
@@ -0,0 +1,58 @@
+Source: spl-linux
+Section: kernel
+Priority: optional
+Maintainer: Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>
+Uploaders: Aron Xu <aron@debian.org>,
+           Carlos Alberto Lopez Perez <clopez@igalia.com>
+Build-Depends: autogen,
+               autotools-dev,
+               debhelper (>= 9),
+               dh-autoreconf,
+               dkms (>> 2.2.0.2-1~),
+               libtool
+Standards-Version: 3.9.8
+Homepage: http://www.zfsonlinux.org/
+Vcs-Git: git://anonscm.debian.org/pkg-zfsonlinux/spl.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-zfsonlinux/spl.git
+
+Package: spl-dkms
+Architecture: all
+Depends: dkms (>> 2.2.1.0), file, libc-dev, lsb-release, ${misc:Depends}
+Recommends: spl (>= ${source:Upstream-Version})
+Provides: spl-modules
+Description: Solaris Porting Layer kernel modules for Linux
+ The Solaris Porting Layer (SPL) is a Linux kernel module which provides
+ many of the Solaris kernel APIs. This shim layer makes it possible to
+ run Solaris kernel code in the Linux kernel with relatively minimal
+ modification. The Solaris Porting LAyer Tests (SPLAT) is a Linux kernel
+ module which provides a testing harness for the SPL module.
+ .
+ SPL can be particularly useful when you want to track upstream Illumos
+ (or any other OpenSolaris fork) development closely and don't want the
+ overhead of maintaining a large patch which converts Solaris primitives
+ to Linux primitives.
+ .
+ This package contains the source code for the SPL and SPLAT Linux kernel
+ modules, which can be used with DKMS, so that local kernel modules are
+ automatically built and installed every time the kernel packages are
+ upgraded.
+
+Package: spl
+Architecture: linux-any
+Conflicts: spl-dev, splat
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Recommends: spl-modules | spl-dkms
+Description: Solaris Porting Layer user-space utilities for Linux
+ The Solaris Porting Layer (SPL) is a Linux kernel module which provides
+ many of the Solaris kernel APIs. This shim layer makes it possible to
+ run Solaris kernel code in the Linux kernel with relatively minimal
+ modification. The Solaris Porting LAyer Tests (SPLAT) is a Linux kernel
+ module which provides a testing harness for the SPL module.
+ .
+ SPL can be particularly useful when you want to track upstream Illumos
+ (or any other OpenSolaris fork) development closely and don't want the
+ overhead of maintaining a large patch which converts Solaris primitives
+ to Linux primitives.
+ .
+ This package includes the user space utilities needed to test and debug
+ the SPL and SPLAT kernel modules.
diff --git a/debian/control.in b/debian/control.in
new file mode 100644 (file)
index 0000000..52c1660
--- /dev/null
@@ -0,0 +1,58 @@
+Source: spl-linux
+Section: kernel
+Priority: optional
+Maintainer: Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>
+Uploaders: Aron Xu <aron@debian.org>,
+           Carlos Alberto Lopez Perez <clopez@igalia.com>
+Build-Depends: autogen,
+               autotools-dev,
+               debhelper (>= 9),
+               dh-autoreconf,
+               dkms (>> 2.2.0.2-1~),
+               libtool
+Standards-Version: 3.9.8
+Homepage: http://www.zfsonlinux.org/
+Vcs-Git: git://anonscm.debian.org/pkg-zfsonlinux/spl.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-zfsonlinux/spl.git
+
+Package: spl-dkms
+Architecture: all
+Depends: dkms (>> 2.2.1.0), file, libc-dev, lsb-release, ${misc:Depends}
+Recommends: spl (>= ${source:Upstream-Version})
+Provides: spl-modules
+Description: Solaris Porting Layer kernel modules for Linux
+ The Solaris Porting Layer (SPL) is a Linux kernel module which provides
+ many of the Solaris kernel APIs. This shim layer makes it possible to
+ run Solaris kernel code in the Linux kernel with relatively minimal
+ modification. The Solaris Porting LAyer Tests (SPLAT) is a Linux kernel
+ module which provides a testing harness for the SPL module.
+ .
+ SPL can be particularly useful when you want to track upstream Illumos
+ (or any other OpenSolaris fork) development closely and don't want the
+ overhead of maintaining a large patch which converts Solaris primitives
+ to Linux primitives.
+ .
+ This package contains the source code for the SPL and SPLAT Linux kernel
+ modules, which can be used with DKMS, so that local kernel modules are
+ automatically built and installed every time the kernel packages are
+ upgraded.
+
+Package: spl
+Architecture: linux-any
+Conflicts: spl-dev, splat
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Recommends: spl-modules | spl-dkms
+Description: Solaris Porting Layer user-space utilities for Linux
+ The Solaris Porting Layer (SPL) is a Linux kernel module which provides
+ many of the Solaris kernel APIs. This shim layer makes it possible to
+ run Solaris kernel code in the Linux kernel with relatively minimal
+ modification. The Solaris Porting LAyer Tests (SPLAT) is a Linux kernel
+ module which provides a testing harness for the SPL module.
+ .
+ SPL can be particularly useful when you want to track upstream Illumos
+ (or any other OpenSolaris fork) development closely and don't want the
+ overhead of maintaining a large patch which converts Solaris primitives
+ to Linux primitives.
+ .
+ This package includes the user space utilities needed to test and debug
+ the SPL and SPLAT kernel modules.
diff --git a/debian/control.modules.in b/debian/control.modules.in
new file mode 100644 (file)
index 0000000..74bf093
--- /dev/null
@@ -0,0 +1,51 @@
+Source: spl-linux
+Section: kernel
+Priority: extra
+Maintainer: Debian ZFS on Linux maintainers <pkg-zfsonlinux-devel@lists.alioth.debian.org>
+Build-Depends: autotools-dev,
+ autoconf,
+ autogen,
+ automake,
+ debhelper (>= 7.4),
+ dkms (>> 2.1.1.2-5),
+ libtool,
+ linux-headers-_KVERS_-common,
+ linux-headers-_KVERS_
+Standards-Version: 3.9.8
+Homepage: http://www.zfsonlinux.org/
+Vcs-Git: git://anonscm.debian.org/pkg-zfsonlinux/spl.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-zfsonlinux/spl.git
+
+Package: spl-modules-_KVERS_
+Architecture: _ARCH_
+Provides: spl-modules
+Depends: linux-image-_KVERS_
+Recommends: spl (>= ${source:Upstream-Version})
+Description: Solaris Porting Layer kernel modules for Linux (kernel _KVERS_)
+ The Solaris Porting Layer (SPL) is a Linux kernel module which provides
+ many of the Solaris kernel APIs. This shim layer makes it possible to
+ run Solaris kernel code in the Linux kernel with relatively minimal
+ modification.
+ .
+ This package contains the compiled kernel module for _KVERS_
+ .
+ If you have compiled your own kernel, you will most likely need to build
+ your own spl-modules. The spl-source package has been
+ provided for use with the Debian kernel-package utility to produce a 
+ version of spl-module for your kernel.
+
+Package: spl-modules-_KVERS_-di
+Package-Type: udeb
+Provides: spl-modules-_KVERS_-udeb
+Section: debian-installer
+Architecture: _ARCH_
+Depends: ${shlibs:Depends}, ${misc:Depends}, zlib-modules-_KVERS_-di
+Description: Solaris Porting Layer kernel modules for Linux (debian-installar version for kernel _KVERS_)
+ The Solaris Porting Layer (SPL) is a Linux kernel module which provides
+ many of the Solaris kernel APIs. This shim layer makes it possible to
+ run Solaris kernel code in the Linux kernel with relatively minimal
+ modification.
+ .
+ This package contains the compiled kernel module for _KVERS_
+ .
+ This is a minimal package for use in debian-installer.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644 (file)
index 0000000..2317360
--- /dev/null
@@ -0,0 +1,189 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Solaris Porting Layer for Linux
+Upstream-Contact: Brian Behlendorf <behlendorf1@llnl.gov>
+Source: https://github.com/zfsonlinux/spl/
+Disclaimer:
+ This work was produced at the Lawrence Livermore National Laboratory
+ (LLNL) under Contract No. DE-AC52-07NA27344 (Contract 44) between
+ the U.S. Department of Energy (DOE) and Lawrence Livermore National
+ Security, LLC (LLNS) for the operation of LLNL.
+ .
+ This work was prepared as an account of work sponsored by an agency of
+ the United States Government.  Neither the United States Government nor
+ Lawrence Livermore National Security, LLC nor any of their employees,
+ makes any warranty, express or implied, or assumes any liability or
+ responsibility for the accuracy, completeness, or usefulness of any
+ information, apparatus, product, or process disclosed, or represents
+ that its use would not infringe privately-owned rights.
+ .
+ Reference herein to any specific commercial products, process, or
+ services by trade name, trademark, manufacturer or otherwise does
+ not necessarily constitute or imply its endorsement, recommendation,
+ or favoring by the United States Government or Lawrence Livermore
+ National Security, LLC.  The views and opinions of authors expressed
+ herein do not necessarily state or reflect those of the Untied States
+ Government or Lawrence Livermore National Security, LLC, and shall
+ not be used for advertising or product endorsement purposes.
+
+Files: *
+Copyright: Lawrence Livermore National Security, LLC.
+ The Regents of the University of California
+License: GPL-2+
+
+Files: config/config.guess
+Copyright: Free Software Foundation, Inc.
+License: GPL-2+
+
+Files: config/config.sub
+Copyright: Free Software Foundation, Inc.
+License: GPL-2+
+
+Files: config/deb.am
+Copyright: Lawrence Livermore National Security, LLC.
+License: GPL-2+
+
+Files: config/depcomp
+Copyright: Free Software Foundation, Inc.
+License: GPL-2+
+
+Files: config/install-sh
+Copyright: 1994 X Consortium
+License: X11-install-sh
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to
+ deal in the Software without restriction, including without limitation the
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ sell copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+ X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+ TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ .
+ Except as contained in this notice, the name of the X Consortium shall not
+ be used in advertising or otherwise to promote the sale, use or other deal-
+ ings in this Software without prior written authorization from the X Consor-
+ tium.
+
+Files: config/ltmain.sh
+Copyright: Free Software Foundation, Inc.
+License: GPL-2+
+
+Files: config/missing
+Copyright: Free Software Foundation, Inc.
+License: GPL-2+
+
+Files: config/tgz.am
+Copyright: Lawrence Livermore National Security, LLC.
+License: GPL-2+
+
+Files: debian/*
+Copyright: Darik Horn <dajhorn@vanadac.com>
+ Carlos Alberto Lopez Perez <clopez@igalia.com>
+ Aron Xu <aron@debian.org>
+License: GPL-2+
+
+Files: include/linux/zlib_compat.h
+Copyright: Lawrence Livermore National Security, LLC.
+License: GPL-2+
+
+Files: include/rpc/xdr.h
+Copyright: Sun Microsystems, Inc.
+License: GPL-2+
+
+Files: include/sys/extdirent.h
+Copyright: Lawrence Livermore National Security, LLC.
+License: GPL-2+
+
+Files: include/sys/fcntl.h
+Copyright: Lawrence Livermore National Security, LLC.
+License: GPL-2+
+
+Files: include/sys/idmap.h
+Copyright: Lawrence Livermore National Security, LLC.
+License: GPL-2+
+
+Files: include/sys/tsd.h
+Copyright: Lawrence Livermore National Security, LLC.
+License: GPL-2+
+
+Files: include/sys/zmod.h
+Copyright: Jean-loup Gailly
+ Mark Adler
+License: zmod
+ This software is provided 'as-is', without any express or implied
+ warranty.  In no event will the authors be held liable for any damages
+ arising from the use of this software.
+ .
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+ .
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ .
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ .
+ 3. This notice may not be removed or altered from any source distribution.
+
+Files: module/spl/spl-tsd.c
+Copyright: Lawrence Livermore National Security, LLC.
+License: GPL-2+
+
+Files: module/spl/spl-xdr.c
+Copyright: Sun Microsystems, Inc.
+License: GPL-2+
+
+Files: module/splat/splat-linux.c
+Copyright: Lawrence Livermore National Security, LLC.
+License: GPL-2+
+
+Files: scripts/kmodtool
+Copyright: 2003-2012 Ville Skyttä <ville.skytta@iki.fi>
+ Thorsten Leemhuis <fedora@leemhuis.info>
+ Nicolas Chauvet <kwizart@gmail.com>
+License: BSD-like
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+ .
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+License: GPL-2+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any later
+ version.
+ .
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License along with
+ this package; if not, write to the Free Software Foundation, Inc., 51 Franklin
+ St, Fifth Floor, Boston, MA  02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public License version 2
+ can be found in the file /usr/share/common-licenses/GPL-2.
diff --git a/debian/dkms b/debian/dkms
new file mode 100644 (file)
index 0000000..82d8298
--- /dev/null
@@ -0,0 +1,36 @@
+AUTOINSTALL="yes"
+PACKAGE_NAME="spl"
+PACKAGE_VERSION="#MODULE_VERSION#"
+PRE_BUILD="configure
+  --prefix=/usr
+  --with-config=kernel
+  --with-linux=$(case `lsb_release -is` in
+                   (Debian)
+                     if [ -e ${kernel_source_dir/%build/source} ]
+                     then
+                       echo ${kernel_source_dir/%build/source}
+                     else
+                       # This is a kpkg exception for Proxmox 2.0
+                      echo ${kernel_source_dir}
+                     fi
+                     ;;
+                   (*)
+                     echo ${kernel_source_dir}
+                     ;;
+                 esac)
+  --with-linux-obj=${kernel_source_dir}
+"
+POST_BUILD="cp
+  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/spl_config.h
+  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/module/Module.symvers
+  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/${kernelver}/${arch}/
+"
+[ -d "${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build" ] && POST_INSTALL=${POST_BUILD}
+REMAKE_INITRD="no"
+MAKE[0]="make"
+BUILT_MODULE_NAME[0]="spl"
+BUILT_MODULE_LOCATION[0]="module/spl/"
+DEST_MODULE_LOCATION[0]="/extra/spl/spl"
+BUILT_MODULE_NAME[1]="splat"
+BUILT_MODULE_LOCATION[1]="module/splat/"
+DEST_MODULE_LOCATION[1]="/extra/splat/splat"
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644 (file)
index 0000000..cec628c
--- /dev/null
@@ -0,0 +1,2 @@
+[DEFAULT]
+pristine-tar = True
diff --git a/debian/patches/0001-Fix-crgetgroups-out-of-bound-and-misc-cred-fix.patch b/debian/patches/0001-Fix-crgetgroups-out-of-bound-and-misc-cred-fix.patch
new file mode 100644 (file)
index 0000000..56e2bb8
--- /dev/null
@@ -0,0 +1,101 @@
+From: Chunwei Chen <david.chen@osnexus.com>
+Date: Tue, 18 Oct 2016 15:52:30 -0700
+Subject: Fix crgetgroups out-of-bound and misc cred fix
+
+init_groups has 0 nblocks, therefore calling the current crgetgroups with
+init_groups would result in out-of-bound access. We fix this by returning NULL
+when nblocks is 0.
+
+Cap crgetngroups to NGROUPS_PER_BLOCK, since crgetgroups will only return
+blocks[0].
+
+Also, remove all get_group_info. The cred already holds reference on the
+group_info, and cred is not mutable. So there's no reason to hold extra
+reference, if we hold cred.
+
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
+Closes #556
+---
+ module/spl/spl-cred.c | 31 ++++++++++++++++---------------
+ 1 file changed, 16 insertions(+), 15 deletions(-)
+
+diff --git a/module/spl/spl-cred.c b/module/spl/spl-cred.c
+index a03f459..d046f95 100644
+--- a/module/spl/spl-cred.c
++++ b/module/spl/spl-cred.c
+@@ -62,19 +62,17 @@ cr_groups_search(const struct group_info *group_info, gid_t grp)
+       return 0;
+ }
+-/* Hold a reference on the credential and group info */
++/* Hold a reference on the credential */
+ void
+ crhold(cred_t *cr)
+ {
+       (void)get_cred((const cred_t *)cr);
+-      (void)get_group_info(cr->group_info);
+ }
+-/* Free a reference on the credential and group info */
++/* Free a reference on the credential */
+ void
+ crfree(cred_t *cr)
+ {
+-      put_group_info(cr->group_info);
+       put_cred((const cred_t *)cr);
+ }
+@@ -85,28 +83,32 @@ crgetngroups(const cred_t *cr)
+       struct group_info *gi;
+       int rc;
+-      gi = get_group_info(cr->group_info);
++      gi = cr->group_info;
+       rc = gi->ngroups;
+-      put_group_info(gi);
+-
++      /*
++       * crgetgroups will only returns gi->blocks[0], which contains only
++       * the first NGROUPS_PER_BLOCK groups.
++       */
++      if (rc > NGROUPS_PER_BLOCK) {
++              WARN_ON_ONCE(1);
++              rc = NGROUPS_PER_BLOCK;
++      }
+       return rc;
+ }
+ /*
+  * Return an array of supplemental gids.  The returned address is safe
+  * to use as long as the caller has taken a reference with crhold().
+- * The caller is responsible for releasing the reference with crfree().
+  */
+ gid_t *
+ crgetgroups(const cred_t *cr)
+ {
+       struct group_info *gi;
+-      gid_t *gids;
+-
+-      gi = get_group_info(cr->group_info);
+-      gids = KGIDP_TO_SGIDP(gi->blocks[0]);
+-      put_group_info(gi);
++      gid_t *gids = NULL;
++      gi = cr->group_info;
++      if (gi->nblocks > 0)
++              gids = KGIDP_TO_SGIDP(gi->blocks[0]);
+       return gids;
+ }
+@@ -117,9 +119,8 @@ groupmember(gid_t gid, const cred_t *cr)
+       struct group_info *gi;
+       int rc;
+-      gi = get_group_info(cr->group_info);
++      gi = cr->group_info;
+       rc = cr_groups_search(gi, SGID_TO_KGID(gid));
+-      put_group_info(gi);
+       return rc;
+ }
diff --git a/debian/patches/0002-Fix-splat-cred.c-cred-usage.patch b/debian/patches/0002-Fix-splat-cred.c-cred-usage.patch
new file mode 100644 (file)
index 0000000..2ff9018
--- /dev/null
@@ -0,0 +1,79 @@
+From: Chunwei Chen <david.chen@osnexus.com>
+Date: Tue, 18 Oct 2016 17:29:26 -0700
+Subject: Fix splat-cred.c cred usage
+
+No need to crhold current_cred(), fix possible leak in splat_cred_test2
+
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
+Closes #556
+---
+ module/splat/splat-cred.c | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/module/splat/splat-cred.c b/module/splat/splat-cred.c
+index fadf9bc..e3d1c4e 100644
+--- a/module/splat/splat-cred.c
++++ b/module/splat/splat-cred.c
+@@ -53,18 +53,18 @@ splat_cred_test1(struct file *file, void *arg)
+       uid_t uid, ruid, suid;
+       gid_t gid, rgid, sgid, *groups;
+       int ngroups, i, count = 0;
++      cred_t *cr = CRED();
+-      uid  = crgetuid(CRED());
+-      ruid = crgetruid(CRED());
+-      suid = crgetsuid(CRED());
++      uid  = crgetuid(cr);
++      ruid = crgetruid(cr);
++      suid = crgetsuid(cr);
+-      gid  = crgetgid(CRED());
+-      rgid = crgetrgid(CRED());
+-      sgid = crgetsgid(CRED());
++      gid  = crgetgid(cr);
++      rgid = crgetrgid(cr);
++      sgid = crgetsgid(cr);
+-      crhold(CRED());
+-      ngroups = crgetngroups(CRED());
+-      groups  = crgetgroups(CRED());
++      ngroups = crgetngroups(cr);
++      groups = crgetgroups(cr);
+       memset(str, 0, GROUP_STR_SIZE);
+       for (i = 0; i < ngroups; i++) {
+@@ -78,8 +78,6 @@ splat_cred_test1(struct file *file, void *arg)
+               }
+       }
+-      crfree(CRED());
+-
+       splat_vprint(file, SPLAT_CRED_TEST1_NAME,
+                    "uid: %d ruid: %d suid: %d "
+                    "gid: %d rgid: %d sgid: %d\n",
+@@ -114,6 +112,8 @@ splat_cred_test2(struct file *file, void *arg)
+       gid_t gid, rgid, sgid, *groups;
+       int ngroups, i, count = 0;
++      crhold(kcred);
++
+       uid  = crgetuid(kcred);
+       ruid = crgetruid(kcred);
+       suid = crgetsuid(kcred);
+@@ -122,7 +122,6 @@ splat_cred_test2(struct file *file, void *arg)
+       rgid = crgetrgid(kcred);
+       sgid = crgetsgid(kcred);
+-      crhold(kcred);
+       ngroups = crgetngroups(kcred);
+       groups  = crgetgroups(kcred);
+@@ -134,6 +133,7 @@ splat_cred_test2(struct file *file, void *arg)
+                       splat_vprint(file, SPLAT_CRED_TEST2_NAME,
+                                    "Failed too many group entries for temp "
+                                    "buffer: %d, %s\n", ngroups, str);
++                      crfree(kcred);
+                       return -ENOSPC;
+               }
+       }
diff --git a/debian/patches/0003-Linux-4.9-compat-group_info-changes.patch b/debian/patches/0003-Linux-4.9-compat-group_info-changes.patch
new file mode 100644 (file)
index 0000000..79b3fa8
--- /dev/null
@@ -0,0 +1,145 @@
+From: Chunwei Chen <david.chen@osnexus.com>
+Date: Tue, 18 Oct 2016 17:30:41 -0700
+Subject: Linux 4.9 compat: group_info changes
+
+In Linux 4.9, torvalds/linux@81243ea, group_info changed from 2d array via
+->blocks to 1d array via ->gid. We change the spl cred functions accordingly.
+
+Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
+Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
+Closes #581
+---
+ config/spl-build.m4       | 23 +++++++++++++++++++++++
+ include/sys/cred.h        |  5 +++++
+ module/spl/spl-cred.c     | 10 ++++++++++
+ module/splat/splat-cred.c |  5 +++--
+ 4 files changed, 41 insertions(+), 2 deletions(-)
+
+diff --git a/config/spl-build.m4 b/config/spl-build.m4
+index c401fd8..5a2f1de 100644
+--- a/config/spl-build.m4
++++ b/config/spl-build.m4
+@@ -49,6 +49,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
+       SPL_AC_WAIT_ON_BIT
+       SPL_AC_INODE_LOCK
+       SPL_AC_MUTEX_OWNER
++      SPL_AC_GROUP_INFO_GID
+ ])
+ AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
+@@ -1574,3 +1575,25 @@ AC_DEFUN([SPL_AC_MUTEX_OWNER], [
+       ])
+       EXTRA_KCFLAGS="$tmp_flags"
+ ])
++
++dnl #
++dnl # 4.9 API change
++dnl # group_info changed from 2d array via >blocks to 1d array via ->gid
++dnl #
++AC_DEFUN([SPL_AC_GROUP_INFO_GID], [
++      AC_MSG_CHECKING([whether group_info->gid exists])
++      tmp_flags="$EXTRA_KCFLAGS"
++      EXTRA_KCFLAGS="-Werror"
++      SPL_LINUX_TRY_COMPILE([
++              #include <linux/cred.h>
++      ],[
++              struct group_info *gi = groups_alloc(1);
++              gi->gid[0] = KGIDT_INIT(0);
++      ],[
++              AC_MSG_RESULT(yes)
++              AC_DEFINE(HAVE_GROUP_INFO_GID, 1, [group_info->gid exists])
++      ],[
++              AC_MSG_RESULT(no)
++      ])
++      EXTRA_KCFLAGS="$tmp_flags"
++])
+diff --git a/include/sys/cred.h b/include/sys/cred.h
+index 4f62b00..480e268 100644
+--- a/include/sys/cred.h
++++ b/include/sys/cred.h
+@@ -34,6 +34,11 @@ typedef struct cred cred_t;
+ #define       kcred           ((cred_t *)(init_task.cred))
+ #define       CRED()          ((cred_t *)current_cred())
++/* Linux 4.9 API change, GROUP_AT was removed */
++#ifndef GROUP_AT
++#define       GROUP_AT(gi, i) ((gi)->gid[i])
++#endif
++
+ #ifdef HAVE_KUIDGID_T
+ /*
+diff --git a/module/spl/spl-cred.c b/module/spl/spl-cred.c
+index d046f95..1d486c1 100644
+--- a/module/spl/spl-cred.c
++++ b/module/spl/spl-cred.c
+@@ -85,7 +85,9 @@ crgetngroups(const cred_t *cr)
+       gi = cr->group_info;
+       rc = gi->ngroups;
++#ifndef HAVE_GROUP_INFO_GID
+       /*
++       * For Linux <= 4.8,
+        * crgetgroups will only returns gi->blocks[0], which contains only
+        * the first NGROUPS_PER_BLOCK groups.
+        */
+@@ -93,12 +95,16 @@ crgetngroups(const cred_t *cr)
+               WARN_ON_ONCE(1);
+               rc = NGROUPS_PER_BLOCK;
+       }
++#endif
+       return rc;
+ }
+ /*
+  * Return an array of supplemental gids.  The returned address is safe
+  * to use as long as the caller has taken a reference with crhold().
++ *
++ * Linux 4.9 API change, group_info changed from 2d array via ->blocks to 1d
++ * array via ->gid.
+  */
+ gid_t *
+ crgetgroups(const cred_t *cr)
+@@ -107,8 +113,12 @@ crgetgroups(const cred_t *cr)
+       gid_t *gids = NULL;
+       gi = cr->group_info;
++#ifdef HAVE_GROUP_INFO_GID
++      gids = KGIDP_TO_SGIDP(gi->gid);
++#else
+       if (gi->nblocks > 0)
+               gids = KGIDP_TO_SGIDP(gi->blocks[0]);
++#endif
+       return gids;
+ }
+diff --git a/module/splat/splat-cred.c b/module/splat/splat-cred.c
+index e3d1c4e..f6b70ce 100644
+--- a/module/splat/splat-cred.c
++++ b/module/splat/splat-cred.c
+@@ -166,6 +166,7 @@ splat_cred_test2(struct file *file, void *arg)
+         return 0;
+ } /* splat_cred_test2() */
++#define       SPLAT_NGROUPS   32
+ /*
+  * Verify the groupmember() works correctly by constructing an interesting
+  * CRED() and checking that the expected gids are part of it.
+@@ -188,7 +189,7 @@ splat_cred_test3(struct file *file, void *arg)
+        * 1:(NGROUPS_MAX-1).  Gid 0 is explicitly avoided so we can reliably
+        * test for its absence in the test cases.
+        */
+-      gi = groups_alloc(NGROUPS_SMALL);
++      gi = groups_alloc(SPLAT_NGROUPS);
+       if (gi == NULL) {
+               splat_vprint(file, SPLAT_CRED_TEST3_NAME, "Failed create "
+                   "group_info for known gids: %d\n", -ENOMEM);
+@@ -196,7 +197,7 @@ splat_cred_test3(struct file *file, void *arg)
+               goto show_groups;
+       }
+-      for (i = 0, tmp_gid = known_gid; i < NGROUPS_SMALL; i++) {
++      for (i = 0, tmp_gid = known_gid; i < SPLAT_NGROUPS; i++) {
+               splat_vprint(file, SPLAT_CRED_TEST3_NAME, "Adding gid %d "
+                   "to current CRED() (%d/%d)\n", tmp_gid, i, gi->ngroups);
+ #ifdef HAVE_KUIDGID_T
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..13b420c
--- /dev/null
@@ -0,0 +1,3 @@
+0001-Fix-crgetgroups-out-of-bound-and-misc-cred-fix.patch
+0002-Fix-splat-cred.c-cred-usage.patch
+0003-Linux-4.9-compat-group_info-changes.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755 (executable)
index 0000000..b2fc86c
--- /dev/null
@@ -0,0 +1,113 @@
+#!/usr/bin/make -f
+
+NAME := $(shell awk '$$1 == "Name:" { print $$2; }' META)
+VERSION := $(shell dpkg-parsechangelog \
+  | awk '$$1 == "Version:" { print $$2; }' | cut -d- -f1)
+REVISION := $(shell dpkg-parsechangelog \
+  | awk '$$1 == "Version:" { print $$2; }' | cut -d- -f2-)
+
+ifndef DEB_HOST_ARCH
+DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH)
+endif
+
+ifndef KVERS
+KVERS=$(shell uname -r)
+endif
+
+non_epoch_version=$(shell echo $(KVERS) | perl -pe 's/^\d+://')
+PACKAGE=spl
+pmodules = $(PACKAGE)-modules-$(non_epoch_version)
+
+%:
+       dh $@ --with dkms,autoreconf --parallel
+
+override_dh_auto_configure:
+       @cp debian/control.in debian/control
+
+       @# Embed the downstream version in the module.
+       @sed \
+         -e 's/^Version:.*/Version:      $(VERSION)/' \
+         -e 's/^Release:.*/Release:      $(REVISION)/' \
+         -i.orig META
+
+       @# Build the userland, but don't build the kernel modules.
+       dh_auto_configure -- --with-config=user --disable-debug-kmem
+
+override_dh_auto_test:
+       # scripts/check.sh tries insmod and rmmod, so it cannot
+       # run in an unprivileged build environment.
+
+override_dh_auto_install:
+       @# Install the utilities.
+       $(MAKE) install DESTDIR='$(CURDIR)/debian/tmp'
+
+       @# Get a bare copy of the source code.
+       @# This creates the $(CURDIR)/$(NAME)-$(VERSION)/ tree.
+       $(MAKE) distdir
+
+       @# This shunt allows DKMS to install the Module.symvers and spl_config.h
+       @# files to the ${dkms_tree} area through the POST_INSTALL directive.
+       echo '#!/bin/sh'  >'$(CURDIR)/$(NAME)-$(VERSION)/cp'
+       echo 'cp "$$@"'  >>'$(CURDIR)/$(NAME)-$(VERSION)/cp'
+       chmod 755 '$(CURDIR)/$(NAME)-$(VERSION)/cp'
+
+       # Install the DKMS source.
+       mkdir -p '$(CURDIR)/debian/tmp/usr/src/'
+       mv '$(CURDIR)/$(NAME)-$(VERSION)' '$(CURDIR)/debian/tmp/usr/src/'
+
+override_dh_dkms:
+       dh_dkms -V $(VERSION)
+
+override_dh_auto_clean:
+       dh_auto_clean
+       @if test -e META.orig; then mv META.orig META; fi
+       cp debian/control.in debian/control
+
+# ------------
+
+override_dh_prep-deb-files:
+       for templ in $(wildcard $(CURDIR)/debian/*_KVERS_*.in); do \
+               sed -e 's/##KVERS##/$(KVERS)/g ; s/#KVERS#/$(KVERS)/g ; s/_KVERS_/$(KVERS)/g ; s/##KDREV##/$(KDREV)/g ; s/#KDREV#/$(KDREV)/g ; s/_KDREV_/$(KDREV)/g ;  s/_ARCH_/$(DEB_HOST_ARCH)/g' \
+               < $$templ > `echo $$templ | sed -e 's/_KVERS_/$(KVERS)/g ; s/_ARCH_/$(DEB_HOST_ARCH)/g ; s/\.in$$//'` ; \
+       done
+       sed -e 's/##KVERS##/$(KVERS)/g ; s/#KVERS#/$(KVERS)/g ; s/_KVERS_/$(KVERS)/g ; s/##KDREV##/$(KDREV)/g ; s/#KDREV#/$(KDREV)/g ; s/_KDREV_/$(KDREV)/g ; s/_ARCH_/$(DEB_HOST_ARCH)/g' \
+       < debian/control.modules.in > debian/control
+
+override_dh_configure_modules: override_dh_configure_modules_stamp
+override_dh_configure_modules_stamp:
+       ./configure --with-config=kernel --with-linux=$(KSRC) \
+               --with-linux-obj=$(KOBJ) \
+               --disable-debug-kmem
+       touch override_dh_configure_modules_stamp
+
+override_dh_binary-modules-udeb: override_dh_prep-deb-files override_dh_configure_modules
+       dh_testdir
+       dh_testroot
+       dh_prep
+
+       $(MAKE) -C $(CURDIR)/module modules
+
+       dh_installdirs -p${pmodules}-di
+       dh_install -p${pmodules}-di
+       dh_gencontrol -p${pmodules}-di
+
+       dh_builddeb -p${pmodules}-di
+
+override_dh_binary-modules: override_dh_prep-deb-files override_dh_configure_modules
+       dh_testdir
+       dh_testroot
+       dh_prep
+
+       $(MAKE) -C $(CURDIR)/module modules
+
+       dh_installdocs -p${pmodules}
+       dh_install -p${pmodules}
+       dh_installchangelogs -p${pmodules}
+       dh_compress -p${pmodules}
+       dh_strip -p${pmodules}
+       dh_fixperms -p${pmodules}
+       dh_installdeb -p${pmodules}
+       dh_gencontrol -p${pmodules}
+       dh_md5sums -p${pmodules}
+
+       dh_builddeb -p${pmodules}
diff --git a/debian/source/format b/debian/source/format
new file mode 100644 (file)
index 0000000..163aaf8
--- /dev/null
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/source/options b/debian/source/options
new file mode 100644 (file)
index 0000000..707e48b
--- /dev/null
@@ -0,0 +1 @@
+extend-diff-ignore='.*'
diff --git a/debian/spl-dkms.install b/debian/spl-dkms.install
new file mode 100644 (file)
index 0000000..d11e682
--- /dev/null
@@ -0,0 +1,3 @@
+usr/src
+usr/src/spl-*/AUTHORS  usr/share/doc/spl-dkms/
+usr/src/spl-*/DISCLAIMER       usr/share/doc/spl-dkms/
diff --git a/debian/spl-dkms.lintian-overrides b/debian/spl-dkms.lintian-overrides
new file mode 100644 (file)
index 0000000..d520c21
--- /dev/null
@@ -0,0 +1 @@
+spl-dkms: extra-license-file
diff --git a/debian/spl-modules-_KVERS_-di.dirs.in b/debian/spl-modules-_KVERS_-di.dirs.in
new file mode 100644 (file)
index 0000000..b37016e
--- /dev/null
@@ -0,0 +1,2 @@
+lib/modules/_KVERS_/extra/spl
+lib/modules/_KVERS_/extra/splat
diff --git a/debian/spl-modules-_KVERS_-di.install.in b/debian/spl-modules-_KVERS_-di.install.in
new file mode 100644 (file)
index 0000000..946e3f2
--- /dev/null
@@ -0,0 +1,2 @@
+module/spl/spl.ko      lib/modules/_KVERS_/extra/spl/
+module/splat/splat.ko  lib/modules/_KVERS_/extra/splat/
diff --git a/debian/spl-modules-_KVERS_.dirs.in b/debian/spl-modules-_KVERS_.dirs.in
new file mode 100644 (file)
index 0000000..b37016e
--- /dev/null
@@ -0,0 +1,2 @@
+lib/modules/_KVERS_/extra/spl
+lib/modules/_KVERS_/extra/splat
diff --git a/debian/spl-modules-_KVERS_.install.in b/debian/spl-modules-_KVERS_.install.in
new file mode 100644 (file)
index 0000000..946e3f2
--- /dev/null
@@ -0,0 +1,2 @@
+module/spl/spl.ko      lib/modules/_KVERS_/extra/spl/
+module/splat/splat.ko  lib/modules/_KVERS_/extra/splat/
diff --git a/debian/spl-modules-_KVERS_.postinst.in b/debian/spl-modules-_KVERS_.postinst.in
new file mode 100644 (file)
index 0000000..4e1baa5
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -e
+
+# Run depmod after module installation.
+depmod
+
+#DEBHELPER#
diff --git a/debian/spl-modules-_KVERS_.postrm.in b/debian/spl-modules-_KVERS_.postrm.in
new file mode 100644 (file)
index 0000000..2a2fc4b
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -e
+
+# Run depmod after module uninstallation.
+depmod
+
+#DEBHELPER#
diff --git a/debian/spl.install b/debian/spl.install
new file mode 100644 (file)
index 0000000..2e15100
--- /dev/null
@@ -0,0 +1,2 @@
+usr/sbin
+usr/share/man
diff --git a/debian/spl.lintian-overrides b/debian/spl.lintian-overrides
new file mode 100644 (file)
index 0000000..0170bbe
--- /dev/null
@@ -0,0 +1 @@
+spl: command-with-path-in-maintainer-script
diff --git a/debian/spl.postinst b/debian/spl.postinst
new file mode 100644 (file)
index 0000000..a0bb353
--- /dev/null
@@ -0,0 +1,49 @@
+#!/bin/sh
+set -e
+# The hostname and hostid of the last system to access a ZFS pool are stored in
+# the ZFS pool itself.  A pool is foreign if, during `zpool import`, the
+# current hostname and hostid are different than the stored values thereof.
+#
+# The hostid on Solaris is intrinsic, but is not on Linux (see #595790), so the
+# spl kernel module invokes /usr/bin/hostid from the userland in its initialization
+# routine.
+#
+# /usr/bin/hostid will return the 4 first bytes of the file /etc/hostid.
+# If this file is not present or contains less than 4 bytes, then /usr/bin/hostid
+# will return the bytes of the IP address of $(hostname) flipped, or zero if
+# such IP couldn't be obtained
+#
+# This means that things like a DHCP lease change can affect the hostid.
+#
+# Therefore the only way of having a stable hostid is to define it on /etc/hostid.
+# This postinst helper will check if we already have the hostid stabilized by
+# checking the existence of the file /etc/hostid to be 4 bytes at least.
+# If this file don't already exists on our system or has less than 4 bytes, then
+# we will stabilize our current hostid by writing its value to /etc/hostid
+
+# Detect if /etc/hostid is a conffile of previous spl package, migrate if yes
+# hostid file should preserve even when package is purged
+if $(dpkg-query --showformat='${Conffiles}\n' --show spl >/dev/null 2>&1); then
+       dpkg-maintscript-helper rm_conffile /etc/hostid -- "$@"
+fi
+
+if [ ! -f /etc/hostid ] || [ $(stat -c %s /etc/hostid) -lt 4 ] ; then
+
+       # Write our current hostid to /etc/hostid
+       HOSTID=$(hostid)
+       AA=$(echo $HOSTID | cut -b 1,2)
+       BB=$(echo $HOSTID | cut -b 3,4)
+       CC=$(echo $HOSTID | cut -b 5,6)
+       DD=$(echo $HOSTID | cut -b 7,8)
+
+       # Big Endian
+       if [ $(echo -n I | od -to2 | awk 'FNR==1{ print substr($2,6,1)}' 2>/dev/null) = 0 ]; then
+               # Invoke the printf from coreutils. shell builtin lacks the byte format.
+               /usr/bin/printf "\x$AA\x$BB\x$CC\x$DD" >/etc/hostid
+       else
+       # Little Endian
+               /usr/bin/printf "\x$DD\x$CC\x$BB\x$AA" >/etc/hostid
+       fi
+fi
+
+#DEBHELPER#
diff --git a/debian/spl.postrm b/debian/spl.postrm
new file mode 100644 (file)
index 0000000..2b6dc7b
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+
+# Detect if /etc/hostid is a conffile of previous spl package, migrate if yes
+# hostid file should preserve even when package is purged
+if $(dpkg-query --showformat='${Conffiles}\n' --show spl >/dev/null 2>&1); then
+        dpkg-maintscript-helper rm_conffile /etc/hostid -- "$@"
+fi
+
+#DEBHELPER#
diff --git a/debian/spl.preinst b/debian/spl.preinst
new file mode 100644 (file)
index 0000000..2b6dc7b
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+
+# Detect if /etc/hostid is a conffile of previous spl package, migrate if yes
+# hostid file should preserve even when package is purged
+if $(dpkg-query --showformat='${Conffiles}\n' --show spl >/dev/null 2>&1); then
+        dpkg-maintscript-helper rm_conffile /etc/hostid -- "$@"
+fi
+
+#DEBHELPER#
diff --git a/debian/tests/check.sh b/debian/tests/check.sh
new file mode 100644 (file)
index 0000000..be35e87
--- /dev/null
@@ -0,0 +1,123 @@
+#!/bin/bash
+###############################################################################
+# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
+# Copyright (C) 2007 The Regents of the University of California.
+# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
+# Written by Brian Behlendorf <behlendorf1@llnl.gov>.
+# UCRL-CODE-235197
+#
+# This file is part of the SPL, Solaris Porting Layer.
+# For details, see <http://zfsonlinux.org/>.
+#
+# The SPL is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# The SPL is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with the SPL.  If not, see <http://www.gnu.org/licenses/>.
+###############################################################################
+# This script runs the full set of regression tests.
+###############################################################################
+
+prog=check.sh
+spl_module=spl
+splat_module=splat
+splat_cmd=/usr/sbin/splat
+
+#
+#  The following subset work in a timely way and don't time out
+#  when running inside a VM with < 4GB of memory
+#
+SPLAT_TESTS=\
+"kmem:kmem_alloc kmem:kmem_zalloc kmem:vmem_alloc "\
+"kmem:vmem_zalloc kmem:slab_small "\
+"kmem:slab_reap kmem:slab_age "\
+"kmem:slab_lock taskq:single taskq:multiple "\
+"taskq:system taskq:wait taskq:front taskq:recurse "\
+"taskq:contention taskq:delay taskq:cancel taskq:dynamic "\
+"krng:all mutex:all condvar:all thread:all rwlock:all "\
+"time:all vnode:all kobj:all atomic:all list:all "\
+"generic:all cred:all zlib:all linux:all"
+
+memtotal=$(grep "MemTotal" /proc/meminfo | awk '{print $2}')
+if [ ! -z $memtotal ]; then
+        if [ $memtotal -gt 4194304 ]; then
+               SPLAT_TESTS="kmem:slab_large kmem:slab_align $SPLAT_TESTS"
+        fi
+fi
+
+tests=""
+for t in ${SPLAT_TESTS}
+do
+        tests="${tests} -t $t"
+done
+
+die() {
+       echo "${prog}: $1" >&2
+       exit 1
+}
+
+warn() {
+       echo "${prog}: $1" >&2
+}
+
+if [ $(getconf LONG_BIT) != 64 ]; then
+       echo "Skipping test, only valid for 64 bit architectures"
+       exit 0
+fi
+
+if [ -n "$V" ]; then
+       verbose="-v"
+fi
+
+if [ $(id -u) != 0 ]; then
+       die "Must run as root"
+fi
+
+if /sbin/lsmod | egrep -q "^spl|^splat"; then
+       die "Must start with spl modules unloaded"
+fi
+
+#if [ ! -f ${spl_module} ] || [ ! -f ${splat_module} ]; then
+#      die "Source tree must be built, run 'make'"
+#fi
+
+/sbin/modprobe zlib_inflate &>/dev/null
+/sbin/modprobe zlib_deflate &>/dev/null
+
+echo "Loading ${spl_module}"
+/sbin/modprobe ${spl_module} || die "Failed to load ${spl_module}"
+
+echo "Loading ${splat_module}"
+/sbin/modprobe ${splat_module} || die "Unable to load ${splat_module}"
+
+# Wait a maximum of 3 seconds for udev to detect the new splatctl 
+# device, if we do not see the character device file created assume
+# udev is not running and manually create the character device.
+for i in `seq 1 50`; do
+       sleep 0.1
+
+       if [ -c /dev/splatctl ]; then
+               break
+       fi
+
+       if [ $i -eq 50 ]; then
+               mknod /dev/splatctl c 229 0
+       fi
+done
+
+$splat_cmd --nocolor $tests $verbose
+
+echo "Unloading ${splat_module}"
+/sbin/modprobe -r ${splat_module} || die "Failed to unload ${splat_module}"
+
+echo "Unloading ${spl_module}"
+/sbin/modprobe -r ${spl_module} || die "Unable to unload ${spl_module}"
+
+exit 0
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644 (file)
index 0000000..1239bcf
--- /dev/null
@@ -0,0 +1,3 @@
+Tests: dkms-test check.sh
+Restrictions: needs-root, allow-stderr, isolation-machine
+Depends: dkms
diff --git a/debian/tests/dkms-test b/debian/tests/dkms-test
new file mode 100755 (executable)
index 0000000..a48a3b2
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+cat <<EOF >/usr/local/bin/dkms
+#!/bin/sh
+set -e
+/usr/sbin/dkms --force "\$@"
+EOF
+chmod +x /usr/local/bin/dkms
+
+/usr/lib/dkms/dkms-autopkgtest
+
+rm --force /usr/local/bin/dkms
diff --git a/debian/watch b/debian/watch
new file mode 100644 (file)
index 0000000..d6e8d88
--- /dev/null
@@ -0,0 +1,2 @@
+version=3
+http://zfsonlinux.org/ .*spl-([\d\.]+)\.tar\.gz$