Blame SPECS/kmod-qla2xxx.spec

590fb8
%global pkg qla2xxx
590fb8
590fb8
%global driver_version 5.14.0-1.el9
590fb8
3a135a
%global kernel_version 5.14.0-4.el9
590fb8
590fb8
%global _use_internal_dependency_generator 0
590fb8
%global __find_requires %{nil}
590fb8
%global __find_provides /usr/lib/rpm/find-provides
590fb8
590fb8
%global debug_package %{nil}
590fb8
590fb8
%global __spec_install_post \
590fb8
  %{?__debug_package:%{__debug_install_post}} \
590fb8
  %{__arch_install_post} \
590fb8
  %{__os_install_post} \
590fb8
  %{__mod_compress_install_post}
590fb8
590fb8
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
590fb8
590fb8
590fb8
Name:             kmod-%{pkg}
590fb8
Version:          5.14.0
3a135a
Release:          4%{?dist}
590fb8
Summary:          QLogic Fibre Channel HBA (%{pkg}) driver
590fb8
590fb8
License:          GPLv2
590fb8
URL:              https://www.kernel.org/
590fb8
590fb8
Source0:          %{pkg}-%{driver_version}.tar.xz
590fb8
Patch1:           0001-add-deprecated-ids.patch
590fb8
590fb8
ExclusiveArch:    x86_64 aarch64
590fb8
590fb8
BuildRequires:    elfutils-libelf-devel
590fb8
BuildRequires:    gcc
590fb8
BuildRequires:    kmod
590fb8
BuildRequires:    make
590fb8
BuildRequires:    redhat-rpm-config
590fb8
BuildRequires:    xz
590fb8
590fb8
BuildRequires:    kernel-devel = %{kernel_version}
590fb8
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
590fb8
590fb8
Requires:         kernel-core = %{kernel_version}
590fb8
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
590fb8
Requires:         kernel-modules = %{kernel_version}
590fb8
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
590fb8
590fb8
Provides:         installonlypkg(kernel-module)
590fb8
Provides:         kernel-modules = %{kernel_version}.%{_arch}
590fb8
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
590fb8
590fb8
Requires(post):   /usr/sbin/depmod
590fb8
Requires(postun): /usr/sbin/depmod
590fb8
590fb8
Requires(post):   /usr/bin/dracut
590fb8
Requires(postun): /usr/bin/dracut
590fb8
590fb8
590fb8
%description
590fb8
This package provides the QLogic Fibre Channel HBA (%{pkg}) driver. Compared to
590fb8
the in-kernel driver this driver re-enables support for deprecated adapters:
590fb8
590fb8
- 0x1077:0x2100: QLogic ISP2100
590fb8
- 0x1077:0x2200: QLogic ISP2200
590fb8
- 0x1077:0x2300: QLogic ISP2300
590fb8
- 0x1077:0x2312: QLogic ISP2312
590fb8
- 0x1077:0x2322: QLogic ISP2322
590fb8
- 0x1077:0x2422: QLogic ISP2422
590fb8
- 0x1077:0x2432: QLogic ISP2432
590fb8
- 0x1077:0x5422: QLogic ISP5422
590fb8
- 0x1077:0x5432: QLogic ISP5432 / QLE220
590fb8
- 0x1077:0x6312: QLogic ISP6312
590fb8
- 0x1077:0x6322: QLogic ISP6322
590fb8
- 0x1077:0x8001: QLogic ISP8001 / QLE81xx
590fb8
- 0x1077:0x8021: QLogic ISP8021 / QLE82xx
590fb8
- 0x1077:0x8044: QLogic ISP8044 / QLE84xx
590fb8
- 0x1077:0x8432: QLogic ISP8432 / QLE8000
590fb8
- 0x1077:0xF001: QLogic ISPF001 / QLE10000
590fb8
590fb8
590fb8
%prep
590fb8
%autosetup -p1 -n %{pkg}-%{driver_version}
590fb8
590fb8
590fb8
%build
590fb8
pushd src
590fb8
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
590fb8
popd
590fb8
590fb8
590fb8
%install
590fb8
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg} src/%{pkg}.ko
590fb8
590fb8
# Make .ko objects temporarily executable for automatic stripping
590fb8
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
590fb8
590fb8
590fb8
%clean
590fb8
%{__rm} -rf %{buildroot}
590fb8
590fb8
590fb8
%post
590fb8
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
590fb8
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
590fb8
590fb8
590fb8
%preun
590fb8
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
590fb8
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
590fb8
590fb8
590fb8
%postun
590fb8
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
590fb8
then
590fb8
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
590fb8
    then
590fb8
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
590fb8
    fi
590fb8
590fb8
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
590fb8
    then
590fb8
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
590fb8
        then
590fb8
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
590fb8
            then
590fb8
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
590fb8
            else
590fb8
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
590fb8
            fi
590fb8
        fi
590fb8
    fi
590fb8
590fb8
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
590fb8
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
590fb8
fi
590fb8
590fb8
590fb8
%posttrans
590fb8
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
590fb8
then
590fb8
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
590fb8
    then
590fb8
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
590fb8
    fi
590fb8
590fb8
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
590fb8
    then
590fb8
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
590fb8
        then
590fb8
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
590fb8
            then
590fb8
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
590fb8
            else
590fb8
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
590fb8
            fi
590fb8
        fi
590fb8
    fi
590fb8
590fb8
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
590fb8
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
590fb8
fi
590fb8
590fb8
590fb8
%files
590fb8
%defattr(644,root,root,755)
590fb8
/lib/modules/%{kernel_version}.%{_arch}
590fb8
%license COPYING
590fb8
590fb8
590fb8
%changelog
3a135a
* Thu Sep 23 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0-4
3a135a
- Rebuild for 5.14.0-4.el9
3a135a
1ab42d
* Sun Sep 19 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0-3
1ab42d
- Rebuild for 5.14.0-3.el9
1ab42d
31d0b8
* Wed Sep 15 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0-2
31d0b8
- Rebuild for 5.14.0-2.el9
31d0b8
590fb8
* Tue Aug 31 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 5.14.0-1
590fb8
- Initial version