[OS-BUILD PATCHv2 2/2] kernel.spec: fix 'make scripts' for kernel-devel package

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

 



From: Brian Masney <bmasney@xxxxxxxxxx>

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




[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