From 2ead4e6caa4cac9a1303e013b404b1fd4dfa0026 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Mon, 27 Sep 2021 13:56:02 +0100 Subject: [PATCH] runfvp: exit cleanly if tinfoil cannot be imported If bb.tinfoil cannot be imported, display a nice error instead of a backtrace. Change-Id: I20dab9dfdbd57c8e90c8321072bab4f70b8ace47 Signed-off-by: Ross Burton Signed-off-by: Jon Mason --- scripts/runfvp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/runfvp b/scripts/runfvp index e40bad0d..e9654268 100755 --- a/scripts/runfvp +++ b/scripts/runfvp @@ -34,7 +34,11 @@ def get_image_directory(machine=None): Get the DEPLOY_DIR_IMAGE for the specified machine (or the configured machine if not set). """ - import bb.tinfoil + try: + import bb.tinfoil + except ImportError: + logger.error("Cannot connect to BitBake, did you oe-init-build-env?") + sys.exit(1) if machine: os.environ["MACHINE"] = machine