From d696edd8d12d6feb32f698bba7bfa16b8f43932e Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Thu, 28 Apr 2022 09:47:53 -0400 Subject: kernel-yocto: allow patch author date to be commit date In situations where a buid needs to be reproducible, it is sometimes desireable to use a patches author date, versus the time when it is applied. This generates a consistent hash between different patch applications. We leverage the existing KERNEL_DEBUG_TIMESTAMPS to trigger the use of a new option to kgit-s2q. This allows us to use the author date in a reproducible configuration, but disable it if we need the current time/date. (From OE-Core rev: 8dbce9b13960acfd6889567c11456e3c73a783b5) Signed-off-by: Bruce Ashfield Signed-off-by: Richard Purdie (cherry picked from commit ebe2411ce78d5e4ea49b9b4cb732b461ecc32ca6) Signed-off-by: Steve Sakoman Signed-off-by: Richard Purdie --- meta/classes/kernel-yocto.bbclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'meta/classes') diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index afccffcf17..e8046bb8f6 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass @@ -322,7 +322,11 @@ do_patch() { meta_dir=$(kgit --meta) (cd ${meta_dir}; ln -sf patch.queue series) if [ -f "${meta_dir}/series" ]; then - kgit-s2q --gen -v --patches .kernel-meta/ + kgit_extra_args="" + if [ "${KERNEL_DEBUG_TIMESTAMPS}" != "1" ]; then + kgit_extra_args="--commit-sha author" + fi + kgit-s2q --gen -v $kgit_extra_args --patches .kernel-meta/ if [ $? -ne 0 ]; then bberror "Could not apply patches for ${KMACHINE}." bbfatal_log "Patch failures can be resolved in the linux source directory ${S})" -- cgit v1.2.3-54-g00ecf