diff --git a/scripts/runqemu b/scripts/runqemu index 55b8c05217..2be7a0f286 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -1692,9 +1692,6 @@ to your build configuration. self.cleaned = True def run_bitbake_env(self, mach=None, target=''): - bitbake = shutil.which('bitbake') - if not bitbake: - return if not mach: mach = self.get('MACHINE') @@ -1711,6 +1708,10 @@ to your build configuration. else: cmd = 'bitbake -e %s %s' % (multiconfig, target) + bitbake = shutil.which('bitbake') + if not bitbake: + raise OEPathError("Bitbake is needed to run '%s', but it is not found in PATH. Please source the bitbake build environment." % cmd.strip()) + logger.info('Running %s...' % cmd) try: return subprocess.check_output(cmd, shell=True).decode('utf-8')