Blame SPECS/kmod-megaraid_mbox.spec

8374be
%global pkg megaraid_mbox
8374be
45fe45
%global kernel_version 4.18.0-305.17.1.el8_4
8374be
8374be
%global _use_internal_dependency_generator 0
8374be
%global __find_requires %{nil}
8374be
%global __find_provides /usr/lib/rpm/find-provides
8374be
8374be
%global debug_package %{nil}
8374be
8374be
%global __spec_install_post \
8374be
  %{?__debug_package:%{__debug_install_post}} \
8374be
  %{__arch_install_post} \
8374be
  %{__os_install_post} \
8374be
  %{__mod_compress_install_post}
8374be
8374be
%global __mod_compress_install_post find %{buildroot}/lib/modules -type f -name \*.ko -exec xz \{\} \\;
8374be
8374be
8374be
Name:             kmod-%{pkg}
8374be
Version:          4.18
45fe45
Release:          3%{?dist}
8374be
Summary:          LSI Logic MegaRAID (%{pkg}) driver
8374be
8374be
License:          GPLv2
8374be
URL:              https://www.kernel.org/
8374be
8374be
Source0:          %{pkg}-%{version}.tar.xz
8374be
8374be
ExclusiveArch:    x86_64 aarch64
8374be
8374be
BuildRequires:    elfutils-libelf-devel
8374be
BuildRequires:    gcc
8374be
BuildRequires:    kmod
8374be
BuildRequires:    make
8374be
BuildRequires:    redhat-rpm-config
8374be
BuildRequires:    xz
8374be
8374be
BuildRequires:    kernel-devel = %{kernel_version}
8374be
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
8374be
8374be
Requires:         kernel-core = %{kernel_version}
8374be
Requires:         kernel-core-uname-r = %{kernel_version}.%{_arch}
8374be
Requires:         kernel-modules = %{kernel_version}
8374be
Requires:         kernel-modules-uname-r = %{kernel_version}.%{_arch}
8374be
8374be
Provides:         installonlypkg(kernel-module)
87a817
Provides:         kernel-modules = %{kernel_version}.%{_arch}
8374be
Provides:         %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
8374be
8374be
Requires(post):   /usr/sbin/depmod
8374be
Requires(postun): /usr/sbin/depmod
8374be
8374be
Requires(post):   /usr/bin/dracut
8374be
Requires(postun): /usr/bin/dracut
8374be
8374be
Provides:         kmod-megaraid_mm = %{?epoch:%{epoch}:}%{version}-%{release}
8374be
Provides:         kmod-megaraid_mm-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release}
8374be
8374be
8374be
%description
8374be
This package provides the LSI Logic MegaRAID (%{pkg}) driver including the
8374be
required LSI Logic Management Module (megaraid_mm) driver. Supported devices:
8374be
8374be
- 0x1000:0407:1000:0530: LSI MegaRAID SCSI 320-0X
8374be
- 0x1000:0407:1000:0531: LSI MegaRAID SCSI 320-4X
8374be
- 0x1000:0407:1000:0532: LSI MegaRAID SCSI 320-2X
8374be
- 0x1000:0407:1028:0531: Dell PERC4/QC
8374be
- 0x1000:0407:8086:0530: Intel RAID Controller SRCZCRX
8374be
- 0x1000:0407:8086:0532: Intel RAID Controller SRCU42X
8374be
- 0x1000:0408:1000:0001: LSI MegaRAID SCSI 320-1E
8374be
- 0x1000:0408:1000:0002: LSI MegaRAID SCSI 320-2E
8374be
- 0x1000:0408:1025:004D: ACER MegaRAID ROMB-2E
8374be
- 0x1000:0408:1028:0001: Dell PERC 4e/SC
8374be
- 0x1000:0408:1028:0002: Dell PERC 4e/DC
8374be
- 0x1000:0408:1033:8287: NEC MegaRAID PCI Express ROMB
8374be
- 0x1000:0408:1734:1065: FSC MegaRAID PCI Express ROMB
8374be
- 0x1000:0408:8086:0002: Intel RAID Controller SRCU42E
8374be
- 0x1000:0408:8086:3431: Intel RAID Controller SROMBU42E
8374be
- 0x1000:0408:8086:3499: Intel RAID Controller SROMBU42E
8374be
- 0x1000:0409:1000:3004: LSI MegaRAID SATA 300-4X
8374be
- 0x1000:0409:1000:3008: LSI MegaRAID SATA 300-8X
8374be
- 0x1000:0409:8086:3008: Intel RAID Controller SRCS28X
8374be
- 0x1000:1960:1000:0518: LSI MegaRAID SCSI 320-2
8374be
- 0x1000:1960:1000:0520: LSI MegaRAID SCSI 320-1
8374be
- 0x1000:1960:1000:0523: LSI MegaRAID SATA 150-6
8374be
- 0x1000:1960:1000:4523: LSI MegaRAID SATA 150-4
8374be
- 0x1000:1960:1000:A520: LSI MegaRAID SCSI 320-0
8374be
- 0x1000:1960:1028:0518: Dell PERC4/DC
8374be
- 0x1000:1960:1028:0520: Dell PERC4/SC
8374be
- 0x1000:1960:8086:0520: Intel RAID Controller SRCU51L
8374be
- 0x1000:1960:8086:0523: Intel RAID Controller SRCS16
8374be
- 0x101E:1960:1028:0471: Dell PERC3/QC
8374be
- 0x101E:1960:1028:0475: Dell PERC3/SC
8374be
- 0x101E:1960:1028:0493: Dell PERC3/DC
8374be
- 0x1028:000E:1028:0123: Dell PERC3/Di
8374be
- 0x1028:000F:1028:014A: Dell PERC4/Di
8374be
- 0x1028:0013:1028:016C: Dell PERC 4e/Si
8374be
- 0x1028:0013:1028:016D: Dell PERC 4e/Di
8374be
- 0x1028:0013:1028:016E: Dell PERC 4e/Di
8374be
- 0x1028:0013:1028:016F: Dell PERC 4e/Di
8374be
- 0x1028:0013:1028:0170: Dell PERC 4e/Di
8374be
8374be
8374be
%prep
8374be
%autosetup -p1 -n %{pkg}-%{version}
8374be
8374be
8374be
%build
8374be
pushd src
8374be
%{__make} -C /usr/src/kernels/%{kernel_version}.%{_arch} %{?_smp_mflags} M=$PWD modules
8374be
popd
8374be
8374be
8374be
%install
8374be
%{__install} -D -t %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/megaraid src/%{pkg}.ko src/megaraid_mm.ko
8374be
%{__install} -d %{buildroot}/%{_sysconfdir}/dracut.conf.d/
8374be
echo "add_drivers+=\" %{pkg} \"" > %{buildroot}/%{_sysconfdir}/dracut.conf.d/%{pkg}.conf
8374be
8374be
# Make .ko objects temporarily executable for automatic stripping
8374be
find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+
8374be
8374be
8374be
%clean
8374be
%{__rm} -rf %{buildroot}
8374be
8374be
8374be
%post
8374be
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
8374be
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
8374be
8374be
8374be
%preun
8374be
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
8374be
touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
8374be
8374be
8374be
%postun
8374be
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
8374be
then
8374be
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
8374be
    then
8374be
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
8374be
    fi
8374be
8374be
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
8374be
    then
8374be
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
8374be
        then
8374be
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
8374be
            then
8374be
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
8374be
            else
8374be
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
8374be
            fi
8374be
        fi
8374be
    fi
8374be
8374be
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
8374be
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
8374be
fi
8374be
8374be
8374be
%posttrans
8374be
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ]
8374be
then
8374be
    if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ]
8374be
    then
8374be
        /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch}
8374be
    fi
8374be
8374be
    if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ]
8374be
    then
8374be
        if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch}
8374be
        then
8374be
            if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
8374be
            then
8374be
                mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img
8374be
            else
8374be
                rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew
8374be
            fi
8374be
        fi
8374be
    fi
8374be
8374be
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch}
8374be
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
8374be
fi
8374be
8374be
8374be
%files
8374be
%defattr(644,root,root,755)
8374be
/lib/modules/%{kernel_version}.%{_arch}
8374be
%license COPYING
8374be
%config(noreplace) %{_sysconfdir}/dracut.conf.d/%{pkg}.conf
8374be
8374be
8374be
%changelog
45fe45
* Thu Sep  9 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18-3
45fe45
- Set specific kernel version to use
45fe45
- Add Provides kernel-modules
45fe45
- Add .%{_arch} to kernel-modules provides version
45fe45
- Rebuild for 4.18.0-305.17.1.el8_4
45fe45
fe813e
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18-2
fe813e
- Rebuild for 4.18.0-305.12.1.el8_4
fe813e
e600d2
* Wed Aug 11 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18-1
8374be
- Initial version