summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2019-12-02 13:55:51 +0000
committerStefan Agner <stefan.agner@toradex.com>2019-12-03 09:59:50 +0000
commit200055d8befcaa4b538ea588cef4fca9e8e06204 (patch)
treeb47ba5815d51d913d8c3e4e39d0860add9712e3b
parent6ea9021f930c9df2615f3b4a9b3d529e3450a9db (diff)
toradex-kernel-localversion: add Toradex specific local version
Add Toradex specific local version implementation for the Linux kernel. This implementation is a simplified version from what is in meta-freescale. It can be used with linux-yocto based Linux recipes as well as regular OE kernel recipes and linux-fslc based recipes. This allows us to reuse the class in all Linux recipes used by Toradex. Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r--classes/toradex-kernel-localversion.bbclass25
1 files changed, 25 insertions, 0 deletions
diff --git a/classes/toradex-kernel-localversion.bbclass b/classes/toradex-kernel-localversion.bbclass
new file mode 100644
index 0000000..00bfd75
--- /dev/null
+++ b/classes/toradex-kernel-localversion.bbclass
@@ -0,0 +1,25 @@
+# Toradex Kernel LOCALVERSION extension
+#
+# This allow to easy reuse of code between different kernel recipes
+#
+# The following options are supported:
+#
+# SCMVERSION Puts the Git hash in kernel local version
+# LOCALVERSION Value used in LOCALVERSION
+#
+# Copyright 2014, 2015 (C) O.S. Systems Software LTDA.
+# Copyright 2019 (C) Toradex AG
+
+SCMVERSION ??= "y"
+LOCALVERSION ?= "-${TDX_VERSION}"
+
+do_configure_prepend() {
+ sed -i -e /CONFIG_LOCALVERSION/d ${B}/.config
+ echo "CONFIG_LOCALVERSION=\"${LOCALVERSION}\"" >> ${B}/.config
+
+ if [ "${SCMVERSION}" = "y" ]; then
+ # Add GIT revision to the local version
+ head=`git --git-dir=${S}/.git rev-parse --verify --short HEAD 2> /dev/null`
+ printf "+git.%s" $head > ${S}/.scmversion
+ fi
+}