summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel.bbclass
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2022-11-17 12:11:55 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-07 15:02:45 +0000
commit3dd024f384a2a12b46f78f2bc82c02c71ccfeabf (patch)
treea6fef81fc4660be177ba9422456f9631aa0bcd49 /meta/classes/kernel.bbclass
parenta1e6d60633a939c0a91d040ce432a9e7fd35ea0a (diff)
downloadpoky-3dd024f384a2a12b46f78f2bc82c02c71ccfeabf.tar.gz
kernel.bbclass: make KERNEL_DEBUG_TIMESTAMPS work at rebuild
Currently, the KERNEL_DEBUG_TIMESTAMPS is not working as expected at rebuild. That is, even if we set it to "1", the kernel build time is not changed. The problem could be reproduced by the following steps. 1. bitbake core-image-minimal; start image and check `uname -a` output. 2. set in local.conf: KERNEL_DEBUG_TIMESTAMPS = "1" 3. bitbake core-image-minimal; start image and check `uname -a` output. It's expected that after enabling KERNEL_DEBUG_TIMESTAMPS, the kernel build time will be set to current date. But it's not. This is because the compile.h was not re-generated when do_compile task was re-executed. In mkcompile_h, we have: """ # Only replace the real compile.h if the new one is different, # in order to preserve the timestamp and avoid unnecessary # recompilations. # We don't consider the file changed if only the date/time changed, # unless KBUILD_BUILD_TIMESTAMP was explicitly set (e.g. for # reproducible builds with that value referring to a commit timestamp). # A kernel config change will increase the generation number, thus # causing compile.h to be updated (including date/time) due to the # changed comment in the # first line. """ It has made it very clear that it will not be re-generated unless we have KBUILD_BUILD_TIMESTAMP set explicitly. So we set this variable explicitly in do_compile to fix this issue. (From OE-Core rev: 640ac18b2daed698adbf849a5aef55f5de9e5db5) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 1b68c2d2d385013a1c535ef81172494302a36d74) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel.bbclass')
-rw-r--r--meta/classes/kernel.bbclass8
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index ad2b296c2d..3e7264fb98 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -361,6 +361,10 @@ kernel_do_compile() {
361 export KBUILD_BUILD_TIMESTAMP="$ts" 361 export KBUILD_BUILD_TIMESTAMP="$ts"
362 export KCONFIG_NOTIMESTAMP=1 362 export KCONFIG_NOTIMESTAMP=1
363 bbnote "KBUILD_BUILD_TIMESTAMP: $ts" 363 bbnote "KBUILD_BUILD_TIMESTAMP: $ts"
364 else
365 ts=`LC_ALL=C date`
366 export KBUILD_BUILD_TIMESTAMP="$ts"
367 bbnote "KBUILD_BUILD_TIMESTAMP: $ts"
364 fi 368 fi
365 # The $use_alternate_initrd is only set from 369 # The $use_alternate_initrd is only set from
366 # do_bundle_initramfs() This variable is specifically for the 370 # do_bundle_initramfs() This variable is specifically for the
@@ -406,6 +410,10 @@ do_compile_kernelmodules() {
406 export KBUILD_BUILD_TIMESTAMP="$ts" 410 export KBUILD_BUILD_TIMESTAMP="$ts"
407 export KCONFIG_NOTIMESTAMP=1 411 export KCONFIG_NOTIMESTAMP=1
408 bbnote "KBUILD_BUILD_TIMESTAMP: $ts" 412 bbnote "KBUILD_BUILD_TIMESTAMP: $ts"
413 else
414 ts=`LC_ALL=C date`
415 export KBUILD_BUILD_TIMESTAMP="$ts"
416 bbnote "KBUILD_BUILD_TIMESTAMP: $ts"
409 fi 417 fi
410 if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then 418 if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then
411 oe_runmake -C ${B} ${PARALLEL_MAKE} modules ${KERNEL_EXTRA_ARGS} 419 oe_runmake -C ${B} ${PARALLEL_MAKE} modules ${KERNEL_EXTRA_ARGS}