Skip to contentSkip to conversation

insane: Fix buildpaths test to work with special devices

PATCH New Richard Purdie 1 participant 1 message Jul 2, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 insane: Fix buildpaths test to work with special devices

If enabled, the buildpaths test hangs in psplash as it tries to open a fifo and read from it, hanging indefinitely.

Tweak the test to ignore fifo/socket/device files.

---
 meta/classes/insane.bbclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/classes/insane.bbclass +4 -2
index 8c5d5ecc820..c7b886fc0a2 100644
@@ -444,12 +444,14 @@ def package_qa_check_buildpaths(path, name, d, elf, messages):
     Check for build paths inside target files and error if paths are not
     explicitly ignored.
     """
+    import stat
     # Ignore .debug files, not interesting
     if path.find(".debug") != -1:
         return
 
-    # Ignore symlinks
-    if os.path.islink(path):
+    # Ignore symlinks/devs/fifos
+    mode = os.stat(path).st_mode
+    if stat.S_ISLNK(mode) or stat.S_ISBLK(mode) or stat.S_ISFIFO(mode) or stat.S_ISCHR(mode) or stat.S_ISSOCK(mode):
         return
 
     tmpdir = bytes(d.getVar('TMPDIR'), encoding="utf-8")
Signature · 1 line
2.34.1