From 21349d54a179ac2b2ac216cc299ca9e35f0c1aab Mon Sep 17 00:00:00 2001 From: Changqing Li Date: Tue, 30 Sep 2025 16:00:55 +0800 Subject: [PATCH] package.py: replace all files unconditionally when copy debug sources This is for fixing reproducible issue for package like: intel-speed-select-src. For intel-speed-select, one of the debug sources is /usr/src/debug/intel-speed-select/1.0/include/linux/thermal.h, file include/linux/thermal.h under ${S} (kernel-sources) link file include/linux/thermal.h under ${B}, which link to ${S}/include/uapi/linux/thermal.h During copy debug sources, sources under ${S} copied first, then sources under ${B} is copied. mtime of ${S}/include/linux/thermal.h and ${S}/include/uapi/linux/thermal.h are decided by when it is fetched, so it is not determinate, maybe same or different. For cpio, if the in file is older than or the same as the exist file, cpio will not replace the exist file with warning "cpio: xxx not created: newer or same age version exists". And this will cause intel-speed-select-src maybe not reproducible. And option '-u' for cpio, first, this will make the copied file determistic. Second, source files under ${B} should have higher priority then ${S}, it may be generated during build, the target is more likely to use this file. (From OE-Core rev: 8898f97b4acc9d5c2c6583c91d05327f9093133e) Signed-off-by: Changqing Li Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- meta/lib/oe/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index ce69151e5d..baaa0cba02 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -1016,7 +1016,7 @@ def copydebugsources(debugsrcdir, sources, d): cmd += "fgrep -zw '%s' | " % prefixmap[pmap] # Remove prefix in the source paths cmd += "sed 's#%s/##g' | " % (prefixmap[pmap]) - cmd += "(cd '%s' ; cpio -pd0mlL --no-preserve-owner '%s%s' 2>/dev/null)" % (pmap, dvar, prefixmap[pmap]) + cmd += "(cd '%s' ; cpio -pd0mlLu --no-preserve-owner '%s%s' 2>/dev/null)" % (pmap, dvar, prefixmap[pmap]) try: subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)