make modules of different major versions conflict with each other

This commit is contained in:
Mikhail Novosyolov 2022-10-14 15:03:11 +03:00
parent 6b6eb24107
commit 9004602d03
2 changed files with 11 additions and 3 deletions

View file

@ -3,7 +3,7 @@ Name: auto-krokodil
Group: System/Kernel and hardware
License: GPLv3
Url: https://abf.io/import/auto-krokodil
Version: 0.17
Version: 0.18
Release: 1
BuildArch: noarch
%ifarch %{ix86} %{x86_64}

View file

@ -39,6 +39,16 @@ Provides: installonlypkg(kernel) = %{-k*}.%{-m*}.module \
# e.g.: kmod-nvidia390.13-kabi(5.10.71-generic-1rosa2021.1-x86_64) = 456.2e9d1.15 \
Provides: kmod-nvidia%{-j*}.%{-n*}-kabi(%{-p*}) = %{-r*} \
Provides: kmod-nvidia%{-j*}-kabi(%{-p*}) = %{-r*} \
# A generic provide to be able to e.g. "Conflict" with a binary module from dkms if needed \
Provides: kmod-bin-nvidia = %{-j*} \
# When nvidiaXXX is installed, this package with kernel modules is installed,
# but, when nvidiaXXX is removed, this packages is not automatically removed
# as an orphaned package (probably a bug in (lib)dnf) (dnf autoremove does remove it),
# so, when upgrading, to a newer major (j) version of Nvidia driver, modules of both
# versions will be installed, there will be modules of the same name in different
# directories, a random one will be chosen, so force removing an odd module.
Conflicts: kmod-bin-nvidia < %{-j*} \
Conflicts: kmod-bin-nvidia > %{-j*} \
# e.g.: kmod-nvidia390-kabi(5.10.71-generic-1rosa2021.1-x86_64) = 456.2e9d1.15 \
# Do not keep older builds for the same kernel installed via installonlypkg() \
# () and provides are not allowed in Obsoletes, only real package names work as Obsoletes, \
@ -49,8 +59,6 @@ Provides: kmod-nvidia%{-j*}-kabi(%{-p*}) = %{-r*} \
#Conflicts: kmod-nvidia%{-j*}.%{-n*}-kabi(%{-p*}) < %{-r*} \
# e.g.: kmod-nvidia-5.10-generic(390.13) = 456.2e9d1.15 \
Provides: kmod-nvidia-%{-k*}-%{-f*}(%{-j*}.%{-n*}) = %{-r*} \
# generic provide to be able to e.g. "Conflict" with a binary module from dkms if needed \
Provides: kmod-bin-nvidia = %{-j*} \
Requires: kernel-abi(%{-p*}) \
# modules dependencies must be installed when depmod is run \
Requires(post): kernel-abi(%{-p*}) \