Optimize kernel module provides by using a parametric generator
This cuts the kernel provide generation time from ~33s to 2.5s on my laptop. Tighten the path matching rule a bit while at it - it doesn't matter that much with parametric generator but there's no point looking at entries we don't generate dependencies on.
This commit is contained in:
parent
1b85ce0ce8
commit
cecab66c5d
23
kmod.attr
23
kmod.attr
@ -1,2 +1,21 @@
|
|||||||
%__kmod_provides %{_rpmconfigdir}/kmod.prov
|
%__kmod_path ^/lib/modules/.*/(modules.builtin|.*ko)
|
||||||
%__kmod_path ^/lib/modules/.*$
|
%__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
|
||||||
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Summary: Red Hat specific rpm configuration files
|
Summary: Red Hat specific rpm configuration files
|
||||||
Name: redhat-rpm-config
|
Name: redhat-rpm-config
|
||||||
Version: 153
|
Version: 154
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
# No version specified.
|
# No version specified.
|
||||||
License: GPL+
|
License: GPL+
|
||||||
@ -73,7 +73,6 @@ Source501: config.sub
|
|||||||
|
|
||||||
# Dependency generators & their rules
|
# Dependency generators & their rules
|
||||||
Source600: kmod.attr
|
Source600: kmod.attr
|
||||||
Source601: kmod.prov
|
|
||||||
Source602: libsymlink.attr
|
Source602: libsymlink.attr
|
||||||
|
|
||||||
# BRPs
|
# BRPs
|
||||||
@ -162,7 +161,6 @@ install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.*
|
|||||||
|
|
||||||
mkdir -p %{buildroot}%{_fileattrsdir}
|
mkdir -p %{buildroot}%{_fileattrsdir}
|
||||||
install -p -m 644 -t %{buildroot}%{_fileattrsdir} *.attr
|
install -p -m 644 -t %{buildroot}%{_fileattrsdir} *.attr
|
||||||
install -p -m 755 -t %{buildroot}%{_rpmconfigdir} kmod.prov
|
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{_rpmluadir}/fedora/{rpm,srpm}
|
mkdir -p %{buildroot}%{_rpmluadir}/fedora/{rpm,srpm}
|
||||||
install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora common.lua
|
install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora common.lua
|
||||||
@ -182,7 +180,6 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua
|
|||||||
%{rrcdir}/find-requires
|
%{rrcdir}/find-requires
|
||||||
%{rrcdir}/brp-ldconfig
|
%{rrcdir}/brp-ldconfig
|
||||||
%{_fileattrsdir}/*.attr
|
%{_fileattrsdir}/*.attr
|
||||||
%{_rpmconfigdir}/kmod.prov
|
|
||||||
%{_rpmconfigdir}/macros.d/macros.*-srpm
|
%{_rpmconfigdir}/macros.d/macros.*-srpm
|
||||||
%{_rpmconfigdir}/macros.d/macros.dwz
|
%{_rpmconfigdir}/macros.d/macros.dwz
|
||||||
%{_rpmconfigdir}/macros.d/macros.forge
|
%{_rpmconfigdir}/macros.d/macros.forge
|
||||||
@ -209,6 +206,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora/srpm forge.lua
|
|||||||
%{_rpmconfigdir}/macros.d/macros.kmp
|
%{_rpmconfigdir}/macros.d/macros.kmp
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Apr 09 2020 Panu Matilainen <pmatilai@redhat.com> - 154-1
|
||||||
|
- Optimize kernel module provides by using a parametric generator
|
||||||
|
|
||||||
* Thu Feb 20 2020 Jason L Tibbitts III <tibbs@math.uh.edu> - 153-1
|
* Thu Feb 20 2020 Jason L Tibbitts III <tibbs@math.uh.edu> - 153-1
|
||||||
- Add dependency on fonts-srpm-macros, as those have now been approved by FPC.
|
- Add dependency on fonts-srpm-macros, as those have now been approved by FPC.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user