Blame SPECS/kmod-megaraid_sas.spec

f3328c
%global pkg megaraid_sas
f3328c
8b966e
%global driver_version 4.18.0-326.el8
f3328c
ca899c
%global kernel_version 4.18.0-331.el8
f3328c
f3328c
%global _use_internal_dependency_generator 0
d600cd
%global __find_requires %{nil}
4147ff
%global __find_provides /usr/lib/rpm/find-provides
f3328c
f3328c
%global debug_package %{nil}
f3328c
f3328c
%global __spec_install_post \
f3328c
  %{?__debug_package:%{__debug_install_post}} \
f3328c
  %{__arch_install_post} \
f3328c
  %{__os_install_post} \
f3328c
  %{__mod_compress_install_post}
f3328c
f3328c
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
f3328c
f3328c
f3328c
Name:             kmod-%{pkg}
f3328c
Version:          4.18.0
7955f7
Release:          331%{?dist}
f3328c
Summary:          Broadcom MegaRAID SAS (%{pkg}) driver
f3328c
f3328c
License:          GPLv2
f3328c
URL:              https://www.kernel.org/
f3328c
8b966e
Source0:          %{pkg}-%{driver_version}.tar.xz
f3328c
Patch1:           0001-add-deprecated-ids.patch
f3328c
f3328c
ExclusiveArch:    x86_64 aarch64
f3328c
f3328c
BuildRequires:    elfutils-libelf-devel
f3328c
BuildRequires:    gcc
f3328c
BuildRequires:    kmod
f3328c
BuildRequires:    make
f3328c
BuildRequires:    redhat-rpm-config
f3328c
BuildRequires:    xz
f3328c
f3328c
BuildRequires:    kernel-devel = %{kernel_version}
d4c797
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
f3328c
11c128
Requires:         kernel-core = %{kernel_version}
d4c797
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
a6aeba
Requires:         kernel-modules = %{kernel_version}
d4c797
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
f3328c
8015bc
Provides:         installonlypkg(kernel-module)
fd9c85
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
f3328c
f3328c
Requires(post):   /usr/sbin/depmod
f3328c
Requires(postun): /usr/sbin/depmod
f3328c
53e9b1
Requires(post):   /usr/bin/dracut
53e9b1
Requires(postun): /usr/bin/dracut
53e9b1
f3328c
f3328c
%description
f3328c
This package provides the Broadcom MegaRAID SAS (%{pkg}) driver. Compared to
f3328c
the in-kernel driver this driver re-enables support for deprecated adapters:
f3328c
f3328c
- 0x1000:0x0060: LSI MegaRAID SAS1078R
f3328c
- 0x1000:0x0078: LSI MegaRAID SAS1078 Gen2
f3328c
- 0x1000:0x007C: LSI MegaRAID SAS1078DE
f3328c
- 0x1000:0x0411: LSI MegaRAID SAS1064R
f3328c
- 0x1000:0x0413: LSI MegaRAID SAS1068 Verde ZCR
f3328c
- 0x1028:0x0015: Dell PERC5
f3328c
f3328c
The removal of the following adapters has been reverted in 4.18.0-290 [1761485]:
f3328c
- 0x1000:0x0071: LSI MegaRAID SAS0071 Skinny
f3328c
- 0x1000:0x0073: LSI MegaRAID SAS0073 Skinny
f3328c
- 0x1000:0x0079: LSI MegaRAID SAS0079 Gen2
f3328c
f3328c
f3328c
%prep
8b966e
%autosetup -p1 -n %{pkg}-%{driver_version}
f3328c
f3328c
f3328c
%build
f3328c
pushd src
f3328c
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
f3328c
popd
f3328c
f3328c
f3328c
%install
f3328c
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/megaraid src/%{pkg}.ko
f3328c
f3328c
# Make .ko objects temporarily executable for automatic stripping
f3328c
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
f3328c
f3328c
f3328c
%clean
f3328c
%{__rm} -rf %{buildroot}
f3328c
f3328c
f3328c
%post
eccca9
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
eccca9
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
eccca9
eccca9
eccca9
%preun
eccca9
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
eccca9
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
f3328c
f3328c
f3328c
%postun
eccca9
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
eccca9
then
eccca9
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
eccca9
    then
eccca9
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
eccca9
    fi
eccca9
53e9b1
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
53e9b1
    then
53e9b1
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
53e9b1
        then
53e9b1
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
53e9b1
            then
53e9b1
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
53e9b1
            else
53e9b1
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
53e9b1
            fi
53e9b1
        fi
53e9b1
    fi
53e9b1
eccca9
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
eccca9
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
eccca9
fi
eccca9
eccca9
eccca9
%posttrans
eccca9
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
eccca9
then
eccca9
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
eccca9
    then
eccca9
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
eccca9
    fi
eccca9
53e9b1
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
53e9b1
    then
53e9b1
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
53e9b1
        then
53e9b1
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
53e9b1
            then
53e9b1
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
53e9b1
            else
53e9b1
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
53e9b1
            fi
53e9b1
        fi
53e9b1
    fi
53e9b1
eccca9
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
eccca9
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
eccca9
fi
f3328c
f3328c
f3328c
%files
f3328c
%defattr(644,root,root,755)
f3328c
/lib/modules/%{kernel_version}.%{_arch}
f3328c
%license COPYING
f3328c
f3328c
f3328c
%changelog
7955f7
* Thu Aug 19 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-331
7955f7
- Rebuild for 4.18.0-331.el8
7955f7
efed5a
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-326
2d0a03
- Update to 4.18.0-326.el8
efed5a
- Fix provides/requires
efed5a
- Fix kernel dependencies
efed5a
- Add convenient provides kmod-aacraid-`uname -r`
efed5a
- Fix installonlypkg detection
efed5a
- Recreate source tarballs
efed5a
- Rebuild for dist = .el8s
efed5a
efed5a
* Fri Jul 23 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18.0-310
f3328c
- Initial version