From bd4f11b2c0da3caecf6f03bebf873bb49db6fbd8 Mon Sep 17 00:00:00 2001 From: Anders Heimer Date: Tue, 2 Jun 2026 10:34:45 +0200 Subject: [PATCH] bitbake: fetch2: Unpack RPMs with --no-absolute-filenames Use cpio --no-absolute-filenames when unpacking RPM and SRPM archives so absolute paths and parent-directory components in cpio member names are extracted relative to the intended unpack directory. (Bitbake rev: 37beb06ba9329cd16976273efbb341f781d4e749) Signed-off-by: Anders Heimer Signed-off-by: Richard Purdie (cherry picked from commit 1b1a71586aa93678c1d9ca40ef2c6fa518f89356) Signed-off-by: Yoann Congal Signed-off-by: Paul Barker --- bitbake/lib/bb/fetch2/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 7f6cf8ba99..f2835397a5 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -1563,11 +1563,11 @@ class FetchMethod(object): elif file.endswith('.rpm') or file.endswith('.srpm'): if 'extract' in urldata.parm: unpack_file = urldata.parm.get('extract') - cmd = 'rpm2cpio.sh %s | cpio -id %s' % (file, unpack_file) + cmd = 'rpm2cpio.sh %s | cpio --no-absolute-filenames -id %s' % (file, unpack_file) iterate = True iterate_file = unpack_file else: - cmd = 'rpm2cpio.sh %s | cpio -id' % (file) + cmd = 'rpm2cpio.sh %s | cpio --no-absolute-filenames -id' % (file) elif file.endswith('.deb') or file.endswith('.ipk'): output = subprocess.check_output(['ar', '-t', file], preexec_fn=subprocess_setup) datafile = None