From 06449db1c3582d547d10d70fa0d2b7efa46e0167 Mon Sep 17 00:00:00 2001 From: Peter Georg Date: Sep 28 2021 15:36:16 +0000 Subject: Convert to kABI-tracking kmod package --- diff --git a/SPECS/kmod-iwlegacy.spec b/SPECS/kmod-iwlegacy.spec index 0aa9094..33c9edd 100644 --- a/SPECS/kmod-iwlegacy.spec +++ b/SPECS/kmod-iwlegacy.spec @@ -1,10 +1,10 @@ %global pkg iwlegacy -%global kernel_version 4.18.0-305.19.1.el8_4 +%global kernel_version 4.18.0-305.7.1.el8_4 %global _use_internal_dependency_generator 0 -%global __find_requires %{nil} -%global __find_provides /usr/lib/rpm/find-provides +%global __find_requires /usr/lib/rpm/redhat/find-requires +%global __find_provides /usr/lib/rpm/redhat/find-provides %global debug_package %{nil} @@ -19,7 +19,7 @@ Name: kmod-%{pkg} Version: 5.9 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Intel WiFi 3945ABG/BG (iwl3945) and 4965AGN (iwl4965) driver License: GPLv2 @@ -31,28 +31,29 @@ ExclusiveArch: x86_64 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 Provides: kmod-iwl3945 = %{?epoch:%{epoch}:}%{version}-%{release} Provides: kmod-iwl3945-%{kernel_version}.%{_arch} = %{?epoch:%{epoch}:}%{version}-%{release} @@ -94,63 +95,38 @@ 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/net/wireless/intel/%{pkg}/%{pkg}.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add +printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/wireless/intel/%{pkg}/iwl3945.ko.xz" >> %{_localstatedir}/lib/rpm-state/sig-kmods/weak-modules-add +printf '%s\n' "/lib/modules/%{kernel_version}.%{_arch}/extra/drivers/net/wireless/intel/%{pkg}/iwl4965.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 @@ -161,6 +137,9 @@ fi %changelog +* Tue Sep 28 2021 Peter Georg - 5.9-6 +- Convert to kABI tracking kmod package (kernel >= 4.18.0-305.7.1.el8_4) + * Wed Sep 15 2021 Peter Georg - 5.9-5 - Rebuild for 4.18.0-305.19.1.el8_4