Bug 1758710 - make scripts fails citing classmap.h does not exist. [NEEDINFO]
Summary: make scripts fails citing classmap.h does not exist.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel-headers
Version: 30
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Justin M. Forbes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-04 23:12 UTC by bob
Modified: 2020-09-18 06:05 UTC (History)
12 users (show)

Fixed In Version: kernel-headers-5.3.11-300.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-13 06:36:29 UTC
Type: Bug
rmderbes: needinfo? (jforbes)


Attachments (Terms of Use)
nvidia driver install log (155.46 KB, text/plain)
2019-10-09 04:42 UTC, bob
no flags Details

Description bob 2019-10-04 23:12:56 UTC
Description of problem:

Attempting to build NV video drivers after dnf system upgrade of F29 to F30.  Kernel driver build fails citing absence of classmap.h on disk.  
Reinstall of kernel-headers fails to clear the error.
"make scripts" fails, citing the absence of classmap.h

Version-Release number of selected component (if applicable):

/usr/src/kernels/5.2.17-200.fc30.x86_64 

How reproducible:

Always

Steps to Reproduce:
1. F29 to F30 upgrade via dnf system upgrade
2. "make scripts" fails, citing classmap.h file not found
3. reinstalling kernel-headers doesn't help

Actual results:

After issuing the command "make headers_check && make headers_install && make scripts" the first two commands succeed but the third command fails:

# make scripts
  HOSTCC  scripts/selinux/genheaders/genheaders
scripts/selinux/genheaders/genheaders.c:18:10: fatal error: classmap.h: No such file or directory
   18 | #include "classmap.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.host:90: scripts/selinux/genheaders/genheaders] Error 1
make[2]: *** [scripts/Makefile.build:489: scripts/selinux/genheaders] Error 2
make[1]: *** [scripts/Makefile.build:489: scripts/selinux] Error 2
make: *** [Makefile:1091: scripts] Error 2


# find / -type f -name "classmap.h"
<no matching file is found> 


Expected results:

"make scripts" should work

Additional info:

Comment 1 bob 2019-10-04 23:22:08 UTC
At the risk of stating the obvious, this problem occurs when trying to rebuild kernel headers, and it appears to be due to a missing header file, and isn't an Nvidia-related problem.  I only discovered the apparent header problem when investigating a problem building the NV driver.  thanks.

Comment 2 Laura Abbott 2019-10-07 17:30:17 UTC
To clarify, this isn't with kernel-headers which refers to the uapi headers that get installed in include but this is with the kernel-devel package. You shouldn't technically need to explicitly do any of those commands because the genheaders binary is already present. What was the last kernel version that worked and where are you getting those instructions to run those commands?

Comment 3 bob 2019-10-09 04:21:20 UTC
Thanks for your help.

Everything was working fine on an F28 box.  Things broke when I tried to do the distro upgrades to F29 and F30.
The oldest kernel on this list is the last one that worked in F28.  the two later kernels represent the default kernels installed when I attempted upgrades to F29 and F30.
The F28 kernel worked fine.  Both the F29 and F30 kernels failed.

# vdir /usr/src/kernels 
total 12K
drwxr-xr-x. 23 root root 4.0K Jun 24 13:51 5.0.16-100.fc28.x86_64
drwxr-xr-x. 22 root root 4.0K Oct  4 01:58 5.2.17-100.fc29.x86_64
drwxr-xr-x. 23 root root 4.0K Oct  4 18:15 5.2.17-200.fc30.x86_64

The problem came along when trying to upgrade an F28 box to F29 and F30.  the box uses an Nvidia Quadro 400 graphics card that requires the Nvidia "340" series drivers that are installed using the "NVIDIA-Linux-x86_64-340.107.run" installer. 


The specific instructions to issue the associated kernel commands are provided by the nvidia installer log when the nvidia driver build fails. The log mentions the missing classmap.h file and gives the specific instructions to compile the scripts.  It appears that everytnig fails because the nvidia driver doesn't care if the binaries are present, it's compiling from source and looking for the classmap.h file and that file looks like it's missing.  

I don't have a copy of the nvidia installer log at the moment, as it appears to have been autopurged by falling back to nouveau.  I'll see if I can generate another one.

Comment 4 bob 2019-10-09 04:42:39 UTC
Created attachment 1623684 [details]
nvidia driver install log

/var/log/nvidia-installer.log file created by nvidia driver build script.

Comment 5 bob 2019-10-09 04:52:44 UTC
Here is an excerpt from the nvidia-installer.log file (attachment):

<snip>
-> Building NVIDIA kernel module:
   executing: 'cd ./kernel; /usr/bin/make module SYSSRC=/lib/modules/5.2.17-200.fc30.x86_64/source SYSOUT=/lib/modules/5.2.17-200.fc30.x86_64/build NV_BUILD_MODULE_INSTANCES='...
   NVIDIA: calling KBUILD...
   make[1]: Entering directory '/usr/src/kernels/5.2.17-200.fc30.x86_64'
   Makefile:213: ================= WARNING ================
   Makefile:214: 'SUBDIRS' will be removed after Linux 5.3
   Makefile:215: Please use 'M=' or 'KBUILD_EXTMOD' instead
   Makefile:216: ==========================================
   test -e include/generated/autoconf.h -a -e include/config/auto.conf || (             \
   echo >&2;                                                    \
   echo >&2 "  ERROR: Kernel configuration is invalid.";                \
   echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
   echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";   \
   echo >&2 ;                                                   \
   /bin/false)
</snip>

The nvidia installer script apparently checks for the presence of autoconf.h and fails with the aforementioned error if that file is missing.
When executing the recommended "make oldconfig && make prepare" on the kernel source, "make oldconfig" succeeds but "make prepare" fails.  The "make prepare" fails on the script build, which appears to fail at the "make scripts" call.  That's why I reported "make scripts" failing in the bug report.  I probably should have said "make prepare" fails, but I think it's actually the same thing.

From here it looks like the binaries are present but at least one of the header files necessary to generate them from source were omitted.  Unfortunately, it looks like autoconf.h is necessary to build the nvidia driver.

Comment 6 Laura Abbott 2019-10-09 12:38:01 UTC
/lib/modules is never going to contain the autoconf.h file so that path is incorrect. based on what I can see from, https://github.com/NVIDIA/nvidia-installer, SYSSRC shouldn't be /lib/modules since that's the precompiled modules. If you point that to the /usr/src tree it should have the autoconf.h file. I think SYSOUT should also be to the /usr/src directory as well.

I can't guarantee this will fix anything but to the point I suspect that this is an issue with how the nvidia driver is being built and not the kernel-devel package.

Comment 7 bob 2019-10-09 23:32:59 UTC
Thanks.

It's interesting that the NV build warning in Comment 5 claims that autoconf.h is the problem, but when I tried following the directions to manually recompile that was not the error that was triggered. I have to be suspicious that their logger may contain some notification errors, as you have noted.  In that context the NV build log's warning comment night be a bit of a red herring.

In Comment 1 I noted that the actual error that was preventing me from building the necessary kernel components was that /scripts/selinux/genheaders could not find classmap.h.  Here it is again:

# make scripts
  HOSTCC  scripts/selinux/genheaders/genheaders
scripts/selinux/genheaders/genheaders.c:18:10: fatal error: classmap.h: No such file or directory
   18 | #include "classmap.h"

Looking at the file /usr/src/kernels/5.2.9-200.fc30.x86_64/scripts/selinux/genheaders/genheaders.c, line 18 makes the call to "#include classmap.h" but classmap.h is not found anywhere on disk:

# find / -type f -name "classmap.h"
<no matching file is found> 

I think this is a bigger problem than a housekeeping error that points to the wrong directory tree.  I can change the target directories, but the problem will remain that the find command couldn't find classmap.h anywhere on the system disk.  I'm thinking that if the output of the find command is accurate, then changing the directory targets won't be helpful until I can locate a copy of classmap.h.

I appreciate your time working on this, and I agree it's a pain to deal with how the guys at NV build their drivers.  There seem to be some path oversights on their part and there definitely seem to be some maintenance issues on their part.  But looking at the error being generated, my brand new F30 system is missing a file that is supposed to be present.  Can you tell me where to find classmap.h?  It's not beind distributed in a fresh F30 build.  I suspect that the problem hasn't cropped up yet since everybody relies on the binaries and nobody has tried to make scripts.  I might be the first person to notice that there's an RPM that isn't delivering classmap.h.

Comment 8 Fedora Update System 2019-11-13 02:56:49 UTC
FEDORA-2019-68d7f68507 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2019-68d7f68507

Comment 9 Fedora Update System 2019-11-13 06:36:29 UTC
kernel-5.3.11-300.fc31, kernel-headers-5.3.11-300.fc31, kernel-tools-5.3.11-300.fc31, microcode_ctl-2.1-33.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Steven Mercurio 2019-12-10 06:35:01 UTC
Can this please be backported to the FC30 5.3.9-200 kernel.  I have all the latest patches but can not update to FC31 yet.

Comment 11 Rick Richardson 2020-02-18 14:52:37 UTC
Ditto on backporting to FC30.  

# dnf update
...
 Running scriptlet: kernel-core-5.4.19-100.fc30.x86_64                   17/17 
VirtualBox Guest Additions: Building the modules for kernel 
5.4.17-100.fc30.x86_64.

VirtualBox Guest Additions: Look at /var/log/vboxadd-setup.log to find out what 
went wrong

# grep fatal /var/log/vboxadd-setup.log 
scripts/selinux/genheaders/genheaders.c:18:10: fatal error: classmap.h: No such file or directory
orc.h:9:10: fatal error: asm/orc_types.h: No such file or directory

Comment 12 me 2020-02-25 13:53:53 UTC
I am seeing the exact same error on Fedora 31 when trying to compile a driver against the kernel, /usr/src/kernels/5.5.5-200.fc31.x86_64

[xxxxx@linux 5.5.5-200.fc31.x86_64]$ sudo make
  HOSTCC  scripts/selinux/genheaders/genheaders
scripts/selinux/genheaders/genheaders.c:18:10: fatal error: classmap.h: No such file or directory
   18 | #include "classmap.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.host:107: scripts/selinux/genheaders/genheaders] Error 1
make[2]: *** [scripts/Makefile.build:503: scripts/selinux/genheaders] Error 2
make[1]: *** [scripts/Makefile.build:503: scripts/selinux] Error 2
make: *** [Makefile:1098: scripts] Error 2

Versions:
kernel-5.5.5-200
kernel-devel-5.5.5-200
kernel-headers-5.5.5-200
kernel-tools-5.5.5-1
microcode-ctl-2.1-34

I tried removing and reinstalling kernel-devel, kernel-headers, and kernel-tools

Is there anything else I should try to fix this, or is this the same bug?

Comment 13 Rick Richardson 2020-03-09 12:01:02 UTC
I did a "uninstall.sh" in /opt/VirtualBox* and now I don't get the error anymore.  I guess was mixing VirtualBox'es from two different sources.

Comment 14 bob 2020-03-10 19:58:39 UTC
I'm the original reporter.  I've never installed VirtualBox and I don't see how it is relevant.  As noted previously, the missing files occur on a fresh F30 install because there are missing files in the installation RPM.

Comment 15 John Call 2020-04-03 02:34:23 UTC
classmap.h is missing when I try to compile the Intel firmware updater on Fedora 31
https://downloadcenter.intel.com/download/29137/Intel-Ethernet-Connections-Boot-Utility-Preboot-Images-and-EFI-Drivers?product=82186


[root@admin DRIVER]# uname -a
Linux admin.cluster.net 5.5.13-200.fc31.x86_64 #1 SMP Wed Mar 25 21:55:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

[root@admin DRIVER]# dnf list kernel kernel-headers kernel-tools microcode_ctl
Last metadata expiration check: 1:33:46 ago on Thu 02 Apr 2020 08:59:17 PM EDT.
Installed Packages
kernel.x86_64                                       5.4.18-200.fc31                                @updates
kernel.x86_64                                       5.5.8-200.fc31                                 @updates
kernel.x86_64                                       5.5.13-200.fc31                                @updates
kernel-headers.x86_64                               5.5.9-200.fc31                                 @updates
kernel-tools.x86_64                                 5.5.9-200.fc31                                 @updates
microcode_ctl.x86_64                                2:2.1-34.fc31                                  @updates

[root@admin DRIVER]# dnf whatprovides "*/classmap.h"
Last metadata expiration check: 1:33:53 ago on Thu 02 Apr 2020 08:59:17 PM EDT.
Error: No Matches found


[root@admin ~]# cd /root/intel_nic_fw/APPS/BootUtil/Linux_x64/DRIVER/
[root@admin DRIVER]# ll
total 128
-rwxr-xr-x. 1  500  544  2139 Nov 22 09:42 install
drwxr-xr-x. 4 root root    66 Aug  6  2019 iqvlinux
-rw-r--r--. 1  500  544 50596 Nov 22 09:42 iqvlinux-1.2.0.13-0.noarch.rpm
-rw-r--r--. 1  500  544 50808 Nov 22 09:42 iqvlinux.tar.gz
-rw-r--r--. 1  500  544 18954 Jun  1  2019 license_gpl.txt

[root@admin DRIVER]# ./install 
Extracting archive..OK!
Compiling the driver...Error: make: Entering directory '/root/intel_nic_fw/APPS/BootUtil/Linux_x64/DRIVER/iqvlinux/src/linux/driver'
make -C /lib/modules/5.5.13-200.fc31.x86_64/build SUBDIRS=/root/intel_nic_fw/APPS/BootUtil/Linux_x64/DRIVER/iqvlinux/src/linux/driver modules
make[1]: Entering directory '/usr/src/kernels/5.5.13-200.fc31.x86_64'
  HOSTCC  scripts/selinux/genheaders/genheaders
scripts/selinux/genheaders/genheaders.c:18:10: fatal error: classmap.h: No such file or directory
   18 | #include "classmap.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make[4]: *** [scripts/Makefile.host:107: scripts/selinux/genheaders/genheaders] Error 1
make[3]: *** [scripts/Makefile.build:503: scripts/selinux/genheaders] Error 2
make[2]: *** [scripts/Makefile.build:503: scripts/selinux] Error 2
make[1]: *** [Makefile:1098: scripts] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.5.13-200.fc31.x86_64'
make: *** [Makefile:257: default] Error 2
make: Leaving directory '/root/intel_nic_fw/APPS/BootUtil/Linux_x64/DRIVER/iqvlinux/src/linux/driver'
Error: unable to find driver file (iqvlinux.ko) in /root/intel_nic_fw/APPS/BootUtil/Linux_x64/DRIVER/iqvlinux/src/linux/driver
[root@admin DRIVER]#

Comment 16 Paulo Castro 2020-04-05 12:17:18 UTC
Same here ...

Comment 17 John Call 2020-04-06 15:54:44 UTC
In the end, I found the missing files in the kernel-* RPMs that originally shipped with Fedora 31 (5.3.7-301)

# dnf --enablerepo=fedora-debuginfo install \
    kernel-5.3.7-301.fc31.x86_64 \
    kernel-core-5.3.7-301.fc31.x86_64 \
    kernel-devel-5.3.7-301.fc31.x86_64 \
    kernel-modules-5.3.7-301.fc31.x86_64 \
    kernel-headers-5.3.6-300.fc31.x86_64 \
    kernel-debuginfo-common-x86_64-5.3.7-301.fc31.x86_64

Comment 18 J Freyensee 2020-04-06 16:23:53 UTC
This is still a problem with Fedora's 5.5.10-100.fc30.x86_64 kernel, not sure why this bug is closed.  All I want to do is build the source with the .config supplied in /usr/src/kernels/5.5.10-100.fc30.x86_64 and it fails immediately:

root@fedora-virtualfedora 5.5.10-100.fc30.x86_64]# make -j2
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf  --syncconfig Kconfig
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_64.o
  HOSTCC  scripts/selinux/genheaders/genheaders
scripts/selinux/genheaders/genheaders.c:18:10: fatal error: classmap.h: No such file or directory
   18 | #include "classmap.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.host:107: scripts/selinux/genheaders/genheaders] Error 1
make[2]: *** [scripts/Makefile.build:503: scripts/selinux/genheaders] Error 2
make[1]: *** [scripts/Makefile.build:503: scripts/selinux] Error 2


Can you suggest a work-around since this is obviously not fixed.

Comment 19 J Freyensee 2020-04-06 16:30:18 UTC
Note I have all the files John Call suggested installed on my system

Comment 20 J Freyensee 2020-04-06 16:32:25 UTC
Oh and this has nothing to do with NVIDIA drivers, rather a generic, plain kernel build.  It should 'just work' when I type 'make'

Comment 21 Paulo Castro 2020-04-07 22:22:33 UTC
Raised https://bugzilla.redhat.com/show_bug.cgi?id=1821946

Comment 22 RMD 2020-04-08 21:44:11 UTC
Please, follow https://bugzilla.redhat.com/show_bug.cgi?id=1821946 , i do not know why this thread has been closed, it remains unresolved on F31 with 5.5.15-200.fc31 kernel version.
Not only modules, even kernel can not be built.
Regards

Comment 23 MartinG 2020-09-18 06:05:44 UTC
I see this is marked as NEDDINFO now, so I will try to provide.

Background: I'm trying to be able to use my VirtualBox machines. They stopped working after an update of the Fedora kernel (akmods fails building stuff for VirtualBox).

It seems it is not possible to even build the kernel from source in Fedora now. My system is up to date as of today:

# rpm -qa|grep $(uname -r)
kernel-5.8.9-200.fc32.x86_64
kernel-core-5.8.9-200.fc32.x86_64
kernel-devel-5.8.9-200.fc32.x86_64
kernel-modules-extra-5.8.9-200.fc32.x86_64
kernel-modules-5.8.9-200.fc32.x86_64

host:/usr/src/kernels/5.8.9-200.fc32.x86_64:# make oldconfig && make prepare
scripts/kconfig/conf  --oldconfig Kconfig
#
# No change to .config
#
scripts/kconfig/conf  --syncconfig Kconfig
  HYPERCALLS arch/x86/include/generated/asm/xen-hypercalls.h
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_64.o
  HOSTCC  arch/x86/tools/relocs_common.o
  HOSTLD  arch/x86/tools/relocs
  HOSTCC  scripts/selinux/genheaders/genheaders
scripts/selinux/genheaders/genheaders.c:18:10: fatal error: classmap.h: No such file or directory
   18 | #include "classmap.h"
      |          ^~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.host:103: scripts/selinux/genheaders/genheaders] Error 1
make[2]: *** [scripts/Makefile.build:497: scripts/selinux/genheaders] Error 2
make[1]: *** [scripts/Makefile.build:497: scripts/selinux] Error 2
make: *** [Makefile:1159: scripts] Error 2



I tried to find classmap.h as suggested in a previous comment and use that: (dnf --enablerepo=fedora-debuginfo provides */classmap.h)
And installed this:
dnf --enablerepo=fedora-debuginfo install kernel-debuginfo-common-x86_64-5.6.6-300.fc32.x86_64

Did a crude copy:
host:/usr/src/kernels/5.8.9-200.fc32.x86_64:# cp -r /usr/src/debug/kernel-5.6.fc32/linux-5.6.6-300.fc32.x86_64/security/selinux/include security/selinux/

But there are changes between 5.6.6 and 5.8.9, so it breaks:
linea:/usr/src/kernels/5.8.9-200.fc32.x86_64:# make oldconfig && make prepare
scripts/kconfig/conf  --oldconfig Kconfig
#
# No change to .config
#
  HOSTCC  scripts/selinux/genheaders/genheaders
In file included from scripts/selinux/genheaders/genheaders.c:18:
./security/selinux/include/classmap.h:33:2: error: #error New capability defined, please update COMMON_CAP2_PERMS.
   33 | #error New capability defined, please update COMMON_CAP2_PERMS.
      |  ^~~~~
make[3]: *** [scripts/Makefile.host:103: scripts/selinux/genheaders/genheaders] Error 1
make[2]: *** [scripts/Makefile.build:497: scripts/selinux/genheaders] Error 2
make[1]: *** [scripts/Makefile.build:497: scripts/selinux] Error 2
make: *** [Makefile:1159: scripts] Error 2

Oh, wait, I noticed now that my kernel headers are not up to date!:
# dnf install kernel-headers
Last metadata expiration check: 0:42:02 ago on Fri Sep 18 07:20:29 2020.
Package kernel-headers-5.8.8-200.fc32.x86_64 is already installed.

linea:~:# dnf install kernel-headers-$(uname -r)
Last metadata expiration check: 0:43:09 ago on Fri Sep 18 07:20:29 2020.
No match for argument: kernel-headers-5.8.9-200.fc32.x86_64
Error: Unable to find a match: kernel-headers-5.8.9-200.fc32.x86_64

So, the latest kernel version in doesn't provide the headers package?


Note You need to log in before you can comment on or make changes to this bug.