Manual kernel build always adds "+" to vermagic — insmod fails

Board: BeagleBone Black Rev C Kernel: 6.18.42 (target: 6.18.42-bone46) Build system: bb-kernel’s build_kernel.sh

Problem

Building with build_kernel.sh out of the box gave a vermagic the board suffix :

vermagic: 6.18.44-bone47 SMP preempt mod_unload ARMv7 thumb2 p2v8

Then after i tried Intree Device Driver building and got vermagic the board suffix :

vermagic: 6.18.44+ SMP preempt mod_unload ARMv7 thumb2 p2v8

So I went into make menuconfig and manually set:

CONFIG_LOCALVERSION="-bone46"
CONFIG_LOCALVERSION_AUTO=n

Then rebuilt. The suffix now shows up correctly, but the + is still there:

vermagic: 6.18.44-bone47+ SMP preempt mod_unload ARMv7 thumb2 p2v8

insmod fails with Invalid module format since this doesn’t match the running kernel’s uname -r (6.18.42-bone46, no +).

What I’ve tried

  • Confirmed .config has CONFIG_LOCALVERSION="-bone46" and # CONFIG_LOCALVERSION_AUTO is not set

  • Added an empty .scmversion file at the kernel tree root to stop scripts/setlocalversion from checking git dirty state

  • Deleted include/config/kernel.release and include/generated/utsrelease.h to force regeneration

  • Re-ran make modules+ persists regardless

Question

Why does the + remain even with LOCALVERSION set and LOCALVERSION_AUTO off? Is build_kernel.sh doing something (git state, separate version file, script patch) that’s still appending it after my menuconfig change? What’s the correct way to get a clean 6.18.42-bone46 with no + when manually editing config on top of a build_kernel.sh tree?

Run a git status inside the linux folder and see what’s going on…

If you want the tree to be “clean” prior to build, just git commit the changes and build again.

Install everything in the deploy directory, kernel, modules, and device trees. Or just use build_deb.sh to generate a Deb package with everything… Your build environment (gcc version, etc) does not 100% match the 6.18.44-bone47 distro build, so it’s going to throw that mismatch error, when using pieces from two kernel builds… Otherwise the magic is. LOCALVERSION=${BUILD} on the build line