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/.*$
|
||||
%__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
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
Summary: Red Hat specific rpm configuration files
|
||||
Name: redhat-rpm-config
|
||||
Version: 153
|
||||
Version: 154
|
||||
Release: 1%{?dist}
|
||||
# No version specified.
|
||||
License: GPL+
|
||||
@ -73,7 +73,6 @@ Source501: config.sub
|
||||
|
||||
# Dependency generators & their rules
|
||||
Source600: kmod.attr
|
||||
Source601: kmod.prov
|
||||
Source602: libsymlink.attr
|
||||
|
||||
# BRPs
|
||||
@ -162,7 +161,6 @@ install -p -m 644 -t %{buildroot}%{_rpmconfigdir}/macros.d macros.*
|
||||
|
||||
mkdir -p %{buildroot}%{_fileattrsdir}
|
||||
install -p -m 644 -t %{buildroot}%{_fileattrsdir} *.attr
|
||||
install -p -m 755 -t %{buildroot}%{_rpmconfigdir} kmod.prov
|
||||
|
||||
mkdir -p %{buildroot}%{_rpmluadir}/fedora/{rpm,srpm}
|
||||
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}/brp-ldconfig
|
||||
%{_fileattrsdir}/*.attr
|
||||
%{_rpmconfigdir}/kmod.prov
|
||||
%{_rpmconfigdir}/macros.d/macros.*-srpm
|
||||
%{_rpmconfigdir}/macros.d/macros.dwz
|
||||
%{_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
|
||||
|
||||
%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
|
||||
- Add dependency on fonts-srpm-macros, as those have now been approved by FPC.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user