Blame SPECS/kmod-megaraid_sas.spec

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