代码拉取完成,页面将自动刷新
%bcond_with debug
%bcond_with debuginfo
Name: zfs-kmod
Version: 2.1.16
Release: 1
Summary: Kernel module(s)
Group: System Environment/Kernel
License: CDDL-1.0
URL: https://github.com/openzfs/zfs
BuildRequires: kernel-devel
BuildRequires: kernel-rpm-macros
Source0: zfs-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Patch0: 0001-compact-workaround-for-GPL-only-symbols-on-riscv-fro.patch
# Additional dependency information for the kmod sub-package must be specified
# by generating a preamble text file which kmodtool can append to the spec file.
%(/bin/echo -e "\
Requires: zfs = %{version}\n\
Conflicts: zfs-dkms\n\
Obsoletes: kmod-spl\n\
Obsoletes: spl-kmod\n\n" > %{_sourcedir}/kmod-preamble)
# LDFLAGS are not sanitized by arch/*/Makefile for these architectures.
%ifarch ppc ppc64 ppc64le aarch64
%global __global_ldflags %{nil}
%endif
%description
This package contains the ZFS kernel modules.
# Explicitly set latest kernel verion to for kernel_module_package
%global kernel_version %(ls -1 /usr/src/kernels|sort -rV |head -n 1)
%define kmod_name zfs
%kernel_module_package -n %{kmod_name} -p %{_sourcedir}/kmod-preamble
%define ksrc %{_usrsrc}/kernels/%{kverrel}
%define kobj %{ksrc}
%package -n kmod-%{kmod_name}-devel
Summary: ZFS kernel module(s) devel common
Group: System Environment/Kernel
Provides: kmod-spl-devel = %{version}
%description -n kmod-%{kmod_name}-devel
This package provides the header files and objects to build kernel modules.
%prep
%autosetup -n %{kmod_name}-%{version} -p1
if ! [ -d "%{ksrc}" ]; then
echo "Kernel build directory isn't set properly, cannot continue"
exit 1
fi
%if %{with debug}
%define debug --enable-debug
%else
%define debug --disable-debug
%endif
%if %{with debuginfo}
%define debuginfo --enable-debuginfo
%else
%define debuginfo --disable-debuginfo
%endif
%setup -n %{kmod_name}-%{version}
%build
%configure \
--with-config=kernel \
--with-linux=%{ksrc} \
--with-linux-obj=%{kobj} \
%{debug} \
%{debuginfo} \
%{?kernel_cc} \
%{?kernel_ld} \
%{?kernel_llvm}
make %{?_smp_mflags}
%install
make install \
DESTDIR=${RPM_BUILD_ROOT} \
INSTALL_MOD_DIR=extra/%{kmod_name}
%{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.*
# find-debuginfo.sh only considers executables
%{__chmod} u+x %{buildroot}/lib/modules/%{kverrel}/extra/*/*/*
%clean
rm -rf $RPM_BUILD_ROOT
%files -n kmod-%{kmod_name}-devel
%{_usrsrc}/%{kmod_name}-%{version}
%{_usrsrc}/spl-%{version}
%changelog
* Thu Jan 02 2025 pSomng <pisong.oerv@isrc.iscas.ac.cn> - 2.1.16-1
- Update to 2.1.16
- backport openzfs/zfs@86239a5
* Wed Apr 19 2023 Xinliang Liu <xinliang.liu@linaro.org> - 2.1.10-1
- Update to 2.1.10
- Fix release number contains double %{dist}, e.g. "*.oe1.oe1.aarch64.rpm"
- Fix kmod name without kernel release number by switching to redhat spec
- Only build for latest kernel
* Wed Mar 08 2023 Xinliang Liu <xinliang.liu@linaro.org> - 2.1.9-2
- Fix Source0 url.
* Fri Feb 24 2023 Xinliang Liu <xinliang.liu@linaro.org> - 2.1.9-1
- Initial RPM release
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。