When the kernel is built the version string is generated from a few variables, including the latest tag and the git SHA. eg. 4.7.10-00322-g3fd9c552f124
However, when we build it in yocto the version string is forced to be
This issue is to figure out how the string is being overridden and undo that.
I would be interested in adding the HEAD commit YYYYMMDD to the version string (as well as the tag, patch count and short hash, though maybe it's getting ridiculous?): e.g. 4.7.10-00322-g3fd9c552f124-20170310. Thoughts?
Also -dirty if yocto has applied patches to the kernel tree.
This issue has been automatically marked as stale because no activity has occurred in the last 6 months. It will be closed if no activity occurs in the next 30 days. If this issue should not be closed please add a comment. Thank you for your understanding and contributions.
This issue has been closed because no activity has occurred in the last 7 months. Please reopen if this issue should not have been closed. Thank you for your contributions.
I would like this resolved. It is important for understanding how the kernel sources relate to the binary that is shipped, which is important for complying to the licensing requirements, and debugging of failures in the field.
It requires some yocto hacking. Brad, are you able to help find someone to work on this?
I could take a look at this.
Yocto/OpenBMC does below to set the kernel version:
linux-aspeed sets LINUX_VERSION_EXTENSION ?= "-${SRCREV}"kernel-yocto.bbclass has do_kernel_configme() to set:
echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
.config we have set CONFIG_LOCALVERSIONHow about:
5.0.7-b1b37a25.0.7-b1b37a2-dirty-84fa553, where dirty tells it has local patch, and 84fa553 tells the local patch's revision.@amboar It does not make senses to add YYYYMMDD in the version string, because kernel build already has the date info in UTS_VERSION, so when you run uname -a the date is shown in the output.
https://gerrit.openbmc-project.xyz/c/openbmc/meta-aspeed/+/21087 Improve kernel version string
Resolves #1289 Kernel version
Most helpful comment
How about:
5.0.7-b1b37a25.0.7-b1b37a2-dirty-84fa553, wheredirtytells it has local patch, and84fa553tells the local patch's revision.@amboar It does not make senses to add
YYYYMMDDin the version string, because kernel build already has the date info inUTS_VERSION, so when you rununame -athe date is shown in the output.