summaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
diff options
context:
space:
mode:
authorJoshua Lock <josh@linux.intel.com>2012-05-11 18:00:26 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-17 21:13:10 +0100
commitc2df43b5dbeadc6fff26b8bc6e3bbc07f59b81fa (patch)
tree5a27a2c8e005d7b6be2625160d0ef2e8879e85fb /meta/classes/sanity.bbclass
parentcedfe1d50dbd71bbb3e2696c41be8007fcdff559 (diff)
downloadpoky-c2df43b5dbeadc6fff26b8bc6e3bbc07f59b81fa.tar.gz
sanity.bbclass: check user can read and write to SSTATE_DIR
The user needs read and write permissions to SSTATE_DIR, check whether they have sufficient permissions and if not recommend use of SSTATE_MIRRORS. (From OE-Core rev: 0c0c4efbf92bcf0f8942f17c18525a4b4ed1798c) Signed-off-by: Joshua Lock <josh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sanity.bbclass')
-rw-r--r--meta/classes/sanity.bbclass17
1 files changed, 14 insertions, 3 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 05545f45f7..ff3c413017 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -96,10 +96,16 @@ def check_conf_exists(fn, data):
96def check_sanity_sstate_dir_change(sstate_dir, data): 96def check_sanity_sstate_dir_change(sstate_dir, data):
97 # Sanity checks to be done when the value of SSTATE_DIR changes 97 # Sanity checks to be done when the value of SSTATE_DIR changes
98 98
99 # Check that SSTATE_DIR isn't on a filesystem with limited filename length (eg. eCryptFS)
100 testmsg = "" 99 testmsg = ""
101 if sstate_dir != "": 100 if sstate_dir != "":
102 testmsg = check_create_long_filename(sstate_dir, "SSTATE_DIR") 101 # Check that the user can read and write to SSTATE_DIR
102 sstatemsg = check_can_read_write_directory(sstate_dir) or None
103 if sstatemsg:
104 sstatemsg = sstatemsg + ". You could try using it as an SSTATE_MIRRORS instead of SSTATE_CACHE.\n"
105 testmsg = testmsg + sstatemsg
106 # Check that SSTATE_DIR isn't on a filesystem with limited filename length (eg. eCryptFS)
107 testmsg = testmsg + check_create_long_filename(sstate_dir, "SSTATE_DIR")
108
103 return testmsg 109 return testmsg
104 110
105def check_sanity_tmpdir_change(tmpdir, data): 111def check_sanity_tmpdir_change(tmpdir, data):
@@ -150,7 +156,12 @@ def check_create_long_filename(filepath, pathname):
150 if errno == 36: # ENAMETOOLONG 156 if errno == 36: # ENAMETOOLONG
151 return "Failed to create a file with a long name in %s. Please use a filesystem that does not unreasonably limit filename length.\n" % pathname 157 return "Failed to create a file with a long name in %s. Please use a filesystem that does not unreasonably limit filename length.\n" % pathname
152 else: 158 else:
153 return "Failed to create a file in %s: %s" % (pathname, strerror) 159 return "Failed to create a file in %s: %s\n" % (pathname, strerror)
160 return ""
161
162def check_can_read_write_directory(directory):
163 if not os.access(directory, os.R_OK|os.W_OK):
164 return "Insufficient permissions for %s" % directory
154 return "" 165 return ""
155 166
156def check_connectivity(d): 167def check_connectivity(d):