diff options
author | Ming Liu <ming.liu@toradex.com> | 2020-03-13 10:41:36 +0100 |
---|---|---|
committer | Ming Liu <ming.liu@toradex.com> | 2020-03-13 10:51:47 +0100 |
commit | aaf2b59a0bd69c1cfea6d2fc0df30ab49e16e031 (patch) | |
tree | a073a0ed8ae5baffd41ec611edf0a9186acc05ff /classes/toradex-kernel-localversion.bbclass | |
parent | 319f84b395d5b129c7dca90554746589d2bb9f52 (diff) |
toradex-kernel-config: add bbclass
It contains a helper function kernel_configure_variable that could be
called in do_configure_append task to assign a value to a config
variable in ${B}/.config.
Change toradex-kernel-localversion.bbclass to use this function.
Signed-off-by: Ming Liu <ming.liu@toradex.com>
Diffstat (limited to 'classes/toradex-kernel-localversion.bbclass')
-rw-r--r-- | classes/toradex-kernel-localversion.bbclass | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/classes/toradex-kernel-localversion.bbclass b/classes/toradex-kernel-localversion.bbclass index f23ee58..e2ec3a0 100644 --- a/classes/toradex-kernel-localversion.bbclass +++ b/classes/toradex-kernel-localversion.bbclass @@ -10,15 +10,15 @@ # Copyright 2014, 2015 (C) O.S. Systems Software LTDA. # Copyright 2019 (C) Toradex AG +inherit toradex-kernel-config + TDX_VERSION ??= "0" SCMVERSION ??= "y" LOCALVERSION ?= "-${TDX_VERSION}" kernel_do_configure_append() { - sed -i -e /CONFIG_LOCALVERSION/d ${B}/.config - echo "CONFIG_LOCALVERSION=\"${LOCALVERSION}\"" >> ${B}/.config + kernel_configure_variable LOCALVERSION "\"${LOCALVERSION}\"" - sed -i -e /CONFIG_LOCALVERSION_AUTO/d ${B}/.config if [ "${SCMVERSION}" = "y" ]; then # Add GIT revision to the local version # SRCREV_machine is used in kernel recipes using kernel-yocto.bbclass, @@ -40,8 +40,8 @@ kernel_do_configure_append() { head=`git --git-dir=${S}/.git rev-parse --verify --short HEAD 2> /dev/null` fi printf "+git.%s" $head > ${S}/.scmversion - echo "CONFIG_LOCALVERSION_AUTO=y" >> ${B}/.config + kernel_configure_variable LOCALVERSION_AUTO y else - echo "# CONFIG_LOCALVERSION_AUTO is not set" >> ${B}/.config + kernel_configure_variable LOCALVERSION_AUTO n fi } |