From: Brian Masney <[email protected]>

Upstream status: RHEL only

Running 'make scripts' in /usr/src/kernels/$VERSION triggers the
following error:

    scripts/selinux/genheaders/genheaders.c:19:10: fatal error:
    classmap.h: No such file or directory

Let's fix that by including the necessary two files from the
directory security/selinux/include/ in the kernel-devel package.
Once those files are added, another error is triggered:

    scripts/sortextable.c:31:10: fatal error: tools/be_byteshift.h:
    No such file or directory

Let's correct that error by adding two more files from tools/include/
to the kernel-devel package as well. This will get 'make scripts'
working.

This change adds 20K (before compression) to the kernel-devel package.

Signed-off-by: Brian Masney <[email protected]>
---
 redhat/kernel.spec.template | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index 836fe8cb6af9..1c8c99e2fbac 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -1601,6 +1601,15 @@ BuildKernel() {
     cp -a scripts $RPM_BUILD_ROOT/lib/modules/$KernelVer/build
     rm -rf $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/tracing
     rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/scripts/spdxcheck.py
+
+    # Files for 'make scripts' to succeed with kernel-devel.
+    mkdir -p 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build/security/selinux/include
+    cp -a --parents security/selinux/include/classmap.h 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
+    cp -a --parents security/selinux/include/initial_sid_to_string.h 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
+    mkdir -p $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/tools/include/tools
+    cp -a --parents tools/include/tools/be_byteshift.h 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
+    cp -a --parents tools/include/tools/le_byteshift.h 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build
+
     if [ -f tools/objtool/objtool ]; then
       cp -a tools/objtool/objtool 
$RPM_BUILD_ROOT/lib/modules/$KernelVer/build/tools/objtool/ || :
     fi
-- 
2.26.2
_______________________________________________
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]

Reply via email to