How remove the commit ID from kernel release version?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How remove the commit ID from kernel release version?

Jump to solution
5,581 Views
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

Labels (3)
Tags (2)
1 Solution
5,110 Views
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.

View solution in original post

4 Replies
5,111 Views
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 Kudos
Reply
5,111 Views
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 Kudos
Reply
5,111 Views
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.

5,111 Views
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,