|
|
88b27f |
%global pkg be2net
|
|
|
88b27f |
|
|
|
53e9dd |
%global driver_version 4.18.0-331.el8
|
|
|
88b27f |
|
|
|
53e9dd |
%global kernel_version 4.18.0-331.el8
|
|
|
88b27f |
|
|
|
88b27f |
%global _use_internal_dependency_generator 0
|
|
|
184186 |
%global __find_requires /usr/lib/rpm/redhat/find-requires
|
|
|
184186 |
%global __find_provides /usr/lib/rpm/redhat/find-provides
|
|
|
88b27f |
|
|
|
88b27f |
%global debug_package %{nil}
|
|
|
88b27f |
|
|
|
88b27f |
%global __spec_install_post \
|
|
|
88b27f |
%{?__debug_package:%{__debug_install_post}} \
|
|
|
88b27f |
%{__arch_install_post} \
|
|
|
88b27f |
%{__os_install_post} \
|
|
|
88b27f |
%{__mod_compress_install_post}
|
|
|
88b27f |
|
|
|
88b27f |
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
|
|
|
88b27f |
|
|
|
88b27f |
|
|
|
88b27f |
Name: kmod-%{pkg}
|
|
|
53e9dd |
Version: 4.18.0.331
|
|
|
45b4c4 |
Release: 1%{?dist}
|
|
|
88b27f |
Summary: Emulex OneConnect NIC (%{pkg}) driver
|
|
|
88b27f |
|
|
|
88b27f |
License: GPLv2
|
|
|
88b27f |
URL: https://www.kernel.org/
|
|
|
88b27f |
|
|
|
1bcd35 |
Source0: %{pkg}-%{driver_version}.tar.xz
|
|
|
88b27f |
Patch1: 0001-enable-be2-and-be3.patch
|
|
|
88b27f |
|
|
|
88b27f |
ExclusiveArch: x86_64
|
|
|
88b27f |
|
|
|
88b27f |
BuildRequires: elfutils-libelf-devel
|
|
|
88b27f |
BuildRequires: gcc
|
|
|
184186 |
BuildRequires: kernel-rpm-macros
|
|
|
88b27f |
BuildRequires: kmod
|
|
|
88b27f |
BuildRequires: make
|
|
|
88b27f |
BuildRequires: redhat-rpm-config
|
|
|
88b27f |
BuildRequires: xz
|
|
|
88b27f |
|
|
|
184186 |
BuildRequires: kernel-abi-stablelists = %{kernel_version}
|
|
|
88b27f |
BuildRequires: kernel-devel = %{kernel_version}
|
|
|
e66e2c |
BuildRequires: kernel-devel-uname-r = %{kernel_version}.%{_arch}
|
|
|
88b27f |
|
|
|
184186 |
Requires: kernel >= %{kernel_version}
|
|
|
184186 |
Requires: kernel-uname-r >= %{kernel_version}.%{_arch}
|
|
|
184186 |
Requires: kernel-modules >= %{kernel_version}
|
|
|
184186 |
Requires: kernel-modules-uname-r >= %{kernel_version}.%{_arch}
|
|
|
88b27f |
|
|
|
2e233a |
Provides: installonlypkg(kernel-module)
|
|
|
184186 |
Provides: kernel-modules >= %{kernel_version}.%{_arch}
|
|
|
88b27f |
|
|
|
184186 |
Requires(post): %{_sbindir}/depmod
|
|
|
184186 |
Requires(postun): %{_sbindir}/depmod
|
|
|
88b27f |
|
|
|
184186 |
Requires(post): %{_sbindir}/weak-modules
|
|
|
184186 |
Requires(postun): %{_sbindir}/weak-modules
|
|
|
babdcd |
|
|
|
88b27f |
|
|
|
88b27f |
%description
|
|
|
88b27f |
This package provides the %{pkg} driver. Compared to the in-kernel driver this
|
|
|
88b27f |
driver re-enables support for deprecated BladeEngine 2 and 3 adapters.
|
|
|
88b27f |
|
|
|
88b27f |
BladeEngine 2 (BE2) devices:
|
|
|
88b27f |
- 0x19A2:0x0211: Emulex BladeEngine 2 Network Adapter
|
|
|
88b27f |
- 0x19A2:0x0700: Emulex OneConnect Tigershark NIC
|
|
|
88b27f |
|
|
|
88b27f |
BladeEngine 3 (BE3) devices:
|
|
|
88b27f |
- 0x19A2:0x0221: Emulex BladeEngine3 Network Adapter
|
|
|
88b27f |
- 0x19A2:0x0710: Emulex OneConnect Tomcat NIC
|
|
|
88b27f |
|
|
|
88b27f |
|
|
|
88b27f |
%prep
|
|
|
1bcd35 |
%autosetup -p1 -n %{pkg}-%{driver_version}
|
|
|
88b27f |
|
|
|
88b27f |
|
|
|
88b27f |
%build
|
|
|
88b27f |
pushd src
|
|
|
88b27f |
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
|
|
|
88b27f |
popd
|
|
|
88b27f |
|
|
|
88b27f |
|
|
|
88b27f |
%install
|
|
|
88b27f |
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/ethernet/emulex/benet src/%{pkg}.ko
|
|
|
88b27f |
|
|
|
88b27f |
# Make .ko objects temporarily executable for automatic stripping
|
|
|
88b27f |
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
|
|
|
88b27f |
|
|
|
184186 |
# Generate depmod.conf
|
|
|
184186 |
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
|
|
|
184186 |
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
|
|
|
184186 |
do
|
|
|
184186 |
echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
|
|
|
184186 |
done
|
|
|
184186 |
|
|
|
88b27f |
|
|
|
88b27f |
%clean
|
|
|
88b27f |
%{__rm} -rf %{buildroot}
|
|
|
88b27f |
|
|
|
88b27f |
|
|
|
88b27f |
%post
|
|
|
f54437 |
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
|
|
|
184186 |
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/ethernet/emulex/benet/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
|
|
|
f54437 |
|
|
|
f54437 |
|
|
|
f54437 |
%preun
|
|
|
f54437 |
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
|
|
|
184186 |
rpm -ql kmod-%{pkg}-%{?epoch:%{epoch}:}%{version}-%{release}.%{_arch} | grep '/lib/modules/%{kernel_version}.%{_arch}/.*\.ko\.xz$' >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
|
|
|
88b27f |
|
|
|
88b27f |
|
|
|
88b27f |
%postun
|
|
|
184186 |
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
|
|
|
f54437 |
then
|
|
|
184186 |
modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
|
|
|
184186 |
rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
|
|
|
f54437 |
rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
|
|
|
184186 |
printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
|
|
|
f54437 |
fi
|
|
|
f54437 |
|
|
|
f54437 |
|
|
|
184186 |
%pretrans -p <lua>
|
|
|
184186 |
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
|
|
|
184186 |
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
|
|
|
184186 |
|
|
|
184186 |
|
|
|
f54437 |
%posttrans
|
|
|
184186 |
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
|
|
|
f54437 |
then
|
|
|
184186 |
modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
|
|
|
184186 |
rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
|
|
|
f54437 |
rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
|
|
|
184186 |
printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
|
|
|
f54437 |
fi
|
|
|
88b27f |
|
|
|
88b27f |
|
|
|
88b27f |
%files
|
|
|
88b27f |
%defattr(644,root,root,755)
|
|
|
88b27f |
/lib/modules/%{kernel_version}.%{_arch}
|
|
|
88b27f |
%license COPYING
|
|
|
184186 |
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
|
|
|
88b27f |
|
|
|
88b27f |
|
|
|
88b27f |
%changelog
|
|
|
53e9dd |
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.331-1
|
|
|
53e9dd |
- Update to 4.18.0-331.el8
|
|
|
53e9dd |
|
|
|
7a5ebe |
* Thu Oct 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.326-1
|
|
|
7a5ebe |
- Update to 4.18.0-326.el8
|
|
|
7a5ebe |
|
|
|
c69379 |
* Wed Oct 27 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0.211-1
|
|
|
aed336 |
- Convert to kABI tracking kmod package (kernel >= 4.18.0-315.el8)
|
|
|
c9ee67 |
- Build 4.18.0-211.el8 for 4.18.0-315.el8
|
|
|
aed336 |
- Use release number independent of kernel
|
|
|
aed336 |
- Add driver release number to version
|