df57f906eb
Previous approach with passing the section contents as a command line
option proven to be error-prone, as it hits the command line option size
limit on some kmods. Move the reading and processing of the section
contents inside the awk script itself; it also saves a bit (around 3—4%)
of time on the kernels with indirect __crc_* symbols:
$ for i in ./lib/modules/*; do \
echo "====== $i ====="; \
diff -u <(find $i | ./find-provides.ksyms.old) <(find $i | ./find-provides.ksyms.new); \
echo -n "old: "; find $i | time ./find-provides.ksyms.old > /dev/null; \
echo -n "new: "; find $i | time ./find-provides.ksyms.new > /dev/null; \
done
====== ./lib/modules/4.18.0-372.57.1.el8_6.s390x =====
old: ./find-provides.ksyms.old > /dev/null 5.38s user 4.66s system 150% cpu 6.693 total
new: ./find-provides.ksyms.new > /dev/null 5.20s user 4.52s system 149% cpu 6.484 total
====== ./lib/modules/4.18.0-372.57.1.el8_6.x86_64 =====
old: ./find-provides.ksyms.old > /dev/null 7.85s user 6.34s system 143% cpu 9.864 total
new: ./find-provides.ksyms.new > /dev/null 7.75s user 6.32s system 143% cpu 9.809 total
====== ./lib/modules/5.14.0-284.15.1.el9_2.s390x =====
old: ./find-provides.ksyms.old > /dev/null 6.19s user 4.68s system 144% cpu 7.506 total
new: ./find-provides.ksyms.new > /dev/null 5.93s user 4.46s system 143% cpu 7.219 total
====== ./lib/modules/5.14.0-284.15.1.el9_2.x86_64 =====
old: ./find-provides.ksyms.old > /dev/null 8.47s user 6.71s system 144% cpu 10.523 total
new: ./find-provides.ksyms.new > /dev/null 8.44s user 6.59s system 144% cpu 10.435 total
====== ./lib/modules/6.4.0-0.rc1.20230511git80e62bc8487b.19.eln126.s390x =====
old: ./find-provides.ksyms.old > /dev/null 5.21s user 4.09s system 145% cpu 6.383 total
new: ./find-provides.ksyms.new > /dev/null 5.04s user 3.85s system 145% cpu 6.120 total
====== ./lib/modules/6.4.0-0.rc1.20230511git80e62bc8487b.19.eln126.x86_64 =====
old: ./find-provides.ksyms.old > /dev/null 8.68s user 5.77s system 139% cpu 10.326 total
new: ./find-provides.ksyms.new > /dev/null 8.47s user 5.57s system 139% cpu 10.067 total
* find-provides.ksyms: Add assign to revbytes the result of endianness
chack test instead of the code snippet; do not generate SECTDATA
variable; do not pass SECTDATA to the awk script; pass module
and revbytes to the awk script; retrieve the section data
into the sectdata variable and perform the byte re-shuffling
in accordance to the revbytes value in the BEGIN section of the awk
script.
* find-requires.ksyms (all_provides): Likewise.
Fixes:
|
||
---|---|---|
tests | ||
.gitignore | ||
brp-kmod-restore-perms | ||
brp-kmod-set-exec-bit | ||
find-provides.ksyms | ||
find-requires.ksyms | ||
firmware.prov | ||
kabi.attr | ||
kabi.sh | ||
kernel-srpm-macros.spec | ||
kmod.attr | ||
kmodtool | ||
macros.kernel-srpm | ||
macros.kmp | ||
modalias.attr | ||
modalias.prov | ||
provided_ksyms.attr | ||
README.md | ||
required_ksyms.attr | ||
rpmsort | ||
sources | ||
symset-table |
kernel-srpm-macros
The kernel-srpm-macros package
This source package results in two "binary" packages, kernel-rpm-macros and kernel-srpm-macros. The role and locations of files is as follows:
kernel-srpm-macros:
/usr/lib/rpm/fileattrs/kmod.attr For /lib/modules/XYZ/modules.builtin and .../MODULE.ko.XYZ specifies a Lua script to generate kmod(MODULE.ko) "Provides:" deps /usr/lib/rpm/macros.d/macros.kernel-srpm Automatically included by all rpm invocations. Defines %kernel_arches (try rpm --eval '%kernel_arches') Question: what uses this macro? I didn't find any users.
kernel-rpm-macros:
/usr/lib/rpm/redhat/find-provides.ksyms Runs from rpmbuild at the end of kernel builds and 3rd party module builds, to extract kernel(SYMBOL)=0xHASH "Provides:" deps from modules in kernel packages, and ksym(SYMBOL)=0xHASH for 3rd party modules. Takes input list of files on stdin. /usr/lib/rpm/fileattrs/provided_ksyms.attr For newer rpmbuild with "internal dependency generators", this file specifies that find-provides.ksyms should be run only on .ko.XYZ files (with "external dependency generators", the script needs to filter out the files by itself).
/usr/lib/rpm/redhat/find-requires.ksyms ? /usr/lib/rpm/fileattrs/required_ksyms.attr For newer rpmbuild with "internal dependency generators", this file specifies that find-requires.ksyms should be run only on .ko.XYZ files, and not for /lib/modules/XYZ/kernel/* (IOW: only for building 3rd-party modules)
/usr/lib/rpm/redhat/find-provides.d/modalias.prov Runs from rpmbuild at the end of kernel builds and 3rd party module builds, to extract modalias(pci:SOMETHING)=OPTIONALLY_VERSION "Provides:" deps from modules in kernel and 3rd party modules packages. Takes input list of files on stdin. Question: what uses these deps? /usr/lib/rpm/fileattrs/modalias.attr For newer rpmbuild with "internal dependency generators", this file specifies that modalias.prov should be run only on .ko.XYZ files
/usr/lib/rpm/redhat/find-provides.d/firmware.prov ?
/usr/lib/rpm/kabi.sh Runs from rpmbuild at the end of kernel build to extract kernel(SYMBOL)=0xHASH "Provides:" deps. /usr/lib/rpm/fileattrs/kabi.attr For newer rpmbuild with "internal dependency generators", this file specifies that kabi.sh should be run on /boot/symvers-* and /lib/modules/XYZ/symvers.gz
/usr/lib/rpm/macros.d/macros.kmp Automatically included by all rpm invocations. Defines a number of macros.
/usr/lib/rpm/redhat/brp-kmod-restore-perms ? /usr/lib/rpm/redhat/brp-kmod-set-exec-bit ?
/usr/lib/rpm/redhat/kmodtool ? /usr/lib/rpm/redhat/rpmsort ? /usr/lib/rpm/redhat/symset-table ?