mirror of
https://abf.rosa.ru/djam/kernel-5.15.git
synced 2025-02-23 10:32:54 +00:00

Imagine that a user installed a kernel. After some time he installed a binary kernel module. During upgrades there will be missync because dnf will keep different versions of kernels and modules via instlalonlypkg()
40 lines
1.6 KiB
Text
40 lines
1.6 KiB
Text
# ksobirator RPM macros
|
|
# For now they are bundled in the kernel package,
|
|
# in the future, after testing, ksobirator will become a separate package
|
|
# which will be BuildRequired from kernel packages
|
|
|
|
# TODO: define it somewhere else...
|
|
# TODO: avoid depending from %%flavour, %%buildrel etc ?!
|
|
# TODO: fail if needed macros are not defined
|
|
%ksob_kernel %{kernelversion}.%{patchlevel}-%{flavour}
|
|
|
|
# %%ksob_mk_module_pkg -n module name -s module section [ -r additional requires for this package ]
|
|
# Examples:
|
|
# %%ksob_mk_module_pkg -n shredder -s extra -r /usr/bin/wipe
|
|
# %%ksob_mk_module_pkg -n shredder -s extra
|
|
%ksob_mk_module_pkg(n:s:r:) \
|
|
\
|
|
%define module_name %{-n:%{-n*}}%{!-n:%{error:Module name not defined!}} \
|
|
%define pkg_main kernel-module-%{module_name}-%{ksob_kernel} \
|
|
%define module_section %{-s:%{-s*}}%{!-s:%{error:Module section (e.g. extra) not defined!}} \
|
|
\
|
|
%{expand: \
|
|
%package -n %{pkg_main} \
|
|
# TODO: convert long kernel name to one macro \
|
|
Summary: Binary module %{module_name} for kernel-%{ksob_kernel} \
|
|
Group: System/Kernel and hardware \
|
|
\
|
|
%{-r:Requires: %{-r*}} \
|
|
Requires: %{name}%{_isa} = %{EVRD} \
|
|
Provides: installonlypkg(kernel-module) = %{EVRD}.module.%{module_name} \
|
|
Obsoletes: kernel-module-%{module_name}-%{flavour}-%{kernelversion}.%{patchlevel}-latest < 5.10.34-2 \
|
|
\
|
|
%description -n %{pkg_main} \
|
|
Binary module %{module_name} for kernel-%{ksob_kernel} \
|
|
\
|
|
%files -n %{pkg_main} \
|
|
# XXX TODO: how to %%exclude these files from the main package automatically? \
|
|
%{_modulesdir}/%{kver_full}/kernel/%{module_section}/%{module_name}.ko%{kmod_suffix} \
|
|
\
|
|
%{nil} \
|
|
}
|