If you have dash as /bin/sh (as you do by default on Ubuntu), running devtool within the SDK does not work, because apparently oe-init-build-env does not work the same way under dash as it does under bash. "devtool add" fails because oe-init-build-env looks in the wrong place for oe-buildenv-internal; this is because oe-init-build-env falls back to the current directory as OEROOT when not under bash/zsh. If we work around that by setting the current directory to the actual OE root, when we run "devtool build", bitbake claims that the specified recipe doesn't exist because a new build directory is being created instead of the one we've already set up, and that new one doesn't have the workspace layer in its bblayers.conf. This is apparently because any argument you pass to a sourced script (in this case, the build directory) doesn't actually get passed to the script.
Hi Paul, How about setting executable to bash like below? Regards, Chen Qi diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 3f8158e..7e7908d 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py @@ -27,6 +27,10 @@ logger = logging.getLogger('devtool') def exec_build_env_command(init_path, builddir, cmd, watch=False, **options): import bb + # As the init script makes use of BASH_SOURCE to determine OEROOT, we need to set + # executable to bash to correctly set things up + if not 'executable' in options: + options["executable"] = 'bash' if not 'cwd' in options: options["cwd"] = builddir if init_path:
I asked Richard about this and his suggestion was to set BDIR instead (having ensured that the current directory is set to avoid the first issue).
To be honest I'm flexible with either approach...
OK, on reflection I've taken Qi's fix as it's simpler (thanks Qi!).
Fix merged to master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=5b1a6abcdedb51aee9b0a80d4c9a1ded6243f6e9