[bitbake-devel] [PATCH] Allow layers to be added relative to topdir.

Christopher Larson kergoth at gmail.com
Wed Oct 11 01:57:04 UTC 2017


I see no need for this patch:

TOPDIR := '${@os.path.dirname(os.path.dirname(FILE))}'
BBPATH = '${TOPDIR}'
BBFILES = ''
BBLAYERS = '\
    ${TOPDIR}/poky/meta-yocto-bsp \
    ${TOPDIR}/poky/meta-yocto \
    ${TOPDIR}/poky/meta \
    ${TOPDIR}/meta-oe/meta-oe \
'

On Tue, Oct 10, 2017 at 2:47 PM, Jeremy Puhlman <jpuhlman at mvista.com> wrote:

> From: "Jeremy A. Puhlman" <jpuhlman at mvista.com>
>
> Use case:
> Some users place their projects and their layers under source control.
> If absolute paths are used for the layers, the bblayers file is invalid
> when checked out on another system. If the layers are checked in
> relative to the project, then the project can be used anywhere.
>
> If LAYERS_RELATIVE is set in the bblayers.conf file, each layer is added
> relative to TOPDIR.
>
> Signed-off-by: Jeremy Puhlman <jpuhlman at mvista.com>
> ---
>  lib/bblayers/action.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lib/bblayers/action.py b/lib/bblayers/action.py
> index b1326e5..4dc6622 100644
> --- a/lib/bblayers/action.py
> +++ b/lib/bblayers/action.py
> @@ -38,7 +38,9 @@ class ActionPlugin(LayerPlugin):
>          tempdir = tempfile.mkdtemp()
>          backup = tempdir + "/bblayers.conf.bak"
>          shutil.copy2(bblayers_conf, backup)
> -
> +        if self.tinfoil.config_data.getVar('LAYERS_RELATIVE'):
> +            topdir = self.tinfoil.config_data.getVar('TOPDIR')
> +            layerdir = os.path.join("${TOPDIR}", os.path.relpath(layerdir,
> topdir))
>          try:
>              notadded, _ = bb.utils.edit_bblayers_conf(bblayers_conf,
> layerdir, None)
>              if not (args.force or notadded):
> --
> 2.6.2
>
> --
> _______________________________________________
> bitbake-devel mailing list
> bitbake-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>



-- 
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20171010/37e7b5a2/attachment-0002.html>


More information about the bitbake-devel mailing list