Add kmod.attr from redhat-rpm-config
This file is currently shipped via the binary redhat-rpm-config package itself, so we need an explicit Conflicts to avoid broken upgrades, as well as actually remove the file from the next redhat-rpm-config build, which we'll also do via #1959924. Related: #1959914
This commit is contained in:
parent
2625834549
commit
a5aed4f0e6
@ -9,6 +9,8 @@ Summary: RPM macros that list arches the full kernel is built on
|
|||||||
License: MIT
|
License: MIT
|
||||||
URL: https://src.fedoraproject.org/rpms/kernel-srpm-macros
|
URL: https://src.fedoraproject.org/rpms/kernel-srpm-macros
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
# We are now the ones shipping kmod.attr
|
||||||
|
Conflicts: redhat-rpm-config <= 184
|
||||||
|
|
||||||
# Macros
|
# Macros
|
||||||
Source0: macros.kernel-srpm
|
Source0: macros.kernel-srpm
|
||||||
@ -20,10 +22,13 @@ Source101: find-requires.ksyms
|
|||||||
Source102: firmware.prov
|
Source102: firmware.prov
|
||||||
Source103: modalias.prov
|
Source103: modalias.prov
|
||||||
|
|
||||||
|
# Dependency generators & their rules
|
||||||
|
Source200: kmod.attr
|
||||||
|
|
||||||
# Misc helper scripts
|
# Misc helper scripts
|
||||||
Source200: kmodtool
|
Source300: kmodtool
|
||||||
Source201: rpmsort
|
Source301: rpmsort
|
||||||
Source202: symset-table
|
Source302: symset-table
|
||||||
|
|
||||||
%global rrcdir /usr/lib/rpm/redhat
|
%global rrcdir /usr/lib/rpm/redhat
|
||||||
|
|
||||||
@ -67,10 +72,12 @@ install -p -m 755 -t %{buildroot}%{rrcdir} kmodtool rpmsort symset-table
|
|||||||
install -p -m 755 -t %{buildroot}%{rrcdir} find-provides.ksyms find-requires.ksyms
|
install -p -m 755 -t %{buildroot}%{rrcdir} find-provides.ksyms find-requires.ksyms
|
||||||
install -p -m 644 -t %{buildroot}%{rrcdir}/find-provides.d firmware.prov modalias.prov
|
install -p -m 644 -t %{buildroot}%{rrcdir}/find-provides.d firmware.prov modalias.prov
|
||||||
install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.kmp
|
install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.kmp
|
||||||
|
install -p -m 644 -t %{buildroot}%{_fileattrsdir} kmod.attr
|
||||||
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%{_rpmconfigdir}/macros.d/macros.kernel-srpm
|
%{_rpmconfigdir}/macros.d/macros.kernel-srpm
|
||||||
|
%{_fileattrsdir}/kmod.attr
|
||||||
|
|
||||||
%files -n kernel-rpm-macros
|
%files -n kernel-rpm-macros
|
||||||
%{_rpmconfigdir}/macros.d/macros.kmp
|
%{_rpmconfigdir}/macros.d/macros.kmp
|
||||||
@ -85,7 +92,7 @@ install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.kmp
|
|||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Wed May 12 2021 Michal Domonkos <mdomonko@redhat.com> - 1.0-6
|
* Wed May 12 2021 Michal Domonkos <mdomonko@redhat.com> - 1.0-6
|
||||||
- Adopt kernel-rpm-macros subpackage from redhat-rpm-config
|
- Adopt kernel-rpm-macros subpackage & kmod.attr from redhat-rpm-config
|
||||||
- Resolves: #1959914
|
- Resolves: #1959914
|
||||||
|
|
||||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.0-5
|
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.0-5
|
||||||
|
21
kmod.attr
Normal file
21
kmod.attr
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
%__kmod_path ^/lib/modules/.*/(modules.builtin|.*ko)
|
||||||
|
%__kmod_provides() %{lua:
|
||||||
|
function basename(fn)
|
||||||
|
return string.gsub(fn, "(.*/)(.*)", "%2")
|
||||||
|
end
|
||||||
|
function printdep(mod)
|
||||||
|
print("kmod("..mod..")")
|
||||||
|
end
|
||||||
|
local fn = rpm.expand("%{1}")
|
||||||
|
local bn = basename(fn)
|
||||||
|
if bn == "modules.builtin" then
|
||||||
|
for l in io.lines(fn) do
|
||||||
|
printdep(basename(l))
|
||||||
|
end
|
||||||
|
else
|
||||||
|
local mod = string.match(bn, "%g+.ko")
|
||||||
|
if mod then
|
||||||
|
printdep(mod)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user