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

Jeremy A. Puhlman jpuhlman at mvista.com
Wed Oct 11 03:55:02 UTC 2017



On 10/10/2017 6:57 PM, Christopher Larson wrote:
> 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 \
> '

Yes. You can manually modify the file. However if you use bitbake-layers 
layerindex-fetch or bitbake layer-add, it is always absolute. OTOH, you 
could make the same argument for not needing "bitbake-layers add-layers 
"since you can also manually modify the file.

>
> On Tue, Oct 10, 2017 at 2:47 PM, Jeremy Puhlman <jpuhlman at mvista.com 
> <mailto:jpuhlman at mvista.com>> wrote:
>
>     From: "Jeremy A. Puhlman" <jpuhlman at mvista.com
>     <mailto: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
>     <mailto: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
>     <mailto:bitbake-devel at lists.openembedded.org>
>     http://lists.openembedded.org/mailman/listinfo/bitbake-devel
>     <http://lists.openembedded.org/mailman/listinfo/bitbake-devel>
>
>
>
>
> -- 
> Christopher Larson
> kergoth at gmail dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Senior Software Engineer, Mentor Graphics

-- 
Jeremy A. Puhlman
jpuhlman at mvista.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20171010/86a20318/attachment-0002.html>


More information about the bitbake-devel mailing list