Blame SPECS/kmod-megaraid_sas.spec

7ecbca
%global pkg megaraid_sas
7ecbca
f7805c
%global driver_version 5.14.0-27.el9
7ecbca
a6246d
%global kernel_version 5.14.0-39.el9
7ecbca
7ecbca
%global debug_package %{nil}
7ecbca
7ecbca
%global __spec_install_post \
7ecbca
  %{?__debug_package:%{__debug_install_post}} \
7ecbca
  %{__arch_install_post} \
7ecbca
  %{__os_install_post} \
7ecbca
  %{__mod_compress_install_post}
7ecbca
7ecbca
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
7ecbca
7ecbca
7ecbca
Name:             kmod-%{pkg}
f7805c
Version:          5.14.0.27
Kmods SIG ab1f0c
Release:          5%{?dist}
7ecbca
Summary:          Broadcom MegaRAID SAS (%{pkg}) driver
7ecbca
7ecbca
License:          GPLv2
7ecbca
URL:              https://www.kernel.org/
7ecbca
7ecbca
Source0:          %{pkg}-%{driver_version}.tar.xz
7ecbca
Patch1:           0001-add-deprecated-ids.patch
7ecbca
7ecbca
ExclusiveArch:    x86_64 aarch64
7ecbca
7ecbca
BuildRequires:    elfutils-libelf-devel
7ecbca
BuildRequires:    gcc
f7805c
BuildRequires:    kernel-rpm-macros
7ecbca
BuildRequires:    kmod
7ecbca
BuildRequires:    make
7ecbca
BuildRequires:    redhat-rpm-config
7ecbca
BuildRequires:    xz
7ecbca
f7805c
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
7ecbca
BuildRequires:    kernel-devel = %{kernel_version}
7ecbca
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
7ecbca
f7805c
Requires:         kernel >= %{kernel_version}
f7805c
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
f7805c
Requires:         kernel-modules >= %{kernel_version}
f7805c
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
7ecbca
7ecbca
Provides:         installonlypkg(kernel-module)
f7805c
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
7ecbca
f7805c
Requires(post):   %{_sbindir}/depmod
f7805c
Requires(postun): %{_sbindir}/depmod
7ecbca
f7805c
Requires(post):   %{_sbindir}/weak-modules
f7805c
Requires(postun): %{_sbindir}/weak-modules
7ecbca
7ecbca
7ecbca
%description
7ecbca
This package provides the Broadcom MegaRAID SAS (%{pkg}) driver. Compared to
7ecbca
the in-kernel driver this driver re-enables support for deprecated adapters:
7ecbca
7ecbca
- 0x1000:0x0060: LSI MegaRAID SAS1078R
7ecbca
- 0x1000:0x0078: LSI MegaRAID SAS1078 Gen2
7ecbca
- 0x1000:0x007C: LSI MegaRAID SAS1078DE
7ecbca
- 0x1000:0x0411: LSI MegaRAID SAS1064R
7ecbca
- 0x1000:0x0413: LSI MegaRAID SAS1068 Verde ZCR
7ecbca
- 0x1028:0x0015: Dell PERC5
7ecbca
7ecbca
The removal of the following adapters has been reverted in 4.18.0-290 [1761485]:
7ecbca
- 0x1000:0x0071: LSI MegaRAID SAS0071 Skinny
7ecbca
- 0x1000:0x0073: LSI MegaRAID SAS0073 Skinny
7ecbca
- 0x1000:0x0079: LSI MegaRAID SAS0079 Gen2
7ecbca
7ecbca
7ecbca
%prep
7ecbca
%autosetup -p1 -n %{pkg}-%{driver_version}
7ecbca
7ecbca
7ecbca
%build
7ecbca
pushd src
7ecbca
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
7ecbca
popd
7ecbca
7ecbca
7ecbca
%install
7ecbca
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/megaraid src/%{pkg}.ko
7ecbca
7ecbca
# Make .ko objects temporarily executable for automatic stripping
7ecbca
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
7ecbca
f7805c
# Generate depmod.conf
f7805c
%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/
f7805c
for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort)
f7805c
do
f7805c
    echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf
f7805c
done
f7805c
7ecbca
7ecbca
%clean
7ecbca
%{__rm} -rf %{buildroot}
7ecbca
7ecbca
7ecbca
%post
7ecbca
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f7805c
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/megaraid/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
7ecbca
7ecbca
7ecbca
%preun
7ecbca
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
f7805c
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
7ecbca
7ecbca
7ecbca
%postun
f7805c
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
7ecbca
then
f7805c
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
f7805c
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
7ecbca
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f7805c
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
7ecbca
fi
7ecbca
7ecbca
f7805c
%pretrans -p <lua>
f7805c
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
f7805c
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
f7805c
f7805c
7ecbca
%posttrans
f7805c
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
7ecbca
then
f7805c
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
f7805c
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
7ecbca
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
f7805c
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
7ecbca
fi
7ecbca
7ecbca
7ecbca
%files
7ecbca
%defattr(644,root,root,755)
7ecbca
/lib/modules/%{kernel_version}.%{_arch}
7ecbca
%license COPYING
f7805c
%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf
7ecbca
7ecbca
7ecbca
%changelog
a6246d
* Sat Dec 25 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.27-5
a6246d
- Rebuild for 5.14.0-39.el9
a6246d
- Skip unreleased kernel -38
Kmods SIG ab1f0c
Kmods SIG 7beb87
* Thu Dec 23 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.27-4
Kmods SIG 7beb87
- Rebuild for 5.14.0-37.el9
Kmods SIG 7beb87
Kmods SIG cd0c36
* Wed Dec 22 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.27-3
Kmods SIG cd0c36
- Rebuild for 5.14.0-36.el9
Kmods SIG cd0c36
6d7388
* Wed Dec 22 2021 Kmods SIG <sig-kmods@centosproject.org> - 5.14.0.27-2
6d7388
- Rebuild for 5.14.0-34.el9
6d7388
- Skip unreleased kernel -32 and -33
Kmods SIG e49ef5
f7805c
* Thu Dec 16 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0.27-1
f7805c
- Convert to kABI tracking kmod package (kernel >= 5.14.0-31.el9)