mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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:
+1
-2
@@ -40,8 +40,7 @@ export INSTALL_MOUNT_HELPER_DIR=@mounthelperdir@
|
||||
export INSTALL_SYSCONF_DIR=@sysconfdir@
|
||||
export INSTALL_PYTHON_DIR=@pythonsitedir@
|
||||
|
||||
export KMOD_SPL=@SPL_OBJ@/module/spl/spl.ko
|
||||
export KMOD_SPLAT=@SPL_OBJ@/module/splat/splat.ko
|
||||
export KMOD_SPL=@abs_top_builddir@/module/spl/spl.ko
|
||||
export KMOD_ZAVL=@abs_top_builddir@/module/avl/zavl.ko
|
||||
export KMOD_ZNVPAIR=@abs_top_builddir@/module/nvpair/znvpair.ko
|
||||
export KMOD_ZUNICODE=@abs_top_builddir@/module/unicode/zunicode.ko
|
||||
|
||||
+4
-4
@@ -42,9 +42,6 @@ PRE_BUILD="configure
|
||||
esac
|
||||
)
|
||||
--with-linux-obj=\${kernel_source_dir}
|
||||
--with-spl=\${source_tree}/spl-\${PACKAGE_VERSION}
|
||||
--with-spl-obj=\${dkms_tree}/spl/\${PACKAGE_VERSION}/\${kernelver}/\${arch}
|
||||
--with-spl-timeout=300
|
||||
\$(
|
||||
[[ -n \"\${ICP_ROOT}\" ]] && \\
|
||||
{
|
||||
@@ -71,7 +68,6 @@ POST_BUILD="scripts/dkms.postbuild
|
||||
-k \${kernelver}
|
||||
-t \${dkms_tree}
|
||||
"
|
||||
BUILD_DEPENDS[0]="spl"
|
||||
AUTOINSTALL="yes"
|
||||
REMAKE_INITRD="no"
|
||||
MAKE[0]="make"
|
||||
@@ -88,6 +84,7 @@ STRIP[3]="\${STRIP[0]}"
|
||||
STRIP[4]="\${STRIP[0]}"
|
||||
STRIP[5]="\${STRIP[0]}"
|
||||
STRIP[6]="\${STRIP[0]}"
|
||||
STRIP[7]="\${STRIP[0]}"
|
||||
BUILT_MODULE_NAME[0]="zavl"
|
||||
BUILT_MODULE_LOCATION[0]="module/avl/"
|
||||
DEST_MODULE_LOCATION[0]="/extra/avl/avl"
|
||||
@@ -109,4 +106,7 @@ DEST_MODULE_LOCATION[5]="/extra/icp/icp"
|
||||
BUILT_MODULE_NAME[6]="zlua"
|
||||
BUILT_MODULE_LOCATION[6]="module/lua/"
|
||||
DEST_MODULE_LOCATION[6]="/extra/lua/zlua"
|
||||
BUILT_MODULE_NAME[7]="spl"
|
||||
BUILT_MODULE_LOCATION[7]="module/spl/"
|
||||
DEST_MODULE_LOCATION[7]="/extra/spl/spl"
|
||||
EOF
|
||||
|
||||
+9
-2
@@ -237,10 +237,16 @@ the ${kmodname}-devel-<kernel> objects for the newest kernel.
|
||||
%defattr(644,root,root,755)
|
||||
%{_usrsrc}/${kmodname}-%{version}
|
||||
EOF
|
||||
if [[ ${obsolete_name} ]]; then
|
||||
echo "%{_usrsrc}/${obsolete_name}-%{version}"
|
||||
fi
|
||||
|
||||
for kernel in ${1}; do
|
||||
local kernel_uname_r=${kernel}
|
||||
echo "%exclude %{_usrsrc}/${kmodname}-%{version}/${kernel_uname_r}"
|
||||
if [[ ${obsolete_name} ]]; then
|
||||
echo "%exclude %{_usrsrc}/${obsolete_name}-%{version}/${kernel_uname_r}"
|
||||
fi
|
||||
done
|
||||
|
||||
echo
|
||||
@@ -295,9 +301,10 @@ kernel ${kernel_uname_r} for the %{_target_cpu} family of processors.
|
||||
%files -n kmod-${kmodname}-devel-${kernel_uname_r}
|
||||
%defattr(644,root,root,755)
|
||||
%{_usrsrc}/${kmodname}-%{version}/${kernel_uname_r}
|
||||
|
||||
|
||||
EOF
|
||||
if [[ ${obsolete_name} ]]; then
|
||||
echo "%{_usrsrc}/${obsolete_name}-%{version}/${kernel_uname_r}"
|
||||
fi
|
||||
}
|
||||
|
||||
print_rpmtemplate_kmodmetapkg ()
|
||||
|
||||
+3
-4
@@ -21,7 +21,6 @@ LDMOD=${LDMOD:-/sbin/modprobe}
|
||||
KMOD_ZLIB_DEFLATE=${KMOD_ZLIB_DEFLATE:-zlib_deflate}
|
||||
KMOD_ZLIB_INFLATE=${KMOD_ZLIB_INFLATE:-zlib_inflate}
|
||||
KMOD_SPL=${KMOD_SPL:-spl}
|
||||
KMOD_SPLAT=${KMOD_SPLAT:-splat}
|
||||
KMOD_ZAVL=${KMOD_ZAVL:-zavl}
|
||||
KMOD_ZNVPAIR=${KMOD_ZNVPAIR:-znvpair}
|
||||
KMOD_ZUNICODE=${KMOD_ZUNICODE:-zunicode}
|
||||
@@ -76,7 +75,7 @@ check_modules() {
|
||||
LOADED_MODULES=""
|
||||
MISSING_MODULES=""
|
||||
|
||||
for KMOD in $KMOD_SPL $KMOD_SPLAT $KMOD_ZAVL $KMOD_ZNVPAIR \
|
||||
for KMOD in $KMOD_SPL $KMOD_ZAVL $KMOD_ZNVPAIR \
|
||||
$KMOD_ZUNICODE $KMOD_ZCOMMON $KMOD_ZLUA $KMOD_ICP $KMOD_ZFS; do
|
||||
NAME=$(basename "$KMOD" .ko)
|
||||
|
||||
@@ -135,7 +134,7 @@ load_modules() {
|
||||
modprobe "$KMOD_ZLIB_INFLATE" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
for KMOD in $KMOD_SPL $KMOD_SPLAT $KMOD_ZAVL $KMOD_ZNVPAIR \
|
||||
for KMOD in $KMOD_SPL $KMOD_ZAVL $KMOD_ZNVPAIR \
|
||||
$KMOD_ZUNICODE $KMOD_ZCOMMON $KMOD_ZLUA $KMOD_ICP $KMOD_ZFS; do
|
||||
load_module "$KMOD" || return 1
|
||||
done
|
||||
@@ -165,7 +164,7 @@ unload_module() {
|
||||
|
||||
unload_modules() {
|
||||
for KMOD in $KMOD_ZFS $KMOD_ICP $KMOD_ZLUA $KMOD_ZCOMMON $KMOD_ZUNICODE \
|
||||
$KMOD_ZNVPAIR $KMOD_ZAVL $KMOD_SPLAT $KMOD_SPL; do
|
||||
$KMOD_ZNVPAIR $KMOD_ZAVL $KMOD_SPL; do
|
||||
NAME=$(basename "$KMOD" .ko)
|
||||
USE_COUNT=$(lsmod | grep -E "^${NAME} " | awk '{print $3}')
|
||||
|
||||
|
||||
+1
-74
@@ -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 || \
|
||||
|
||||
Reference in New Issue
Block a user