How remove the commit ID from kernel release version?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How remove the commit ID from kernel release version?

跳至解决方案
4,341 次查看
riccardo_cavedo
Contributor II

Good mornig,

Currently, I'm making a patch to the kernel but every time that create it the version is (for instance) 4.9.11-1.0.0+gc37aab8 

How can remove the commit ID from the version?

I'm using i.MX Yocto Project Community BSP recipe layers (imx-morty) plus my meta layer where I added a recipe linux-imx_4.9.11.bbappend with SRC_URI that links to a specific commit ID of kernel.

Thank in advance for the help.

Riccardo

标签 (3)
标记 (2)
1 解答
3,870 次查看
henrideveer
Contributor III

You can set the next 2 kernel variables:

CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=n

In your kernel config somewhere, I used a config snippet (I called it version.cfg but it does not matter). In the LOCALVERSION string you can also put your own postfix string which will be appended to the version.

在原帖中查看解决方案

4 回复数
3,871 次查看
riccardo_cavedo
Contributor II

gusarambula‌ and henrideveer‌ thank you for the suggestions.

I've found the solution with the suggestion of henrideveer‌ and an additional modify.

The include file:

meta-freescale/recipes-kernel/linux/linux-imx.inc

has the option:

SCMVERSION ?= "y"

changing "y" with "n" the string with commit ID is removed.

So my append recipe has become:

EXTRAPATHS_prepend := "${THISDIR}/${PN}:"

LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "git://<my_kernel_repo"
SRCREV = "1111111111111111111111111"
#SRCREV = "${AUTOREV}"

# Remove from the kernel version the additional string with commid ID of linux-imx repository
SCMVERSION = "n"‍‍‍‍‍‍‍‍‍‍

Moreover, the defconfig of kernel has to be:

CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=n

0 项奖励
3,871 次查看
radhikasomaiya
Senior Contributor II

Hi  Riccardo Cavedon
        Can you please share the steps that you have followed to create patch and which lines you have added to the .bbappend file.

To Create and add patch in yocto one can refer this link.

Regards,

Radhika

0 项奖励
3,871 次查看
henrideveer
Contributor III

You can set the next 2 kernel variables:

CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=n

In your kernel config somewhere, I used a config snippet (I called it version.cfg but it does not matter). In the LOCALVERSION string you can also put your own postfix string which will be appended to the version.

3,871 次查看
gusarambula
NXP TechSupport
NXP TechSupport

Hello Riccardo,

Thee kernel version string is built after some variables that you should be able to edit. The top Makefile should have the version and other variables listed but I would recommend being careful.

Regards,