How remove the commit ID from kernel release version?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How remove the commit ID from kernel release version?

ソリューションへジャンプ
4,337件の閲覧回数
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,866件の閲覧回数
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,867件の閲覧回数
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,867件の閲覧回数
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,867件の閲覧回数
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,867件の閲覧回数
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,