summaryrefslogtreecommitdiff
path: root/meta-phosphor/classes/obmc-phosphor-kernel-version.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta-phosphor/classes/obmc-phosphor-kernel-version.bbclass')
-rw-r--r--meta-phosphor/classes/obmc-phosphor-kernel-version.bbclass17
1 files changed, 17 insertions, 0 deletions
diff --git a/meta-phosphor/classes/obmc-phosphor-kernel-version.bbclass b/meta-phosphor/classes/obmc-phosphor-kernel-version.bbclass
new file mode 100644
index 0000000000..8fa8947e5e
--- /dev/null
+++ b/meta-phosphor/classes/obmc-phosphor-kernel-version.bbclass
@@ -0,0 +1,17 @@
+do_kernel_configme_append() {
+ # Remove previous CONFIG_LOCALVERSION
+ sed -i '/CONFIG_LOCALVERSION/d' ${B}/.config
+
+ # Latest version after yocto patched (if any)
+ latestVersion="-$(git rev-parse --verify HEAD)"
+ shortLatestVersion="$(echo ${latestVersion} | cut -c1-8)"
+
+ shortLinuxVersionExt="$(echo ${LINUX_VERSION_EXTENSION} | cut -c1-8)"
+
+ if [ "${latestVersion}" != "${LINUX_VERSION_EXTENSION}" ]; then
+ dirtyString="-dirty"
+ echo "CONFIG_LOCALVERSION="\"${shortLinuxVersionExt}${dirtyString}${shortLatestVersion}\" >> ${B}/.config
+ else
+ echo "CONFIG_LOCALVERSION="\"${shortLinuxVersionExt}\" >> ${B}/.config
+ fi
+}