2021-11-17 11:38:00 +00:00
|
|
|
%__kmod_path ^/lib/modules/.*/(modules.builtin|.*\.ko|.*\.ko\.gz|.*\.ko\.bz2|.*\.ko\.xz|.*\.ko\.zst)$
|
2021-05-12 14:55:37 +00:00
|
|
|
%__kmod_provides() %{lua:
|
|
|
|
function basename(fn)
|
|
|
|
return string.gsub(fn, "(.*/)(.*)", "%2")
|
|
|
|
end
|
2021-11-15 23:19:11 +00:00
|
|
|
function strip_compress_sfx(fn)
|
2021-11-17 11:38:00 +00:00
|
|
|
return string.gsub(fn, "(.*)(\.gz|\.bz2|\.xz|\.zst)?$", "%1")
|
2021-11-15 23:19:11 +00:00
|
|
|
end
|
2021-05-12 14:55:37 +00:00
|
|
|
function printdep(mod)
|
2021-11-15 23:19:11 +00:00
|
|
|
print("kmod("..mod..") ")
|
2021-05-12 14:55:37 +00:00
|
|
|
end
|
|
|
|
local fn = rpm.expand("%{1}")
|
|
|
|
local bn = basename(fn)
|
|
|
|
if bn == "modules.builtin" then
|
|
|
|
for l in io.lines(fn) do
|
2021-11-15 23:19:11 +00:00
|
|
|
local builtin_mod = basename(l)
|
|
|
|
printdep(builtin_mod)
|
|
|
|
if strip_compress_sfx(builtin_mod) ~= builtin_mod then
|
|
|
|
printdep(strip_compress_sfx(builtin_mod))
|
|
|
|
end
|
2021-05-12 14:55:37 +00:00
|
|
|
end
|
|
|
|
else
|
|
|
|
local mod = string.match(bn, "%g+.ko")
|
|
|
|
if mod then
|
|
|
|
printdep(mod)
|
2021-11-15 23:19:11 +00:00
|
|
|
if strip_compress_sfx(mod) ~= mod then
|
|
|
|
printdep(strip_compress_sfx(mod))
|
|
|
|
end
|
2021-05-12 14:55:37 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|