From: Adrian Freihofer <[email protected]> pseudo_native_environment() built a fresh dict with only OECORE_NATIVE_SYSROOT and PSEUDO instead of the caller's environment. extract_sdk_rootfs() passes it straight to subprocess.run(env=...), which replaces the child's environment wholesale, so PATH (and everything else) was lost and tar fell back to the tar form the host. This regression was introduced in commit 78c176df1 (the Python refactor).
Symptom: "tar: unrecognized option '--zstd'" on hosts where the default-PATH tar doesn't support it (e.g. RHEL8's tar 1.30). Fix by starting from a copy of os.environ, matching how devtool/ide_sdk.py's extract_nfs_rootfs() already builds its own environment. Also derive the "Accepted types" error message in _tar_options() from tar_extract_options's keys instead of a separately hardcoded list. Signed-off-by: Adrian Freihofer <[email protected]> --- scripts/lib/pseudo_rootfs_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/lib/pseudo_rootfs_utils.py b/scripts/lib/pseudo_rootfs_utils.py index 89d082f672..12431e2080 100644 --- a/scripts/lib/pseudo_rootfs_utils.py +++ b/scripts/lib/pseudo_rootfs_utils.py @@ -37,7 +37,8 @@ def pseudo_native_environment(): if not native_sysroot or not os.path.exists(native_sysroot): raise PseudoRootfsError("%s doesn't exist" % native_sysroot) - environment = {'OECORE_NATIVE_SYSROOT': native_sysroot} + environment = dict(os.environ) + environment['OECORE_NATIVE_SYSROOT'] = native_sysroot environment['PSEUDO'] = os.path.join(native_sysroot, 'usr', 'bin', 'pseudo') return environment @@ -55,7 +56,7 @@ def _tar_options(rootfs_tarball): return ['--numeric-owner', *option.split()] raise PseudoRootfsError( 'Unable to determine sdk tarball format\n' - 'Accepted types: .tar / .tar.gz / .tar.bz2 / .tar.xz / .tar.zst') + 'Accepted types: %s' % ' / '.join(tar_extract_options)) def pseudo_state_dir(rootfs_dir): -- 2.55.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#245600): https://lists.openembedded.org/g/openembedded-core/message/245600 Mute This Topic: https://lists.openembedded.org/mt/121188615/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
