[2/2] sanity.bbclass: check that TMPDIR is not located on nfs
Submitted by Robert Yang on Nov. 1, 2013, 5:26 p.m.
Patch ID: 60955
@@ -198,6 +198,21 @@ def check_path_length(filepath, pathname, limit):
return "The length of %s is longer than 410, this would cause unexpected errors, please use a shorter path.\n" % pathname
+ status, result = oe.utils.getstatusoutput("stat -f -c '%s' %s" % ("%t", path))
+ if status == 0:
+ return result
+ bb.warn("Can't get the filesystem id of: %s" % path)
+ return None
+# Check that the path isn't located on nfs.
+def check_not_nfs(path, name):
+ # The nfs' filesystem id is 6969
+ if get_filesystem_id(path) == "6969":
+ return "The %s can't be located on nfs.\n" % name
+ return ""
# URI's to check can be set in the CONNECTIVITY_CHECK_URIS variable
# using the same syntax as for SRC_URI. If the variable is not set
@@ -672,6 +687,9 @@ def check_sanity_everybuild(status, d):
# The length of TMPDIR can't be longer than 410
status.addresult(check_path_length(tmpdir, "TMPDIR", 410))
+ # Check that TMPDIR isn't located on nfs
+ status.addresult(check_not_nfs(tmpdir, "TMPDIR"))