]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
kernel.bbclass: make KERNEL_DEBUG_TIMESTAMPS work at rebuild
authorChen Qi <Qi.Chen@windriver.com>
Thu, 17 Nov 2022 04:11:55 +0000 (12:11 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 20 Nov 2022 08:28:49 +0000 (08:28 +0000)
commit1b68c2d2d385013a1c535ef81172494302a36d74
treed37e87f97585fb7431aa3bfeb6a234d765c3e5ac
parent6edf38add3c20c44efe0588e2815bb280d22e0c4
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.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
meta/classes-recipe/kernel.bbclass