Blame SPECS/kmod-megaraid_mbox.spec

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