[OS-BUILD PATCH 1/2] rpmspec: amend removal of depmod created files to include modules.builtin.alias.bin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Herton R. Krzesinski <herton@xxxxxxxxxx>

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@xxxxxxxxxx>

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
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux