TX1 kernel name change

I’ve cross-compiled a custom version of the R24.2.1 kernel for my TX1, and in the process I’ve changed it’s name from the default “3.10.96-tegra”. I’ve successfully built and flashed an image with my new kernel to my TX1 hardware, and now I’m trying to build a driver module natively on my TX1. Prior to building the driver, when I run “make modules_prepare” (from the custom kernel’s headers directory under /usr/src), the custom kernel name is being reverted in several files. When I build the driver, its vermagic string gets built with the original kernel name and insmod produces an error when I try to load it because it doesn’t match “uname -r”.

I can get around the problem by manually changing the string back to the custom name in one of the files, but that seems like a hack. I’ve also been very careful when cross-compiling the kernel to eliminate any references to the original kernel name in the headers or source files.

Any ideas what’s going on? Is there a better way to build an out-of-tree module than the way I’m doing it? I’m also happy to provide any additional details or output… just trying to keep things brief.

The “3.10.96” is part of the kernel itself. Everything after that is part of CONFIG_LOCALVERSION (a string value…for “3.10.96-tegra”, that string is “-tegra”). In your config set CONFIG_LOCALVERSION before your “make modules_prepare”.

Thanks for the help, this was definitely part of the problem. I’d been setting CONFIG_LOCALVERSION through menuconfig, but I was only using the modified .config file for the cross-compile build and wasn’t packaging it with the headers that ended up on the TX1.

Once I fixed that, things were closer but still not right (uname was giving “3.10.96-” and vermagic was set to “3.10.96-tegra-”). After a little more digging, I found that the “-tegra” string looks like it’s coming from a variable called EXTRAVERSION being set in the kernel headers Makefile. As it turns out, the kernel sources Makefile also has an entry for EXTRAVERSION… and it’s empty. Cross-compiling with the sources Makefile (and empty EXTRAVERSION) was giving "3.10.96-, but running make modules_prepare with the headers Makefile was producing "3.10.96-tegra-. I’ve since changed the sources Makefile to match the headers file and things are working fine.

Thanks again for the help!

EXTRAVERSION was actually the older way of doing such a change…I don’t know if it’s really deprecated or if this is just a fad that LOCALVERSION is what I see used now. Keep in mind that the original source probably requires a make clean prior to using any changes, else it might mix versions incorrectly in different places.