All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel.bbclass: Stop creating empty .scmversion files
@ 2020-03-31 23:56 paulburton
  2020-04-01  1:29 ` [OE-core] " Bruce Ashfield
  2020-04-01 19:41 ` [PATCH v2] " Paul Burton
  0 siblings, 2 replies; 8+ messages in thread
From: paulburton @ 2020-03-31 23:56 UTC (permalink / raw)
  To: openembedded-core; +Cc: Paul Burton

The kernel_do_configure() function creates empty .scmversion files
within both the source & build directories. The presence of these files
causes the scm_version function within the kernel's
scripts/setlocalversion to always output the empty string, breaking the
kernel's CONFIG_LOCALVERSION_AUTO=y functionality which appends that
string to the kernel version. Rather than appending the git commit hash
or another SCM revision to the kernel version, the empty string is
appended causing CONFIG_LOCALVERSION_AUTO to do nothing.

This behavior was introduced for the build directory by commit
c73e50a91e02 ("kernel.bbclass: fix extra + in kernelrelease") and
extended to the source directory by commit cafb94f57123
("kernel.bbclass: touch .scmversion also in ${S}"). The motive isn't
entirely clear since these commits contain no meaningful descriptions
and the former links to a mailing list archive that is no longer online,
but the '+' character referenced would be appended if the kernel were
built from a dirty working tree. This in itself is useful information;
hiding that fact can only serve to muddy a user's understanding of what
kernel they're actually running. I have verified that building a kernel
from a clean working tree does not result in a spurious '+' character.

Remove the creation of the empty .scmversion files in order to restore
the kernel's CONFIG_LOCALVERSION_AUTO functionality. This allows users
of kernels built from non-tagged source & configured with
CONFIG_LOCALVERSION_AUTO=y to better determine what kernel they're
actually running.

Signed-off-by: Paul Burton <paulburton@google.com>
---
 meta/classes/kernel.bbclass | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index a724645466..46e24a19e2 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -521,12 +521,6 @@ check_oldest_kernel[vardepsexclude] += "OLDEST_KERNEL KERNEL_VERSION"
 do_configure[prefuncs] += "check_oldest_kernel"
 
 kernel_do_configure() {
-	# fixes extra + in /lib/modules/2.6.37+
-	# $ scripts/setlocalversion . => +
-	# $ make kernelversion => 2.6.37
-	# $ make kernelrelease => 2.6.37+
-	touch ${B}/.scmversion ${S}/.scmversion
-
 	if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then
 		mv "${S}/.config" "${B}/.config"
 	fi
-- 
2.26.0.rc2.310.g2932bb562d-goog


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-04-02  6:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 23:56 [PATCH] kernel.bbclass: Stop creating empty .scmversion files paulburton
2020-04-01  1:29 ` [OE-core] " Bruce Ashfield
2020-04-01  1:32   ` Bruce Ashfield
2020-04-01  1:03     ` Martin Jansa
2020-04-01 18:34       ` Paul Burton
2020-04-01 19:41 ` [PATCH v2] " Paul Burton
2020-04-01 23:54   ` [OE-core] " Richard Purdie
2020-04-02  6:21     ` Paul Burton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.