yoctobitbakeopenembeddedyocto-recipe

How to use a tool, installed on yocto build server host, from bitbake without qualifying it's full path?


I have installed bbe, the binary block editor on my Yocto build server host. I am able to use it within my images bitbake recipe if I qualify it's full path when using it, here is a example.

BBE_BIN = "/usr/bin/bbe"

modify_foobar_file() {
    ${BBE_BIN} -e 's/Some string/New string' foobar > ${WORKDIR}/foobar.modified
}

I would like to not have to qualify the pull path everytime I use it. How can I achieve this?

Two potential solutions come to mind. In one, I imagine something similar to what I need to do to use openssl from within a recipes functions, which is to declare a build time dependency on the native openssl package, like this DEPENDS = "openssl-native". In the other, maybe I can to fiddle with bitbake environments PATH so that it can find the bbe command during the build process.


Solution

  • Ideally, you write a recipe to build the tool and then DEPENDS="bbe-native" where needed. This means you don't have to remember to install this tool whenever you setup a new machine, you don't need to document the tool, you get to control the upgrade cycle, and if you're making a commercial product you actually get it included in license and release manifests.

    The horrible hack is to add it to HOSTTOOLS.