kernel-srpm-macros/kabi.sh
Eugene Syromiatnikov 6bc05248ec Improve Provides: kernel() generation for built-in modules
After split of the kmods into a separate packages (like kernel-modules
and kernel-modules-extra), kernel() provides for the inbox kmods are generated
for incorrect package, as they were handled by kabi.sh that uses symvers
as a basis for the dependency list.  Stop using it for kmod dependencies
(but continue using it for the symbols provided by vmlinux itself) and
employ find-provides.sh for that purpose.

* kabi.sh: Filter only those symbols that are exported by vmlinux.
* find-provides.ksyms: Generate tags with the "kernel" prefix for kernel
modules inside /lib/modules/[1-9][^/]*/kernel.

Resolves: #1942563
Resolves: #1975927
Resolves: #2002887
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
2021-11-18 14:50:11 +01:00

17 lines
699 B
Bash

#!/bin/bash +x
#
# kabi.sh - Automatically extract any kernel symbol checksum from the
# symvers file and add to RPM deps. This is used to move the
# checksum checking from modprobe to rpm install for 3rd party
# modules (so they can fail during install and not at load).
IFS=$'\n'
for symvers in $(grep -E '(/boot/symvers-.*|/lib/modules/[1-9].*/symvers)\.gz') "$@";
do
# We generate dependencies only for symbols exported by vmlinux itself
# and not for kmods here as they are spread across subpackages,
# so Provides: generation for kmods is handled by find-provides.ksyms.
zcat $symvers | awk '/[^ ]* [^ ]* vmlinux .*/ { print "kernel(" $2 ") = " $1 }'
done