Compare commits
No commits in common. 'c9' and 'c10-beta' have entirely different histories.
@ -1,31 +1,54 @@
|
|||||||
%__kmod_path ^/lib/modules/.*/(modules.builtin|.*\.ko|.*\.ko\.gz|.*\.ko\.bz2|.*\.ko\.xz|.*\.ko\.zst)$
|
%__kmod_path ^/lib/modules/.*/(modules.builtin|.*\.ko|.*\.ko\.gz|.*\.ko\.bz2|.*\.ko\.xz|.*\.ko\.zst)$
|
||||||
|
|
||||||
|
# Notes on Lua:
|
||||||
|
# The backslash in strings (like "\n" newline) needs to be doubled
|
||||||
|
# because we are inside rpm macro. Single backslashes before most chars
|
||||||
|
# disappear (removed by rpm's parser), so "\n" turns into just "n".
|
||||||
|
# In string.gsub patterns, unlike regexps, backslash has no special meaning.
|
||||||
|
# It can't escape . and such. (Use one-character set [.] to represent
|
||||||
|
# literal period, or lua's percent escape: %.)
|
||||||
|
# Pipe (|) has no special meaning too.
|
||||||
|
|
||||||
%__kmod_provides() %{lua:
|
%__kmod_provides() %{lua:
|
||||||
function basename(fn)
|
function basename(fn)
|
||||||
return string.gsub(fn, "(.*/)(.*)", "%2")
|
local b = string.gsub(fn, ".*/", "")
|
||||||
|
-- the above adjusts gsub() result to 1 value
|
||||||
|
-- "return f()" construct would return _all_ values, two in case of gsub()
|
||||||
|
return b
|
||||||
end
|
end
|
||||||
function strip_compress_sfx(fn)
|
function strip_compress_sfx(fn)
|
||||||
return string.gsub(fn, "(.*)(\.gz|\.bz2|\.xz|\.zst)?$", "%1")
|
local cnt
|
||||||
|
fn, cnt = string.gsub(fn, "%.gz$", "")
|
||||||
|
if cnt == 1 then return fn; end
|
||||||
|
fn, cnt = string.gsub(fn, "%.bz2$", "")
|
||||||
|
if cnt == 1 then return fn; end
|
||||||
|
fn, cnt = string.gsub(fn, "%.xz$", "")
|
||||||
|
if cnt == 1 then return fn; end
|
||||||
|
fn, cnt = string.gsub(fn, "%.zst$", "")
|
||||||
|
return fn
|
||||||
end
|
end
|
||||||
function printdep(mod)
|
function printdep(mod)
|
||||||
print("kmod("..mod..") ")
|
print("kmod("..mod..") ")
|
||||||
end
|
end
|
||||||
local fn = rpm.expand("%{1}")
|
local fn = rpm.expand("%1")
|
||||||
local bn = basename(fn)
|
local bn = basename(fn)
|
||||||
if bn == "modules.builtin" then
|
if bn == "modules.builtin" then
|
||||||
for l in io.lines(fn) do
|
for l in io.lines(fn) do
|
||||||
local builtin_mod = basename(l)
|
local builtin_mod = basename(l)
|
||||||
printdep(builtin_mod)
|
printdep(builtin_mod)
|
||||||
if strip_compress_sfx(builtin_mod) ~= builtin_mod then
|
local nocompr = strip_compress_sfx(builtin_mod)
|
||||||
printdep(strip_compress_sfx(builtin_mod))
|
if nocompr ~= builtin_mod then
|
||||||
|
printdep(nocompr)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local mod = string.match(bn, "%g+.ko")
|
local mod = string.match(bn, "%g+%.ko")
|
||||||
if mod then
|
if mod then
|
||||||
printdep(mod)
|
printdep(mod)
|
||||||
if strip_compress_sfx(mod) ~= mod then
|
local nocompr = strip_compress_sfx(mod)
|
||||||
printdep(strip_compress_sfx(mod))
|
if nocompr ~= mod then
|
||||||
end
|
printdep(nocompr)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# kernel_arches lists what arches the full kernel is built for.
|
# kernel_arches lists what arches the full kernel is built for.
|
||||||
|
|
||||||
%kernel_arches x86_64 s390x ppc64le aarch64 %{arm}
|
%kernel_arches x86_64 s390x ppc64le aarch64 %{arm} riscv64
|
||||||
|
Loading…
Reference in new issue