From: Herton R. Krzesinski <herton(a)redhat.com>
rpmspec: amend removal of depmod created files to include modules.builtin.alias.bin
Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1977056
Right now we don't remove the file modules.builtin.alias.bin from the
list of depmod files we already remove at the kernel build time. This
makes it being included in the kernel-core package and being listed
with rpm -V output, eg.:
$ rpm -V kernel-core
(...)
.......T. /lib/modules/5.14.0-0.rc2.23.el9.x86_64/modules.builtin.alias.bin
I just redid the removal command to explicitly call each file created by depmod.
We could by mistake do a glob like modules.builtin.* which would wrongly include
modules.builtin.modinfo for example, so seems safest to do it this way. While at
it I removed the *map glob which may be was needed in the past (may
be very distant past?) but this file is not created anymore. I manually
verified the amended list to what is in kmod sources at tools/depmod.c,
at the depmod_output() function.
This also removes the duplicated removal calls, instead of having to
modify two places, just do a single function and call it in the two places
it's needed.
Signed-off-by: Herton R. Krzesinski <herton(a)redhat.com>
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -1977,10 +1977,16 @@ BuildKernel() {
( find $RPM_BUILD_ROOT/lib/modules/$KernelVer -name '*.ko' | xargs
/sbin/modinfo -l | \
grep -E -v 'GPL( v2)?$|Dual BSD/GPL$|Dual MPL/GPL$|GPL and additional
rights$' ) && exit 1
- # remove files that will be auto generated by depmod at rpm -i time
- pushd $RPM_BUILD_ROOT/lib/modules/$KernelVer/
- rm -f modules.{alias*,builtin.bin,dep*,*map,symbols*,devname,softdep}
- popd
+ remove_depmod_files()
+ {
+ # remove files that will be auto generated by depmod at rpm -i time
+ pushd $RPM_BUILD_ROOT/lib/modules/$KernelVer/
+ rm -f modules.{alias,alias.bin,builtin.alias.bin,builtin.bin} \
+ modules.{dep,dep.bin,devname,softdep,symbols,symbols.bin}
+ popd
+ }
+
+ remove_depmod_files
# Identify modules in the kernel-modules-extras package
%{SOURCE17} $RPM_BUILD_ROOT lib/modules/$KernelVer $RPM_SOURCE_DIR/mod-extra.list
@@ -2032,10 +2038,7 @@ BuildKernel() {
touch lib/modules/$KernelVer/modules.builtin
fi
- # remove files that will be auto generated by depmod at rpm -i time
- pushd $RPM_BUILD_ROOT/lib/modules/$KernelVer/
- rm -f modules.{alias*,builtin.bin,dep*,*map,symbols*,devname,softdep}
- popd
+ remove_depmod_files
# Go back and find all of the various directories in the tree. We use this
# for the dir lists in kernel-core
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1268