diff --git a/.gitignore b/.gitignore index 7c56fdb..cff174f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/mpt3sas-5.14.0-1.el9.tar.xz +SOURCES/mpt3sas-5.14.0-24.el9.tar.xz diff --git a/.kmod-mpt3sas.metadata b/.kmod-mpt3sas.metadata index 6876067..40c66dc 100644 --- a/.kmod-mpt3sas.metadata +++ b/.kmod-mpt3sas.metadata @@ -1 +1 @@ -22e0d91cd6ab8e27fe3c5fa10b05ab6e26976e9e SOURCES/mpt3sas-5.14.0-1.el9.tar.xz +5f0e4113ec2dc35dda5022abab89bdaab3a38c4d SOURCES/mpt3sas-5.14.0-24.el9.tar.xz diff --git a/SOURCES/0001-add-deprecated-ids.patch b/SOURCES/0001-add-deprecated-ids.patch index d9152b8..62e7747 100644 --- a/SOURCES/0001-add-deprecated-ids.patch +++ b/SOURCES/0001-add-deprecated-ids.patch @@ -1,6 +1,6 @@ --- a/src/mpt3sas_scsih.c +++ b/src/mpt3sas_scsih.c -@@ -12480,7 +12480,6 @@ +@@ -12564,7 +12564,6 @@ * The pci device ids are defined in mpi/mpi2_cnfg.h. */ static const struct pci_device_id mpt3sas_pci_table[] = { @@ -8,7 +8,7 @@ /* Spitfire ~ 2004 */ { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2004, PCI_ANY_ID, PCI_ANY_ID }, -@@ -12499,7 +12498,6 @@ +@@ -12583,7 +12582,6 @@ PCI_ANY_ID, PCI_ANY_ID }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2116_2, PCI_ANY_ID, PCI_ANY_ID }, @@ -16,7 +16,7 @@ /* Thunderbolt ~ 2208 */ { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2208_1, PCI_ANY_ID, PCI_ANY_ID }, -@@ -12524,11 +12522,9 @@ +@@ -12608,11 +12606,9 @@ PCI_ANY_ID, PCI_ANY_ID }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SWITCH_MPI_EP_1, PCI_ANY_ID, PCI_ANY_ID }, diff --git a/SPECS/kmod-mpt3sas.spec b/SPECS/kmod-mpt3sas.spec index bf5b25d..2721ee4 100644 --- a/SPECS/kmod-mpt3sas.spec +++ b/SPECS/kmod-mpt3sas.spec @@ -1,12 +1,8 @@ %global pkg mpt3sas -%global driver_version 5.14.0-1.el9 +%global driver_version 5.14.0-24.el9 -%global kernel_version 5.14.0-4.el9 - -%global _use_internal_dependency_generator 0 -%global __find_requires %{nil} -%global __find_provides /usr/lib/rpm/find-provides +%global kernel_version 5.14.0-31.el9 %global debug_package %{nil} @@ -20,8 +16,8 @@ Name: kmod-%{pkg} -Version: 5.14.0 -Release: 4%{?dist} +Version: 5.14.0.24 +Release: 1%{?dist} Summary: LSI MPT Fusion SAS 3.0 Device (%{pkg}) driver License: GPLv2 @@ -34,28 +30,29 @@ ExclusiveArch: x86_64 aarch64 BuildRequires: elfutils-libelf-devel BuildRequires: gcc +BuildRequires: kernel-rpm-macros BuildRequires: kmod BuildRequires: make BuildRequires: redhat-rpm-config BuildRequires: xz +BuildRequires: kernel-abi-stablelists = %{kernel_version} BuildRequires: kernel-devel = %{kernel_version} BuildRequires: kernel-devel-uname-r = %{kernel_version}.%{_arch} -Requires: kernel-core = %{kernel_version} -Requires: kernel-core-uname-r = %{kernel_version}.%{_arch} -Requires: kernel-modules = %{kernel_version} -Requires: kernel-modules-uname-r = %{kernel_version}.%{_arch} +Requires: kernel >= %{kernel_version} +Requires: kernel-uname-r >= %{kernel_version}.%{_arch} +Requires: kernel-modules >= %{kernel_version} +Requires: kernel-modules-uname-r >= %{kernel_version}.%{_arch} Provides: installonlypkg(kernel-module) -Provides: kernel-modules = %{kernel_version}.%{_arch} -Provides: %{name}-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release} +Provides: kernel-modules >= %{kernel_version}.%{_arch} -Requires(post): /usr/sbin/depmod -Requires(postun): /usr/sbin/depmod +Requires(post): %{_sbindir}/depmod +Requires(postun): %{_sbindir}/depmod -Requires(post): /usr/bin/dracut -Requires(postun): /usr/bin/dracut +Requires(post): %{_sbindir}/weak-modules +Requires(postun): %{_sbindir}/weak-modules %description @@ -89,6 +86,13 @@ popd # Make .ko objects temporarily executable for automatic stripping find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+ +# Generate depmod.conf +%{__install} -d %{buildroot}/%{_sysconfdir}/depmod.d/ +for kmod in $(find %{buildroot}/lib/modules/%{kernel_version}.%{_arch}/extra -type f -name \*.ko -printf "%%P\n" | sort) +do + echo "override $(basename $kmod .ko) * weak-updates/$(dirname $kmod)" >> %{buildroot}/%{_sysconfdir}/depmod.d/%{pkg}.conf +done + %clean %{__rm} -rf %{buildroot} @@ -96,63 +100,36 @@ find %{buildroot}/lib/modules -type f -name \*.ko -exec chmod u+x \{\} \+ %post mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods -touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} +printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/scsi/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add %preun mkdir -p %{_localstatedir}/lib/rpm-state/sig-kmods -touch %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} +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 %postun -if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ] +if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove ] then - if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ] - then - /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch} - fi - - if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ] - then - if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch} - then - if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew - then - mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img - else - rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew - fi - fi - fi - - rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} + modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove) ) + rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods + printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --remove-modules fi +%pretrans -p +posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add") +posix.unlink("%{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-remove") + + %posttrans -if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} ] +if [ -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add ] then - if [ -f /lib/modules/%{kernel_version}.%{_arch}/System.map ] - then - /usr/sbin/depmod -aeF /lib/modules/%{kernel_version}.%{_arch}/System.map %{kernel_version}.%{_arch} - fi - - if [ -f /boot/initramfs-%{kernel_version}.%{_arch}.img ] - then - if /usr/bin/dracut -f --rebuild /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew %{kernel_version}.%{_arch} - then - if ! cmp -s /boot/initramfs-%{kernel_version}.%{_arch}.img /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew - then - mv /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew /boot/initramfs-%{kernel_version}.%{_arch}.img - else - rm -f /boot/initramfs-%{kernel_version}.%{_arch}.img.rpmnew - fi - fi - fi - - rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/%{kernel_version}.%{_arch} + modules=( $(cat %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add) ) + rm -f %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add rmdir --ignore-fail-on-non-empty %{_localstatedir}/lib/rpm-state/sig-kmods + printf '%s\n' "${modules[@]}" | %{_sbindir}/weak-modules --add-modules fi @@ -160,17 +137,9 @@ fi %defattr(644,root,root,755) /lib/modules/%{kernel_version}.%{_arch} %license COPYING +%config(noreplace) %{_sysconfdir}/depmod.d/%{pkg}.conf %changelog -* Thu Sep 23 2021 Peter Georg - 5.14.0-4 -- Rebuild for 5.14.0-4.el9 - -* Sun Sep 19 2021 Peter Georg - 5.14.0-3 -- Rebuild for 5.14.0-3.el9 - -* Wed Sep 15 2021 Peter Georg - 5.14.0-2 -- Rebuild for 5.14.0-2.el9 - -* Tue Aug 31 2021 Peter Georg - 5.14.0-1 -- Initial version +* Thu Dec 16 2021 Peter Georg - 5.14.0.24-1 +- Convert to kABI tracking kmod package (kernel >= 5.14.0-31.el9)