Update build system and packaging

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
This commit is contained in:
Brian Behlendorf
2018-02-15 17:53:18 -08:00
parent 1272941f49
commit 93ce2b4ca5
209 changed files with 1096 additions and 1164 deletions
+1 -74
View File
@@ -42,9 +42,7 @@
# --------------------- ZFS on Linux Source Versions --------------
# zfs-0.6.2 master 0.6.2-175_g36eb554
# -----------------------------------------------------------------
# Clone SPL Local Local Skip
# Clone ZFS Local Local Skip
# Build SPL Pass Pass Skip
# Build ZFS Pass Pass Skip
# -----------------------------------------------------------------
# zevo-1.1.1 Pass Pass Pass
@@ -190,7 +188,6 @@ trap 'rm -Rf "$SRC_DIR"' INT TERM EXIT
populate "$SRC_DIR" 10 100
SRC_DIR="$TEST_DIR/src"
SRC_DIR_SPL="$SRC_DIR/spl"
SRC_DIR_ZFS="$SRC_DIR/zfs"
if [ "$COLOR" = "no" ]; then
@@ -224,9 +221,6 @@ fail() {
#
# Set several helper variables which are derived from a source tag.
#
# SPL_TAG - The tag zfs-x.y.z is translated to spl-x.y.z.
# SPL_DIR - The spl directory name.
# SPL_URL - The spl github URL to fetch the tarball.
# ZFS_TAG - The passed zfs-x.y.z tag
# ZFS_DIR - The zfs directory name
# ZFS_URL - The zfs github URL to fetch the tarball
@@ -234,10 +228,6 @@ fail() {
src_set_vars() {
local TAG=$1
SPL_TAG="${TAG//zfs/spl}"
SPL_DIR="$SRC_DIR_SPL/$SPL_TAG"
SPL_URL="$REPO/spl/tarball/$SPL_TAG"
ZFS_TAG="$TAG"
ZFS_DIR="$SRC_DIR_ZFS/$ZFS_TAG"
ZFS_URL="$REPO/zfs/tarball/$ZFS_TAG"
@@ -393,43 +383,6 @@ for TAG in $SRC_TAGS; do
done
echo -e "\n-----------------------------------------------------------------"
#
# Attempt to generate the tarball from your local git repository, if that
# fails then attempt to download the tarball from Github.
#
printf "%-16s" "Clone SPL"
for TAG in $SRC_TAGS; do
src_set_vars "$TAG"
if [ -d "$SPL_DIR" ]; then
skip_nonewline
elif [ "$SPL_TAG" = "installed" ]; then
skip_nonewline
else
cd "$SRC_DIR" || fail "Failed 'cd $SRC_DIR'"
if [ ! -d "$SRC_DIR_SPL" ]; then
mkdir -p "$SRC_DIR_SPL"
fi
git archive --format=tar --prefix="$SPL_TAG/ $SPL_TAG" \
-o "$SRC_DIR_SPL/$SPL_TAG.tar" &>/dev/null || \
rm "$SRC_DIR_SPL/$SPL_TAG.tar"
if [ -s "$SRC_DIR_SPL/$SPL_TAG.tar" ]; then
tar -xf "$SRC_DIR_SPL/$SPL_TAG.tar" -C "$SRC_DIR_SPL"
rm "$SRC_DIR_SPL/$SPL_TAG.tar"
echo -n -e "${COLOR_GREEN}Local${COLOR_RESET}\t\t"
else
mkdir -p "$SPL_DIR" || fail "Failed to create $SPL_DIR"
curl -sL "$SPL_URL" | tar -xz -C "$SPL_DIR" \
--strip-components=1 || \
fail "Failed to download $SPL_URL"
echo -n -e "${COLOR_GREEN}Remote${COLOR_RESET}\t\t"
fi
fi
done
printf "\n"
#
# Attempt to generate the tarball from your local git repository, if that
# fails then attempt to download the tarball from Github.
@@ -467,31 +420,6 @@ for TAG in $SRC_TAGS; do
done
printf "\n"
# Build the listed tags
printf "%-16s" "Build SPL"
for TAG in $SRC_TAGS; do
src_set_vars "$TAG"
if [ -f "$SPL_DIR/module/spl/spl.ko" ]; then
skip_nonewline
elif [ "$SPL_TAG" = "installed" ]; then
skip_nonewline
else
cd "$SPL_DIR" || fail "Failed 'cd $SPL_DIR'"
make distclean &>/dev/null
./autogen.sh >>"$CONFIG_LOG" 2>&1 || \
fail "Failed SPL 'autogen.sh'"
# shellcheck disable=SC2086
./configure $CONFIG_OPTIONS >>"$CONFIG_LOG" 2>&1 || \
fail "Failed SPL 'configure $CONFIG_OPTIONS'"
# shellcheck disable=SC2086
make $MAKE_OPTIONS >>"$MAKE_LOG" 2>&1 || \
fail "Failed SPL 'make $MAKE_OPTIONS'"
pass_nonewline
fi
done
printf "\n"
# Build the listed tags
printf "%-16s" "Build ZFS"
for TAG in $SRC_TAGS; do
@@ -507,8 +435,7 @@ for TAG in $SRC_TAGS; do
./autogen.sh >>"$CONFIG_LOG" 2>&1 || \
fail "Failed ZFS 'autogen.sh'"
# shellcheck disable=SC2086
./configure --with-spl="$SPL_DIR" $CONFIG_OPTIONS \
>>"$CONFIG_LOG" 2>&1 || \
./configure $CONFIG_OPTIONS >>"$CONFIG_LOG" 2>&1 || \
fail "Failed ZFS 'configure $CONFIG_OPTIONS'"
# shellcheck disable=SC2086
make $MAKE_OPTIONS >>"$MAKE_LOG" 2>&1 || \