forked from openzfs/spl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide a Redhat specific spl-kmod.spec file which uses the old style kmods (not kmods2) packaging. By using the provided kmodtool script packages can be built which support weak modules. This allows for the kernel to be updated without having to rebuild the SPL kernel modules. Packages for RHEL/Centos/SL/TOSS which use this spec file can by built as follows: $ ./configure --with-spec=redhat $ make rpms Signed-off-by: Brian Behlendorf <[email protected]>
- Loading branch information
1 parent
72998c2
commit fade6b0
Showing
8 changed files
with
116 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
SUBDIRS = generic | ||
SUBDIRS = generic redhat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/spl-dkms.spec | ||
/spl-kmod.spec | ||
/spl.spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
EXTRA_DIST = spl.spec.in spl-kmod.spec.in spl-dkms.spec.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../generic/spl-dkms.spec.in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
%bcond_with debug | ||
%bcond_with debug_log | ||
%bcond_with debug_kmem | ||
%bcond_with debug_kmem_tracking | ||
%bcond_with atomic_spinlocks | ||
|
||
Name: @PACKAGE@-kmod | ||
Version: @VERSION@ | ||
Release: @RELEASE@%{?dist} | ||
|
||
Summary: Kernel module(s) | ||
Group: System Environment/Kernel | ||
License: GPLv2+ | ||
URL: https://zfsonlinux.org/ | ||
BuildRequires: %kernel_module_package_buildreqs | ||
Source0: @PACKAGE@-%{version}.tar.gz | ||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | ||
|
||
# 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: @PACKAGE@ = %{version}\n\ | ||
Conflicts: @PACKAGE@-dkms\n\n" > %{_sourcedir}/kmod-preamble) | ||
|
||
%description | ||
This package contains the kernel modules required to emulate | ||
several interfaces provided by the Solaris kernel. | ||
|
||
%define kmod_name spl | ||
%define debug_package %{nil} | ||
|
||
%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: SPL kernel module(s) devel common | ||
Group: System Environment/Kernel | ||
|
||
%description -n kmod-%{kmod_name}-devel | ||
This package provides the header files and objects to build kernel modules | ||
which depend on the SPL kernel module. | ||
|
||
%prep | ||
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 debug_log} | ||
%define debug_log --enable-debug-log | ||
%else | ||
%define debug_log --disable-debug-log | ||
%endif | ||
|
||
%if %{with debug_kmem} | ||
%define debug_kmem --enable-debug-kmem | ||
%else | ||
%define debug_kmem --disable-debug-kmem | ||
%endif | ||
|
||
%if %{with debug_kmem_tracking} | ||
%define debug_kmem_tracking --enable-debug-kmem-tracking | ||
%else | ||
%define debug_kmem_tracking --disable-debug-kmem-tracking | ||
%endif | ||
|
||
%if %{with atomic_spinlocks} | ||
%define atomic_spinlocks --enable-atomic-spinlocks | ||
%else | ||
%define atomic_spinlocks --disable-atomic-spinlocks | ||
%endif | ||
|
||
%setup -n %{kmod_name}-%{version} | ||
%build | ||
%configure \ | ||
--with-config=kernel \ | ||
--with-linux=%{ksrc} \ | ||
--with-linux-obj=%{kobj} \ | ||
%{debug} \ | ||
%{debug_log} \ | ||
%{debug_kmem} \ | ||
%{debug_kmem_tracking} \ | ||
%{atomic_spinlocks} | ||
make %{?_smp_mflags} | ||
|
||
%install | ||
make install \ | ||
DESTDIR=${RPM_BUILD_ROOT} \ | ||
INSTALL_MOD_DIR=extra/%{kmod_name} | ||
%{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.* | ||
|
||
%clean | ||
rm -rf $RPM_BUILD_ROOT | ||
|
||
%files -n kmod-%{kmod_name}-devel | ||
%{_usrsrc}/%{kmod_name}-%{version} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../generic/spl.spec.in |