summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-03-16 16:51:40 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-03-17 00:18:14 +0000
commit3046a96bf0bdb1ca32db96a11a372a0e09f91856 (patch)
tree866eec977e5324bc9595aaa437087271bbf503b6 /meta
parent275241ea681a8a6019b89c41ec39d65c45b851f3 (diff)
downloadpoky-3046a96bf0bdb1ca32db96a11a372a0e09f91856.tar.gz
sanity: detect if bitbake wrapper is not being used or pseudo is broken
* Shows a warning during sanity checking if the scripts/bitbake wrapper is not being used * Check to see if pseudo is working during sanity checking, and if it isn't an error occurs (if we are using the wrapper script and pseudo has been built; otherwise it is a warning). Fixes [YOCTO #653] (From OE-Core rev: 0b06b69992dd3df1dfff7bde694d7ad23d8d15a0) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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):
40def check_sanity_version_change(): 40def check_sanity_version_change():
41 # Sanity checks to be done when SANITY_VERSION changes 41 # Sanity checks to be done when SANITY_VERSION changes
42 return "" 42 return ""
43 43
44def check_pseudo_wrapper():
45 import subprocess as sub
46 # Check if bitbake wrapper is being used
47 pseudo_build = os.environ.get( 'PSEUDO_BUILD' )
48 if not pseudo_build:
49 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.")
50
51 if (not pseudo_build) or pseudo_build == '2':
52 # pseudo ought to be working, let's see if it is...
53 p = sub.Popen(['sh', '-c', 'PSEUDO_DISABLED=0 id -u'],stdout=sub.PIPE,stderr=sub.PIPE)
54 out, err = p.communicate()
55 if out.rstrip() != '0':
56 msg = "Pseudo is not functioning correctly, which will cause failures during package installation. Please check your configuration."
57 if pseudo_build == '2':
58 return msg
59 else:
60 bb.warn(msg)
61 return ""
62
44def check_create_long_filename(filepath, pathname): 63def check_create_long_filename(filepath, pathname):
45 testfile = os.path.join(filepath, ''.join([`num`[-1] for num in xrange(1,200)])) 64 testfile = os.path.join(filepath, ''.join([`num`[-1] for num in xrange(1,200)]))
46 try: 65 try:
@@ -187,6 +206,10 @@ def check_sanity(e):
187 missing = missing.rstrip(',') 206 missing = missing.rstrip(',')
188 messages = messages + "Please install following missing utilities: %s\n" % missing 207 messages = messages + "Please install following missing utilities: %s\n" % missing
189 208
209 pseudo_msg = check_pseudo_wrapper()
210 if pseudo_msg != "":
211 messages = messages + pseudo_msg + '\n'
212
190 # Check if DISPLAY is set if IMAGETEST is set 213 # Check if DISPLAY is set if IMAGETEST is set
191 if not data.getVar( 'DISPLAY', e.data, True ) and data.getVar( 'IMAGETEST', e.data, True ) == 'qemu': 214 if not data.getVar( 'DISPLAY', e.data, True ) and data.getVar( 'IMAGETEST', e.data, True ) == 'qemu':
192 messages = messages + 'qemuimagetest needs a X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)\n' 215 messages = messages + 'qemuimagetest needs a X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)\n'