Hi, I’m not sure if this is the correct place to be asking, but I believe this is an issue that follows from improper kernel build?
I am trying to run make to build a custom driver to talk to some external equipment (just a sinusoidal function generator). The Makefile works for just about every other computer within my area, except for this one. The following is the output after running make with the given Makefile.
~/p/func > sudo make -k
make -C /lib/modules/`uname -r`/build M=/home/name/programs/func/driver
make[1]: Entering directory '/usr/src/linux-5.14.21-150400.22-obj/x86_64/default'
WARNING: Symbol version dump "Module.symvers" is missing.
Modules may not have dependencies or modversions.
You may get many unresolved symbol warnings.
MODPOST /home/name/programs/func/driver/Module.symvers
/bin/sh: scripts/mod/modpost: No such file or directory
make[3]: *** [/usr/src/linux-5.14.21-150400.22/scripts/Makefile.modpost:156: /home/name/programs/func/driver/Module.symvers] Error 127
make[3]: Target '__modpost' not remade because of errors.
make[2]: *** [/usr/src/linux-5.14.21-150400.22/Makefile:1797: modules] Error 2
make[2]: Target '__all' not remade because of errors.
make[1]: *** [/usr/src/linux-5.14.21-150400.22/Makefile:220: __sub-make] Error 2
make[1]: Target '__all' not remade because of errors.
make[1]: Leaving directory '/usr/src/linux-5.14.21-150400.22-obj/x86_64/default'
make: *** [Makefile:19: driver] Error 2
make -C apps
make[1]: Entering directory '/home/name/programs/func/apps'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/name/programs/func/apps'
make: Target 'all' not remade because of errors.
We refer to the first lines of the error, and check the existence of the missing file.
> ls -la /lib/modules/5.14.21-150400.22-default/build
lrwxrwxrwx 1 root root 51 May 12 08:30 /lib/modules/5.14.21-150400.22-default/build -> /usr/src/linux-5.14.21-150400.22-obj/x86_64/default
> ls -la /usr/src/linux-5.14.21-150400.22-obj/x86_64/default/
total 184
drwxr-xr-x 1 root root 126 Jul 6 16:04 .
drwxr-xr-x 1 root root 14 Jul 5 04:18 ..
drwxr-xr-x 1 root root 6 Jul 5 04:18 arch
-rw-r--r-- 1 root root 39 May 12 08:10 .gitignore
drwxr-xr-x 1 root root 0 Jul 5 15:57 include
-rw-r--r-- 1 root root 133 Jul 5 04:18 Makefile
-rw-r--r-- 1 root root 172485 May 12 08:09 Module.supported
drwxr-xr-x 1 root root 60 Jul 5 15:57 scripts
lrwxrwxrwx 1 root root 32 Jul 5 04:18 source -> /usr/src/linux-5.14.21-150400.22
drwxr-xr-x 1 root root 14 Jul 5 04:18 tools
Here, we can see that the symvers file is indeed missing.
Referring to https://www.kernel.org/doc/Documentation/kbuild/modules.txt and googling from “Missing modules.symvers” (majority of results are at least 8 years old), I have also done
> sudo zypper install --force kernel-devel kernel-source kernel-syms module-init-tools linux-kernel-headers
and restarted the computer in an attempt to get the file to be generated, but the file does not generate.
Any help would be appreciated.