Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] sanity.bbclass: check that TMPDIR is not located on nfs
@ 2014-01-22 10:50 Robert Yang
  2014-01-22 10:50 ` [PATCH 1/1] " Robert Yang
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Yang @ 2014-01-22 10:50 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit fbf6ea2201a4e7042980a82b6c342280df2fbbc8:

  sanity.bbclass: check required perl modules (2014-01-22 18:44:18 +0800)

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib rbt/nfs
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=rbt/nfs

Robert Yang (1):
  sanity.bbclass: check that TMPDIR is not located on nfs

 meta/classes/sanity.bbclass | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] sanity.bbclass: check that TMPDIR is not located on nfs
  2014-01-22 10:50 [PATCH 0/1] sanity.bbclass: check that TMPDIR is not located on nfs Robert Yang
@ 2014-01-22 10:50 ` Robert Yang
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Yang @ 2014-01-22 10:50 UTC (permalink / raw)
  To: openembedded-core

There would be some unexpected errors when the whole TMPDIR is located
on nfs, so add a test for it in sanity.bbclass.

Note:
The better way to get the filesystem id should be get f_fsid from struct
statvfs, but there is no f_fsid in os.stat() or os.statvfs(), so we use
'stat -f -c "%t"' here.

BTW., s/tmpdir/TMPDIR/ in the previous comment message to make them have
a uniform.

[YOCTO #5442]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/classes/sanity.bbclass | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index e5bf970..bae010d 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -201,6 +201,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
     return ""
 
+def get_filesystem_id(path):
+    status, result = oe.utils.getstatusoutput("stat -f -c '%s' %s" % ("%t", path))
+    if status == 0:
+        return result
+    else:
+        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: %s can't be located on nfs.\n" % (name, path)
+    return ""
+
 def check_connectivity(d):
     # 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
@@ -584,9 +599,12 @@ def check_sanity_version_change(status, d):
     if not oes_bb_conf:
         status.addresult('You are not using the OpenEmbedded version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n')
 
-    # The length of tmpdir can't be longer than 410
+    # 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"))
+
 def check_sanity_everybuild(status, d):
     # Sanity tests which test the users environment so need to run at each build (or are so cheap
     # it makes sense to always run them.
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-22 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-22 10:50 [PATCH 0/1] sanity.bbclass: check that TMPDIR is not located on nfs Robert Yang
2014-01-22 10:50 ` [PATCH 1/1] " Robert Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox