Linux Kernel – Differences Between Editing UTS_RELEASE and EXTRAVERSION

linux-kernelmakeversion

UTS_RELEASE is in include/generated/utsrelease.h

EXTRAVERSION is in makefile

For example my kernel has UTS_RELEASE "4.4.30-7+" and the EXTRAVERSION contains -7+

Both are affecting the result of uname -r when built.

What are the differences between the two? Would they conflict each other if only one is edited?

Best Answer

UTS_RELEASE includes EXTRAVERSION. If you change EXTRAVERSION, UTS_RELEASE will be updated to reflect that. If you change UTS_RELEASE in include/generated/utsrelease.h, the file is liable to be rewritten the next time you build the kernel, which would lose your change. So don't touch UTS_RELEASE, edit EXTRAVERSION if you have to.

The kernel supports a local version too, which is defined in the kernel configuration and is designed to be changed in local builds. It is appended to the kernel release. You should probably use that!