diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2015-06-29 07:20:10 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-02 23:08:39 +0100 |
commit | cea20425a3dcb8868c53518cbec4b250076f1675 (patch) | |
tree | 607442d058c4ed64bd79c9e62d1c02d2670bf48c | |
parent | 38d8f2eb9f1e34657ef1210b28b73dbfb2b1767d (diff) | |
download | poky-cea20425a3dcb8868c53518cbec4b250076f1675.tar.gz |
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]
(From OE-Core rev: 10c7cf0683494ea1bf2cc6de9b121abf2a04b253)
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/sanity.bbclass | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index 2855941a7b..7a580da755 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
@@ -704,6 +704,19 @@ def check_sanity_everybuild(status, d): | |||
704 | if "." in paths or "./" in paths or "" in paths: | 704 | if "." in paths or "./" in paths or "" in paths: |
705 | status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n") | 705 | status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n") |
706 | 706 | ||
707 | # Check if /tmp is writable | ||
708 | from string import ascii_letters | ||
709 | from random import choice | ||
710 | filename = "bb_writetest.%s" % os.getpid() | ||
711 | testfile = os.path.join("/tmp", filename) | ||
712 | try: | ||
713 | f = open(testfile, "w") | ||
714 | f.write("".join(choice(ascii_letters) for x in range(1024))) | ||
715 | f.close() | ||
716 | os.remove(testfile) | ||
717 | except: | ||
718 | status.addresult("Failed to write into /tmp. Please verify your filesystem.") | ||
719 | |||
707 | # Check that the DISTRO is valid, if set | 720 | # Check that the DISTRO is valid, if set |
708 | # need to take into account DISTRO renaming DISTRO | 721 | # need to take into account DISTRO renaming DISTRO |
709 | distro = d.getVar('DISTRO', True) | 722 | distro = d.getVar('DISTRO', True) |