Skip to content

Commit

Permalink
Update build system and packaging
Browse files Browse the repository at this point in the history
Minimal changes required to integrate the SPL sources in to the
ZFS repository build infrastructure and packaging.

Build system and packaging:
  * Renamed SPL_* autoconf m4 macros to ZFS_*.
  * Removed redundant SPL_* autoconf m4 macros.
  * Updated the RPM spec files to remove SPL package dependency.
  * The zfs package obsoletes the spl package, and the zfs-kmod
    package obsoletes the spl-kmod package.
  * The zfs-kmod-devel* packages were updated to add compatibility
    symlinks under /usr/src/spl-x.y.z until all dependent packages
    can be updated.  They will be removed in a future release.
  * Updated copy-builtin script for in-kernel builds.
  * Updated DKMS package to include the spl.ko.
  * Updated stale AUTHORS file to include all contributors.
  * Updated stale COPYRIGHT and included the SPL as an exception.
  * Renamed README.markdown to README.md
  * Renamed OPENSOLARIS.LICENSE to LICENSE.
  * Renamed DISCLAIMER to NOTICE.

Required code changes:
  * Removed redundant HAVE_SPL macro.
  * Removed _BOOT from nvpairs since it doesn't apply for Linux.
  * Initial header cleanup (removal of empty headers, refactoring).
  * Remove SPL repository clone/build from zimport.sh.
  * Use of DEFINE_RATELIMIT_STATE and DEFINE_SPINLOCK removed due
    to build issues when forcing C99 compilation.
  * Replaced legacy ACCESS_ONCE with READ_ONCE.
  * Include needed headers for `current` and `EXPORT_SYMBOL`.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
TEST_ZIMPORT_SKIP="yes"
Closes #7556
  • Loading branch information
behlendorf committed May 29, 2018
1 parent 1272941 commit 93ce2b4
Show file tree
Hide file tree
Showing 209 changed files with 1,096 additions and 1,164 deletions.
389 changes: 299 additions & 90 deletions AUTHORS

Large diffs are not rendered by default.

46 changes: 17 additions & 29 deletions COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,39 +1,27 @@
The majority of the code in the ZFS on Linux port comes from OpenSolaris
which has been released under the terms of the CDDL open source license.
This includes the core ZFS code, libavl, libnvpair, libefi, libunicode,
and libutil. The original OpenSolaris source can be downloaded from:

http://dlc.sun.com/osol/on/downloads/b121/on-src.tar.bz2

Files which do not originate from OpenSolaris are noted in the file header
and attributed properly. These exceptions include, but are not limited
to, the vdev_disk.c and zvol.c implementation which are licensed under
the CDDL.

The latest stable and development versions of this port can be downloaded
from the official ZFS on Linux site located at:
Refer to the git commit log for authoritative copyright attribution.

http://zfsonlinux.org/
The original ZFS source code was obtained from Open Solaris which was
released under the terms of the CDDL open source license. Additional
changes have been included from OpenZFS and the Illumos project which
are similarly licensed. These projects can be found on Github at:

This ZFS on Linux port 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. It has been
approved for release under LLNL-CODE-403049.
* https://github.com/illumos/illumos-gate
* https://github.com/openzfs/openzfs

Unless otherwise noted, all files in this distribution are released
under the Common Development and Distribution License (CDDL).
Exceptions are noted within the associated source files. A few notable
exceptions and their respective licenses include:

Skein Checksum Implementation: module/icp/algs/skein/THIRDPARTYLICENSE
AES Implementation: module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
AES Implementation: module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
PBKDF2 Implementation: lib/libzfs/THIRDPARTYLICENSE.openssl
Exceptions are noted within the associated source files headers and
by including a THIRDPARTYLICENSE file with the license terms. A few
notable exceptions and their respective licenses include:

* Skein Checksum Implementation: module/icp/algs/skein/THIRDPARTYLICENSE
* AES Implementation: module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
* AES Implementation: module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
* PBKDF2 Implementation: lib/libzfs/THIRDPARTYLICENSE.openssl
* SPL Implementation: module/spl/THIRDPARTYLICENSE.gplv2

This product includes software developed by the OpenSSL Project for use
in the OpenSSL Toolkit (http://www.openssl.org/)

See the file OPENSOLARIS.LICENSE for more information.

Refer to the git commit log for authoritative copyright attribution.
See the LICENSE and NOTICE for more information.
24 changes: 0 additions & 24 deletions DISCLAIMER

This file was deleted.

File renamed without changes.
22 changes: 19 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ endif
if CONFIG_KERNEL
SUBDIRS += module

extradir = @prefix@/src/zfs-$(VERSION)
extradir = $(prefix)/src/zfs-$(VERSION)
extra_HEADERS = zfs.release.in zfs_config.h.in

kerneldir = @prefix@/src/zfs-$(VERSION)/$(LINUX_VERSION)
kerneldir = $(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION)
nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
endif

AUTOMAKE_OPTIONS = foreign
EXTRA_DIST = autogen.sh copy-builtin
EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
EXTRA_DIST += META DISCLAIMER COPYRIGHT README.markdown OPENSOLARIS.LICENSE
EXTRA_DIST += META AUTHORS COPYRIGHT LICENSE NOTICE README.md

@CODE_COVERAGE_RULES@

Expand All @@ -44,6 +44,22 @@ dist-hook:
sed -i 's/Release:[[:print:]]*/Release: $(RELEASE)/' \
$(distdir)/META

# For compatibility, create a matching spl-x.y.z directly which contains
# symlinks to the updated header and object file locations. These
# compatibility links will be removed in the next major release.
if CONFIG_KERNEL
install-data-hook:
mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
ln -s ../zfs-$(VERSION)/include/spl include && \
ln -s ../zfs-$(VERSION)/$(LINUX_VERSION) $(LINUX_VERSION) && \
ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \
ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \
cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \
ln -s zfs_config.h spl_config.h && \
ln -s zfs.release spl.release
endif

checkstyle: cstyle shellcheck flake8 commitcheck mancheck testscheck

commitcheck:
Expand Down
16 changes: 16 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This work was produced under the auspices of the U.S. Department of Energy by
Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344.

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,
expressed or implied, or assumes any legal 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 product, process, or service
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 United States Government or Lawrence Livermore National Security, LLC,
and shall not be used for advertising or product endorsement purposes.
8 changes: 8 additions & 0 deletions README.markdown → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@ developed for Solaris and is now maintained by the OpenZFS community.
[![coverity](https://scan.coverity.com/projects/1973/badge.svg)](https://scan.coverity.com/projects/zfsonlinux-zfs)

# Official Resources

* [Site](http://zfsonlinux.org)
* [Wiki](https://github.com/zfsonlinux/zfs/wiki)
* [Mailing lists](https://github.com/zfsonlinux/zfs/wiki/Mailing-Lists)
* [OpenZFS site](http://open-zfs.org/)

# Installation

Full documentation for installing ZoL on your favorite Linux distribution can
be found at [our site](http://zfsonlinux.org/).

# Contribute & Develop

We have a separate document with [contribution guidelines](./.github/CONTRIBUTING.md).

# Release

ZFS on Linux is released under a CDDL license.
For more details see the NOTICE, LICENSE and COPYRIGHT files; `UCRL-CODE-235197`
4 changes: 0 additions & 4 deletions TEST
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#TEST_PREPARE_WATCHDOG="yes"
#TEST_PREPARE_SHARES="yes"

### SPLAT
#TEST_SPLAT_SKIP="yes"
#TEST_SPLAT_OPTIONS="-acvx"

### ztest
#TEST_ZTEST_SKIP="yes"
#TEST_ZTEST_TIMEOUT=1800
Expand Down
1 change: 1 addition & 0 deletions cmd/mount_zfs/mount_zfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <locale.h>
#include <getopt.h>
#include <fcntl.h>
#include <errno.h>

#define ZS_COMMENT 0x00000000 /* comment */
#define ZS_ZFSUTIL 0x00000001 /* caller is zfs(8) */
Expand Down
1 change: 1 addition & 0 deletions cmd/zed/agents/zfs_diagnosis.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/

#include <stddef.h>
#include <string.h>
#include <strings.h>
#include <libuutil.h>
#include <libzfs.h>
Expand Down
1 change: 1 addition & 0 deletions cmd/zed/agents/zfs_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
#include <thread_pool.h>
#include <pthread.h>
#include <unistd.h>
#include <errno.h>
#include "zfs_agents.h"
#include "../zed_log.h"

Expand Down
1 change: 1 addition & 0 deletions cmd/zfs/zfs_iter.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>

#include <libzfs.h>
Expand Down
4 changes: 2 additions & 2 deletions config/kernel-ctl-table-name.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ dnl #
dnl # 2.6.33 API change,
dnl # Removed .ctl_name from struct ctl_table.
dnl #
AC_DEFUN([SPL_AC_CTL_NAME], [
AC_DEFUN([ZFS_AC_KERNEL_CTL_NAME], [
AC_MSG_CHECKING([whether struct ctl_table has ctl_name])
SPL_LINUX_TRY_COMPILE([
ZFS_LINUX_TRY_COMPILE([
#include <linux/sysctl.h>
],[
struct ctl_table ctl __attribute__ ((unused));
Expand Down
4 changes: 2 additions & 2 deletions config/kernel-fallocate-pax.m4
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dnl #
dnl # PaX Linux 2.6.38 - 3.x API
dnl #
AC_DEFUN([SPL_AC_PAX_KERNEL_FILE_FALLOCATE], [
AC_DEFUN([ZFS_AC_PAX_KERNEL_FILE_FALLOCATE], [
AC_MSG_CHECKING([whether fops->fallocate() exists])
SPL_LINUX_TRY_COMPILE([
ZFS_LINUX_TRY_COMPILE([
#include <linux/fs.h>
],[
long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
Expand Down
4 changes: 2 additions & 2 deletions config/kernel-group-info.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ 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_DEFUN([ZFS_AC_KERNEL_GROUP_INFO_GID], [
AC_MSG_CHECKING([whether group_info->gid exists])
tmp_flags="$EXTRA_KCFLAGS"
EXTRA_KCFLAGS="-Werror"
SPL_LINUX_TRY_COMPILE([
ZFS_LINUX_TRY_COMPILE([
#include <linux/cred.h>
],[
struct group_info *gi = groups_alloc(1);
Expand Down
4 changes: 2 additions & 2 deletions config/kernel-inode-lock.m4
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ dnl # i_mutex is changed to i_rwsem. Instead of directly using
dnl # i_mutex/i_rwsem, we should use inode_lock() and inode_lock_shared()
dnl # We test inode_lock_shared because inode_lock is introduced earlier.
dnl #
AC_DEFUN([SPL_AC_INODE_LOCK], [
AC_DEFUN([ZFS_AC_KERNEL_INODE_LOCK], [
AC_MSG_CHECKING([whether inode_lock_shared() exists])
tmp_flags="$EXTRA_KCFLAGS"
EXTRA_KCFLAGS="-Werror"
SPL_LINUX_TRY_COMPILE([
ZFS_LINUX_TRY_COMPILE([
#include <linux/fs.h>
],[
struct inode *inode = NULL;
Expand Down
10 changes: 5 additions & 5 deletions config/kernel-kmem-cache.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ dnl # private allocation flags which are applied when allocating a new slab
dnl # in kmem_getpages(). Unfortunately there is no public API for setting
dnl # non-default flags.
dnl #
AC_DEFUN([SPL_AC_KMEM_CACHE_ALLOCFLAGS], [
AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_ALLOCFLAGS], [
AC_MSG_CHECKING([whether struct kmem_cache has allocflags])
SPL_LINUX_TRY_COMPILE([
ZFS_LINUX_TRY_COMPILE([
#include <linux/slab.h>
],[
struct kmem_cache cachep __attribute__ ((unused));
Expand All @@ -20,7 +20,7 @@ AC_DEFUN([SPL_AC_KMEM_CACHE_ALLOCFLAGS], [
AC_MSG_RESULT(no)
AC_MSG_CHECKING([whether struct kmem_cache has gfpflags])
SPL_LINUX_TRY_COMPILE([
ZFS_LINUX_TRY_COMPILE([
#include <linux/slab.h>
],[
struct kmem_cache cachep __attribute__ ((unused));
Expand All @@ -40,11 +40,11 @@ dnl # grsecurity API change,
dnl # kmem_cache_create() with SLAB_USERCOPY flag replaced by
dnl # kmem_cache_create_usercopy().
dnl #
AC_DEFUN([SPL_AC_KMEM_CACHE_CREATE_USERCOPY], [
AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_CREATE_USERCOPY], [
AC_MSG_CHECKING([whether kmem_cache_create_usercopy() exists])
tmp_flags="$EXTRA_KCFLAGS"
EXTRA_KCFLAGS="-Werror"
SPL_LINUX_TRY_COMPILE([
ZFS_LINUX_TRY_COMPILE([
#include <linux/slab.h>
static void ctor(void *foo)
{
Expand Down
14 changes: 7 additions & 7 deletions config/kernel-kuidgid.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ dnl # User namespaces, use kuid_t in place of uid_t
dnl # where available. Not strictly a user namespaces thing
dnl # but it should prevent surprises
dnl #
AC_DEFUN([SPL_AC_KUIDGID_T], [
AC_DEFUN([ZFS_AC_KERNEL_KUIDGID_T], [
AC_MSG_CHECKING([whether kuid_t/kgid_t is available])
SPL_LINUX_TRY_COMPILE([
ZFS_LINUX_TRY_COMPILE([
#include <linux/uidgid.h>
], [
kuid_t userid = KUIDT_INIT(0);
kgid_t groupid = KGIDT_INIT(0);
kuid_t userid __attribute__ ((unused)) = KUIDT_INIT(0);
kgid_t groupid __attribute__ ((unused)) = KGIDT_INIT(0);
],[
SPL_LINUX_TRY_COMPILE([
ZFS_LINUX_TRY_COMPILE([
#include <linux/uidgid.h>
], [
kuid_t userid = 0;
kgid_t groupid = 0;
kuid_t userid __attribute__ ((unused)) = 0;
kgid_t groupid __attribute__ ((unused)) = 0;
],[
AC_MSG_RESULT(yes; optional)
],[
Expand Down
4 changes: 2 additions & 2 deletions config/kernel-pde-data.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ dnl #
dnl # 3.10 API change,
dnl # PDE is replaced by PDE_DATA
dnl #
AC_DEFUN([SPL_AC_PDE_DATA], [
AC_DEFUN([ZFS_AC_KERNEL_PDE_DATA], [
AC_MSG_CHECKING([whether PDE_DATA() is available])
SPL_LINUX_TRY_COMPILE_SYMBOL([
ZFS_LINUX_TRY_COMPILE_SYMBOL([
#include <linux/proc_fs.h>
], [
PDE_DATA(NULL);
Expand Down
8 changes: 4 additions & 4 deletions config/kernel-rw.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ dnl # 4.14 API change
dnl # kernel_write() which was introduced in 3.9 was updated to take
dnl # the offset as a pointer which is needed by vn_rdwr().
dnl #
AC_DEFUN([SPL_AC_KERNEL_WRITE], [
AC_DEFUN([ZFS_AC_KERNEL_WRITE], [
AC_MSG_CHECKING([whether kernel_write() takes loff_t pointer])
tmp_flags="$EXTRA_KCFLAGS"
EXTRA_KCFLAGS="-Werror"
SPL_LINUX_TRY_COMPILE([
ZFS_LINUX_TRY_COMPILE([
#include <linux/fs.h>
],[
struct file *file = NULL;
Expand All @@ -32,11 +32,11 @@ dnl # 4.14 API change
dnl # kernel_read() which has existed for forever was updated to take
dnl # the offset as a pointer which is needed by vn_rdwr().
dnl #
AC_DEFUN([SPL_AC_KERNEL_READ], [
AC_DEFUN([ZFS_AC_KERNEL_READ], [
AC_MSG_CHECKING([whether kernel_read() takes loff_t pointer])
tmp_flags="$EXTRA_KCFLAGS"
EXTRA_KCFLAGS="-Werror"
SPL_LINUX_TRY_COMPILE([
ZFS_LINUX_TRY_COMPILE([
#include <linux/fs.h>
],[
struct file *file = NULL;
Expand Down
Loading

0 comments on commit 93ce2b4

Please sign in to comment.