From: Prarit Bhargava <[email protected]>

redhat/kernel.spec.template: Fix internal "File listed twice" errors

Executing an rpm build results in a "File listed twice" error for every
file in the modules-internal subpackage.

The modules-internal subpackage's file list is created by mod-denylist.sh.
The file contains both the path to the internal directory and separately
lists out each file.

ie) the contents of the file list are

<snip>
/lib/modules/6.2.0-0.rc4.7287904c8771.33.test.fc36.x86_64/internal/net/mptcp/mptcp_crypto_test.ko.xz/lib/modules/6.2.0-0.rc4.7287904c8771.33.test.fc36.x86_64/internal/net/mptcp/mptcp_token_test.ko.xz
/lib/modules/6.2.0-0.rc4.7287904c8771.33.test.fc36.x86_64/internal/sound/soc/soc-topology-test.ko.xz/lib/modules/6.2.0-0.rc4.7287904c8771.33.test.fc36.x86_64/internal/sound/soc/soc-utils-test.ko.xz
/lib/modules/6.2.0-0.rc4.7287904c8771.33.test.fc36.x86_64/internal

The rpm build interprets this as including each file individually and also
recursively including the files below the internal directory, ie) each
file is listed twice.  The rpm build then throws errors for each file:

    File listed twice: 
/lib/modules/6.2.0-0.rc4.7287904c8771.33.test.fc36.x86_64/internal/net/mptcp/mptcp_crypto_test.ko.xz
    File listed twice: 
/lib/modules/6.2.0-0.rc4.7287904c8771.33.test.fc36.x86_64/internal/net/mptcp/mptcp_token_test.ko.xz
    File listed twice: 
/lib/modules/6.2.0-0.rc4.7287904c8771.33.test.fc36.x86_64/internal/sound/soc/soc-topology-test.ko.xz
    File listed twice: 
/lib/modules/6.2.0-0.rc4.7287904c8771.33.test.fc36.x86_64/internal/sound/soc/soc-utils-test.ko.xz

Fix the "File listed twice" errors by only including the internal directory in 
the
modules-internal subpackage file list.

Additional fix: Make the same fix for the modules-partner subpackge.

Signed-off-by: Prarit Bhargava <[email protected]>

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
@@ -2208,10 +2208,6 @@ BuildKernel() {
     sed -e 's/^lib*/%dir \/lib/' %{?zipsed} $RPM_BUILD_ROOT/module-dirs.list > 
../kernel${Variant:+-${Variant}}-modules-core.list
     sed -e 's/^lib*/\/lib/' %{?zipsed} $RPM_BUILD_ROOT/modules.list >> 
../kernel${Variant:+-${Variant}}-modules-core.list
     sed -e 's/^lib*/\/lib/' %{?zipsed} $RPM_BUILD_ROOT/mod-extra.list >> 
../kernel${Variant:+-${Variant}}-modules-extra.list
-    sed -e 's/^lib*/\/lib/' %{?zipsed} $RPM_BUILD_ROOT/mod-internal.list >> 
../kernel${Variant:+-${Variant}}-modules-internal.list
-%if 0%{!?fedora:1}
-    sed -e 's/^lib*/\/lib/' %{?zipsed} $RPM_BUILD_ROOT/mod-partner.list >> 
../kernel${Variant:+-${Variant}}-modules-partner.list
-%endif
 
     # Cleanup
     rm -f $RPM_BUILD_ROOT/k-d.list
@@ -3176,9 +3172,11 @@ fi
 %{expand:%%files %{?3:%{3}-}devel-matched}\
 %{expand:%%files -f kernel-%{?3:%{3}-}modules-extra.list 
%{?3:%{3}-}modules-extra}\
 %config(noreplace) /etc/modprobe.d/*-blacklist.conf\
-%{expand:%%files -f kernel-%{?3:%{3}-}modules-internal.list 
%{?3:%{3}-}modules-internal}\
+%{expand:%%files %{?3:%{3}-}modules-internal}\
+/lib/modules/%{KVERREL}%{?3:+%{3}}/internal\
 %if 0%{!?fedora:1}\
-%{expand:%%files -f kernel-%{?3:%{3}-}modules-partner.list 
%{?3:%{3}-}modules-partner}\
+%{expand:%%files %{?3:%{3}-}modules-partner}\
+/lib/modules/%{KVERREL}%{?3:+%{3}}/partner\
 %endif\
 %if %{with_debuginfo}\
 %ifnarch noarch\

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2255
_______________________________________________
kernel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
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/[email protected]
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to