summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
diff options
context:
space:
mode:
authorEnrico Jörns <ejo@pengutronix.de>2024-02-26 23:39:18 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-04-04 21:50:24 +0100
commitad81041a336a89abf3db495bb3dabe32dd4bc02f (patch)
tree58d4a4556c81898ede7d2c169f6274e2ae40b1e4 /meta/recipes-kernel
parent38f6f3a0664467bf9768802c7faced04e404efeb (diff)
downloadpoky-ad81041a336a89abf3db495bb3dabe32dd4bc02f.tar.gz
perf: fix TMPDIR contamination for recent mainline kernels
The sed command sed -i -e "s,prefix='\$(DESTDIR_SQ)/usr'$,prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(PYTHON_SITEPACKAGES_DIR)' --root='\$(DESTDIR)',g" \ ${S}/tools/perf/Makefile.perf that was introduced by oe-core commit 43f96506 ("perf: fix the install-python_ext") [1] and adapted with oe-core commit 138673f8 ("perf: Fix reproducibility issues with 5.19 onwards") [2], patches the 'setup.py install' arguments for the 'install-python_ext' Make target similar to what the setuptools3_legacy.bbclass provides as ${SETUPTOOLS_INSTALL_ARGS}. However, this only applies to the linux-yocto kernel patched with linux-yocto commit 3fd60d4d ("perf: change --root to --prefix for python install") [3] that was introduced in 2012 and never went upstream in any way. For a recent mainline kernel instead, we will run into host path contamination QA warnings like: | WARNING: perf-1.0-r0 do_package_qa: QA Issue: File /usr/lib/python3.11/site-packages/perf-0.1-py3.11-linux-x86_64.egg/EGG-INFO/SOURCES.txt in package perf-python contains reference to TMPDIR | File /usr/lib/python3.11/site-packages/perf-0.1-py3.11-linux-x86_64.egg/__pycache__/perf.cpython-311.pyc in package perf-python contains reference to TMPDIR [buildpaths] To fix this, this commit introduces a replacement for Makefile.perf that results in the exact same setup.py install args as for the linux-yocto kernel. In oe-core commit c849ed0c ("perf: fix the install-python_ext on upstream kernel") [4], the sed that was originally meant for 'Makefile' only, was extended to 'Makefile*' (and thus including) Makefile.perf to fix similar issues. Since this would the affect the just-introduced Makefile.perf-specific sed, the scope of this extra sed was limited back to 'Makefile' only. The line could also be entirely removed maybe, since it seems to be for very old kernels only. In general, I would tend to argue that the above-mentioned linux-yocto patch for should be dropped if it requires additional sed-based patching anyway. [1] https://git.openembedded.org/openembedded-core/commit/?id=43f965061f8af4c4537e9d9c0257253e613a616d [2] https://git.openembedded.org/openembedded-core/commit/?id=138673f833a72c636a7fa185089f25dda350dc54 [3] https://git.yoctoproject.org/linux-yocto/commit/?id=3fd60d4d6f0095b03ff9b7b1499a049c580e7302 [4] https://git.openembedded.org/openembedded-core/commit/?id=c849ed0c66a2fb7d91795c421eb4c87b47d03c0d (From OE-Core rev: e68d97dd605babc3c16815b890a52ea3a3a69965) Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r--meta/recipes-kernel/perf/perf.bb6
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index ae7e24aa0c..6c4ee4a208 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -230,14 +230,18 @@ do_configure:prepend () {
230 if [ -e "${S}/tools/perf/Makefile.perf" ]; then 230 if [ -e "${S}/tools/perf/Makefile.perf" ]; then
231 sed -i -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \ 231 sed -i -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \
232 ${S}/tools/perf/Makefile.perf 232 ${S}/tools/perf/Makefile.perf
233 # Variant with linux-yocto-specific patch
233 sed -i -e "s,prefix='\$(DESTDIR_SQ)/usr'$,prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(PYTHON_SITEPACKAGES_DIR)' --root='\$(DESTDIR)',g" \ 234 sed -i -e "s,prefix='\$(DESTDIR_SQ)/usr'$,prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(PYTHON_SITEPACKAGES_DIR)' --root='\$(DESTDIR)',g" \
234 ${S}/tools/perf/Makefile.perf 235 ${S}/tools/perf/Makefile.perf
236 # Variant for mainline Linux
237 sed -i -e "s,root='/\$(DESTDIR_SQ)',prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(PYTHON_SITEPACKAGES_DIR)' --root='/\$(DESTDIR_SQ)',g" \
238 ${S}/tools/perf/Makefile.perf
235 # backport https://github.com/torvalds/linux/commit/e4ffd066ff440a57097e9140fa9e16ceef905de8 239 # backport https://github.com/torvalds/linux/commit/e4ffd066ff440a57097e9140fa9e16ceef905de8
236 sed -i -e 's,\($(Q)$(SHELL) .$(arch_errno_tbl).\) $(CC) $(arch_errno_hdr_dir),\1 $(firstword $(CC)) $(arch_errno_hdr_dir),g' \ 240 sed -i -e 's,\($(Q)$(SHELL) .$(arch_errno_tbl).\) $(CC) $(arch_errno_hdr_dir),\1 $(firstword $(CC)) $(arch_errno_hdr_dir),g' \
237 ${S}/tools/perf/Makefile.perf 241 ${S}/tools/perf/Makefile.perf
238 fi 242 fi
239 sed -i -e "s,--root='/\$(DESTDIR_SQ)',--prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \ 243 sed -i -e "s,--root='/\$(DESTDIR_SQ)',--prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \
240 ${S}/tools/perf/Makefile* 244 ${S}/tools/perf/Makefile
241 245
242 if [ -e "${S}/tools/build/Makefile.build" ]; then 246 if [ -e "${S}/tools/build/Makefile.build" ]; then
243 sed -i -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \ 247 sed -i -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \