]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
package.py: replace all files unconditionally when copy debug sources
authorChangqing Li <changqing.li@windriver.com>
Tue, 30 Sep 2025 08:00:55 +0000 (16:00 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 2 Oct 2025 10:27:31 +0000 (11:27 +0100)
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.

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/lib/oe/package.py

index ce69151e5d35f665f374df8435ccc3ecb844c993..baaa0cba02e119a56999fbc338191501429788c5 100644 (file)
@@ -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)