Skip to contentSkip to conversation

sanity.bbclass: Check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap

PATCH New Dorinda 1 participant 1 message Feb 1, 2021

lore
Share & tools
lore

Dorinda

author
#0 lore raw

PATCH v4 1/1 sanity.bbclass: Check if PSEUDO_IGNORE_PATHS and paths under pseudo control overlap

Added a sanity check for when PSEUDO_IGNORE_PATHS and paths under pseudo control overlap to avoid random failures generated.

[YOCTO #14193]

---
v4:
-Edited pseudocontroldir variable
-Changed error log

 meta/classes/sanity.bbclass | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/classes/sanity.bbclass +10 -0
index c6842ff549..485173ab48 100644
@@ -710,6 +710,16 @@ def check_sanity_version_change(status, d):
         if i and workdir.startswith(i):
             status.addresult("You are building in a path included in PSEUDO_IGNORE_PATHS " + str(i) + " please locate the build outside this path.\n")
 
+    # Check if PSEUDO_IGNORE_PATHS and and paths under pseudo control overlap
+    pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS', expand=True).split(",")
+    pseudo_control_dir = "${D},${PKGD},${PKGDEST},${IMAGEROOTFS},${SDK_OUTPUT}"
+    pseudocontroldir = d.expand(pseudo_control_dir).split(",")
+    for i in pseudoignorepaths:
+        for j in pseudocontroldir:
+            if i and j:
+                if j.startswith(i):
+                    status.addresult("A path included in PSEUDO_IGNORE_PATHS " + str(i) + " and the path " + str(j) + " overlap and this will break pseudo permission and ownership tracking. Please set the path " + str(j) + " to a different directory which does not overlap with pseudo controlled directories. \n")
+
     # Some third-party software apparently relies on chmod etc. being suid root (!!)
     import stat
     suid_check_bins = "chown chmod mknod".split()
Signature · 1 line
2.17.1