summaryrefslogtreecommitdiffstats
path: root/meta/classes/sanity.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/sanity.bbclass')
-rw-r--r--meta/classes/sanity.bbclass25
1 files changed, 24 insertions, 1 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index a6d320b167..6e13d2ac4d 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -40,7 +40,26 @@ def check_sanity_tmpdir_change(tmpdir):
def check_sanity_version_change():
# Sanity checks to be done when SANITY_VERSION changes
return ""
-
+
+def check_pseudo_wrapper():
+ import subprocess as sub
+ # Check if bitbake wrapper is being used
+ pseudo_build = os.environ.get( 'PSEUDO_BUILD' )
+ if not pseudo_build:
+ bb.warn("Bitbake has not been run using the bitbake wrapper (scripts/bitbake); this is likely because your PATH has been altered from that normally set up by the poky-init-build-env script. Not using the wrapper may result in failures during package installation, so it is highly recommended that you set your PATH back so that the wrapper script is being executed.")
+
+ if (not pseudo_build) or pseudo_build == '2':
+ # pseudo ought to be working, let's see if it is...
+ p = sub.Popen(['sh', '-c', 'PSEUDO_DISABLED=0 id -u'],stdout=sub.PIPE,stderr=sub.PIPE)
+ out, err = p.communicate()
+ if out.rstrip() != '0':
+ msg = "Pseudo is not functioning correctly, which will cause failures during package installation. Please check your configuration."
+ if pseudo_build == '2':
+ return msg
+ else:
+ bb.warn(msg)
+ return ""
+
def check_create_long_filename(filepath, pathname):
testfile = os.path.join(filepath, ''.join([`num`[-1] for num in xrange(1,200)]))
try:
@@ -187,6 +206,10 @@ def check_sanity(e):
missing = missing.rstrip(',')
messages = messages + "Please install following missing utilities: %s\n" % missing
+ pseudo_msg = check_pseudo_wrapper()
+ if pseudo_msg != "":
+ messages = messages + pseudo_msg + '\n'
+
# Check if DISPLAY is set if IMAGETEST is set
if not data.getVar( 'DISPLAY', e.data, True ) and data.getVar( 'IMAGETEST', e.data, True ) == 'qemu':
messages = messages + 'qemuimagetest needs a X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)\n'