bitbake.conf/pseudo: Switch from exclusion list to inclusion list

Currently, pseudo tracks all files referenced within its presence unless
they're listed in an exclusion list. The exclusion list has grown to be
fairly unwieldy.

This patch swaps PSEUDO_IGNORE_PATHS for PSEUDO_INCLUDE_PATHS which in
theory should be easier and more explicit to maintain.

This change does drop many directories from pseudo coverage including
/home and /tmp. There may be adapatations needed for recipes/classes
using pseudo in specific ways.

(From OE-Core rev: 2502da81709f25de499277b28d33c915638c45f6)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2025-05-10 16:54:21 +01:00
parent c40f78b267
commit 6a2ad60ecc
13 changed files with 20 additions and 27 deletions

View File

@@ -222,19 +222,19 @@ class Partition():
if (pseudo_dir):
# Canonicalize the ignore paths. This corresponds to
# calling oe.path.canonicalize(), which is used in bitbake.conf.
ignore_paths = [rootfs] + (get_bitbake_var("PSEUDO_IGNORE_PATHS") or "").split(",")
include_paths = [rootfs_dir] + (get_bitbake_var("PSEUDO_INCLUDE_PATHS") or "").split(",")
canonical_paths = []
for path in ignore_paths:
for path in include_paths:
if "$" not in path:
trailing_slash = path.endswith("/") and "/" or ""
canonical_paths.append(os.path.realpath(path) + trailing_slash)
ignore_paths = ",".join(canonical_paths)
include_paths = ",".join(canonical_paths)
pseudo = "export PSEUDO_PREFIX=%s;" % p_prefix
pseudo += "export PSEUDO_LOCALSTATEDIR=%s;" % pseudo_dir
pseudo += "export PSEUDO_PASSWD=%s;" % rootfs_dir
pseudo += "export PSEUDO_NOSYMLINKEXP=1;"
pseudo += "export PSEUDO_IGNORE_PATHS=%s;" % ignore_paths
pseudo += "export PSEUDO_INCLUDE_PATHS=%s;" % include_paths
pseudo += "%s " % get_bitbake_var("FAKEROOTCMD")
else:
pseudo = None