Blame SPECS/kmod-megaraid_mbox.spec

ca3bb5
%global pkg megaraid_mbox
ca3bb5
a276b7
%global kernel_version 4.18.0-348.el8
ca3bb5
ca3bb5
%global _use_internal_dependency_generator 0
fc5836
%global __find_requires /usr/lib/rpm/redhat/find-requires
fc5836
%global __find_provides /usr/lib/rpm/redhat/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
a276b7
Release:          7%{?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
fc5836
BuildRequires:    kernel-rpm-macros
ca3bb5
BuildRequires:    kmod
ca3bb5
BuildRequires:    make
ca3bb5
BuildRequires:    redhat-rpm-config
ca3bb5
BuildRequires:    xz
ca3bb5
fc5836
BuildRequires:    kernel-abi-stablelists = %{kernel_version}
ca3bb5
BuildRequires:    kernel-devel = %{kernel_version}
ca3bb5
BuildRequires:    kernel-devel-uname-r = %{kernel_version}.%{_arch}
ca3bb5
fc5836
Requires:         kernel >= %{kernel_version}
fc5836
Requires:         kernel-uname-r >= %{kernel_version}.%{_arch}
fc5836
Requires:         kernel-modules >= %{kernel_version}
fc5836
Requires:         kernel-modules-uname-r >= %{kernel_version}.%{_arch}
ca3bb5
ca3bb5
Provides:         installonlypkg(kernel-module)
fc5836
Provides:         kernel-modules >= %{kernel_version}.%{_arch}
ca3bb5
fc5836
Requires(post):   %{_sbindir}/depmod
fc5836
Requires(postun): %{_sbindir}/depmod
ca3bb5
fc5836
Requires(post):   %{_sbindir}/weak-modules
fc5836
Requires(postun): %{_sbindir}/weak-modules
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
fc5836
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/megaraid/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
fc5836
printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/megaraid/megaraid_mm.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
ca3bb5
ca3bb5
ca3bb5
%preun
ca3bb5
mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods
fc5836
rpm -ql kmod-%{pkg}-%{?epoch:%{epoch}:}%{version}-%{release}.%{_arch} | grep '/lib/modules/%{kernel_version}.%{_arch}/.*\.ko\.xz$' >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
ca3bb5
ca3bb5
ca3bb5
%postun
fc5836
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ]
ca3bb5
then
fc5836
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) )
fc5836
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove
ca3bb5
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
fc5836
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules
ca3bb5
fi
ca3bb5
ca3bb5
fc5836
%pretrans -p <lua>
fc5836
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add")
fc5836
posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove")
fc5836
fc5836
ca3bb5
%posttrans
fc5836
if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ]
ca3bb5
then
fc5836
    modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) )
fc5836
    rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add
ca3bb5
    rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods
fc5836
    printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules
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
a276b7
* Thu Oct 21 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18-7
a276b7
- Rebuild for 4.18.0-348.el8
a276b7
178e7f
* Wed Sep 29 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18-6
178e7f
- Rebuild for 4.18.0-338.el8
178e7f
fc5836
* Tue Sep 28 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18-5
fc5836
- Convert to kABI tracking kmod package (kernel >= 4.18.0-315.el8)
fc5836
bb2e47
* Mon Aug 30 2021 Peter Georg <peter.georg@physik.uni-regensburg.de> - 4.18-4
bb2e47
- Set specific kernel version to use
bb2e47
- Add Provides kernel-modules
bb2e47
- Add .%{_arch} to kernel-modules provides version
bb2e47
- Rebuild for 4.18.0-338.el8
bb2e47
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