Skip to contentSkip to conversation

package.py: replace all files unconditionally when copy debug sources

PATCH New [email protected] 1 participant 1 message Sep 30, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package.py: replace all files unconditionally when copy debug sources

From: Changqing Li <[email protected]>

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.

---
 meta/lib/oe/package.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oe/package.py +1 -1
index ce69151e5d..baaa0cba02 100644
@@ -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)
Signature · 1 line
2.34.1