[oe-commits] Mariano Lopez : sanity.bbclass: Check if /tmp is writable

git at git.openembedded.org git at git.openembedded.org
Thu Jul 2 22:08:59 UTC 2015


Module: openembedded-core.git
Branch: master
Commit: 10c7cf0683494ea1bf2cc6de9b121abf2a04b253
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=10c7cf0683494ea1bf2cc6de9b121abf2a04b253

Author: Mariano Lopez <mariano.lopez at linux.intel.com>
Date:   Mon Jun 29 07:20:10 2015 +0000

sanity.bbclass: Check if /tmp is writable

If /tmp can't be written, bitbake gaves an unrelated error.
This checks if /tmp can be written in every build.

[YOCTO #7922]

Signed-off-by: Mariano Lopez <mariano.lopez at linux.intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>

---

 meta/classes/sanity.bbclass | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 2855941..7a580da 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -704,6 +704,19 @@ def check_sanity_everybuild(status, d):
     if "." in paths or "./" in paths or "" in paths:
         status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n")
 
+    # Check if /tmp is writable
+    from string import ascii_letters
+    from random import choice
+    filename = "bb_writetest.%s" % os.getpid()
+    testfile = os.path.join("/tmp", filename)
+    try:
+        f = open(testfile, "w")
+        f.write("".join(choice(ascii_letters) for x in range(1024)))
+        f.close()
+        os.remove(testfile)
+    except:
+        status.addresult("Failed to write into /tmp. Please verify your filesystem.")
+
     # Check that the DISTRO is valid, if set
     # need to take into account DISTRO renaming DISTRO
     distro = d.getVar('DISTRO', True)



More information about the Openembedded-commits mailing list