I am having an issue with a Jenkins build which I am not able to resolve.
I am currently having a setup in Jenkins where I have VM where Jenkins connects via ssh and performs some operations to completely build a linux kernel for an NVIDIA Jetson chip.
Whenever I use the same build steps locally in the VM, the build works as it is supposed to. However, when using jenkins, the build does not work properly.
Due to the nature of the build process, I do need to set the environment variable LOCALVERSION=-tegra in order to build correctly the kernel. After debugging, I have figured out that jenkins is adding an extra string to the end of the kernel version for every build, and this behaviour is unwanted.
Does anybody know how to make jenkins not to append that string?
Found the solution. Jenkins environment variable was messing with the kernel release string. You can change this behaviour in the main kernel makefile:
# KERNELRELEASE can change from a few different places, meaning version.h
# needs to be updated, so this check is forced on all builds
uts_len := 64
ifneq (,$(BUILD_NUMBER))
UTS_RELEASE=$(KERNELRELEASE)-ab$(BUILD_NUMBER)
else
UTS_RELEASE=$(KERNELRELEASE)
endif