Tiny Core Linux

Tiny Core Base => TCB Bugs => Topic started by: CNK on March 01, 2026, 05:16:54 PM

Title: Module.symvers and System.map Missing for TC 17.x
Post by: CNK on March 01, 2026, 05:16:54 PM
Trying to compile the r8168 driver module for TC17 x86_64, I found there's no Module.symvers-6.18.2-tinycore64.gz file at the expected download location:

http://www.tinycorelinux.net/17.x/x86_64/release/src/kernel/Module.symvers-6.18.2-tinycore64.gz

Same for x86.

Without downloading this, when I run "make oldconfig && make prepare && make modules_prepare" to prepare for building the third-party module, it asks lots of questions and I'm not sure if guessing the answers will cause compatibility issues with the compiled kernel module.

I won't be needing System.map for this, but it might have been left out by accident too.
Title: Re: Module.symvers and System.map Missing for TC 17.x
Post by: Juanito on March 02, 2026, 04:42:41 AM
The Module.symvers file used to be useful to compile kernel modules quickly, but it seems this was dropped after linux-5.x.y.

It sounds like you didn't copy config-6.18.2-tinycore64 to .config and "make oldconfig" before you started?
Title: Re: Module.symvers and System.map Missing for TC 17.x
Post by: Paul_123 on March 02, 2026, 09:59:20 AM
Did I not provide it to you Juanito?  I should have.    I normally provide it for piCore.
Title: Re: Module.symvers and System.map Missing for TC 17.x
Post by: CNK on March 02, 2026, 04:55:21 PM
The Module.symvers file used to be useful to compile kernel modules quickly, but it seems this was dropped after linux-5.x.y.

I kind-of doubt that because I tried being cheeky and using the Module.symvers file for TC 16.x (http://www.tinycorelinux.net/16.x/x86_64/release/src/kernel/Module.symvers-6.12.11-tinycore64.gz) (also kernel 6.x). However when I tried to build the r8168 driver that build failed with lots of errors complaining about missing entries in Module.symvers. So it's not a solution.

It sounds like you didn't copy config-6.18.2-tinycore64 to .config and "make oldconfig" before you started?

Oh, I might have stuffed things up and overwritten .config with TC 16's Module.symvers while I was flailing around trying to find solutions. Anyway now I've got it:

Code: [Select]
$ grep tinycore .config
CONFIG_LOCALVERSION="-tinycore64"

Also I definitely downloaded it from the TC 17.x directory, not an earlier release.

I just tried again after deleting the old TC 16.x Module.symvers file and running "make clean" and it completes the "make oldconfig && make prepare && make modules_prepare" commands. But the driver build still fails complaining about no Module.symvers file:

Code: [Select]
$ make modules
[snip]
make[3]: Entering directory '/home/cnk2/r8168/r8168-8.056.02/src'
  CC [M]  r8168_n.o
  CC [M]  r8168_asf.o
  CC [M]  rtl_eeprom.o
  CC [M]  rtltool.o
  LD [M]  r8168.o
  MODPOST Module.symvers
WARNING: /home/cnk2/r8168/linux-6.18.2/Module.symvers is missing.
         Modules may not have dependencies or modversions.
         You may get many unresolved symbol errors.
         You can set KBUILD_MODPOST_WARN=1 to turn errors into warning
         if you want to proceed at your own risk.
ERROR: modpost: "napi_alloc_skb" [r8168.ko] undefined!
ERROR: modpost: "alloc_etherdev_mqs" [r8168.ko] undefined!
ERROR: modpost: "pci_save_state" [r8168.ko] undefined!
ERROR: modpost: "free_irq" [r8168.ko] undefined!
ERROR: modpost: "is_vmalloc_addr" [r8168.ko] undefined!
ERROR: modpost: "device_set_wakeup_enable" [r8168.ko] undefined!
ERROR: modpost: "__skb_pad" [r8168.ko] undefined!
ERROR: modpost: "rtnl_unlock" [r8168.ko] undefined!
ERROR: modpost: "skb_copy_bits" [r8168.ko] undefined!
ERROR: modpost: "param_ops_uint" [r8168.ko] undefined!
WARNING: modpost: suppressed 149 unresolved symbol warnings because there were too many)
make[5]: *** [/home/cnk2/r8168/linux-6.18.2/scripts/Makefile.modpost:147: Module.symvers] Error 1
make[4]: *** [/home/cnk2/r8168/linux-6.18.2/Makefile:1960: modpost] Error 2
make[3]: *** [/home/cnk2/r8168/linux-6.18.2/Makefile:248: __sub-make] Error 2
make[3]: Leaving directory '/home/cnk2/r8168/r8168-8.056.02/src'
make[2]: *** [Makefile:248: __sub-make] Error 2
make[2]: Leaving directory '/home/cnk2/r8168/linux-6.18.2'
make[1]: *** [Makefile:181: modules] Error 2
make[1]: Leaving directory '/home/cnk2/r8168/r8168-8.056.02/src'
make: *** [Makefile:41: modules] Error 2

Trying KBUILD_MODPOST_WARN=1 succeeds, so I guess maybe that's OK, but I'd be a bit surprised if the driver actually works after all the unresolved symbol warnings. It's kind of a pain to test if it doesn't because I normally run my target system headless.

Code: [Select]
$ make KBUILD_MODPOST_WARN=1 modules
make -C src/ modules
make[1]: Entering directory '/home/cnk2/r8168/r8168-8.056.02/src'
find: ‘/lib/modules/6.18.2/kernel/drivers/net/ethernet’: No such file or directory
find: ‘/lib/modules/6.18.2/kernel/drivers/net’: No such file or directory
make -C /lib/modules/6.18.2/build M=/home/cnk2/r8168/r8168-8.056.02/src modules
make[2]: Entering directory '/home/cnk2/r8168/linux-6.18.2'
make[3]: Entering directory '/home/cnk2/r8168/r8168-8.056.02/src'
  MODPOST Module.symvers
WARNING: /home/cnk2/r8168/linux-6.18.2/Module.symvers is missing.
         Modules may not have dependencies or modversions.
         You may get many unresolved symbol errors.
         You can set KBUILD_MODPOST_WARN=1 to turn errors into warning
         if you want to proceed at your own risk.
WARNING: modpost: "napi_alloc_skb" [r8168.ko] undefined!
WARNING: modpost: "alloc_etherdev_mqs" [r8168.ko] undefined!
WARNING: modpost: "pci_save_state" [r8168.ko] undefined!
WARNING: modpost: "free_irq" [r8168.ko] undefined!
WARNING: modpost: "is_vmalloc_addr" [r8168.ko] undefined!
WARNING: modpost: "device_set_wakeup_enable" [r8168.ko] undefined!
WARNING: modpost: "__skb_pad" [r8168.ko] undefined!
WARNING: modpost: "rtnl_unlock" [r8168.ko] undefined!
WARNING: modpost: "skb_copy_bits" [r8168.ko] undefined!
WARNING: modpost: "param_ops_uint" [r8168.ko] undefined!
WARNING: modpost: suppressed 149 unresolved symbol warnings because there were too many)
  CC [M]  r8168.mod.o
  CC [M]  .module-common.o
  LD [M]  r8168.ko
make[3]: Leaving directory '/home/cnk2/r8168/r8168-8.056.02/src'
make[2]: Leaving directory '/home/cnk2/r8168/linux-6.18.2'
make[1]: Leaving directory '/home/cnk2/r8168/r8168-8.056.02/src'

I guess it could be that r8168 hasn't been updated to work without Module.symvers on newer kernels. But the current kernel documentation (https://www.kernel.org/doc/html/latest/kbuild/modules.html#symbols-and-external-modules) still describes needing Module.symvers at "the MODPOST step" for building external modules.

I guess if it is still used, I could generate Module.symvers myself by doing a full kernel build. No time to try that right now though.
Title: Re: Module.symvers and System.map Missing for TC 17.x
Post by: Paul_123 on March 02, 2026, 07:19:27 PM
You definitely need them to build modules, but I forget which stage they get built.   Not sure modules_prepare is enough.

Anyway, I just uploaded them to the kernel source folder for v17
Title: Re: Module.symvers and System.map Missing for TC 17.x
Post by: Juanito on March 03, 2026, 04:43:52 AM
I kind-of doubt that..

It used to be possible to compile an individual kernel module quickly like this: http://tinycorelinux.net/5.x/x86_64/tcz/src/wl/compile_wl

..where the time to "make modules" was 1h 2m 34s unless Module.symvers was used and then the individual module (wl in this case) could be compiled in a few seconds.

This method stopped working at some point in linux-5.something
Title: Re: Module.symvers and System.map Missing for TC 17.x
Post by: CNK on March 03, 2026, 06:42:25 AM
With the Module.symvers file downloaded to the kernel source code directory, the r8168 driver module compiled (in seconds) without errors and is working fine. Extension submitted.

Thanks!