redhat-rpm-config/kmod.attr
Panu Matilainen cecab66c5d 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.
2020-04-09 14:36:16 +03:00

22 lines
505 B
Plaintext

%__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
}