<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11567</bug_id>
          
          <creation_ts>2017-05-23 18:42:14 +0000</creation_ts>
          <short_desc>Trying to create an new layer with the yocto-layer script fails.</short_desc>
          <delta_ts>2018-05-15 10:36:08 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>2.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>May 15 2018: RESOLVED</status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.6 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Phlip Balister">philip</reporter>
          <assigned_to name="Stephano Cetola">stephano</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>brian.avery</cc>
    
    <cc>joshuagloe</cc>
    
    <cc>kristi</cc>
    
    <cc>leonardo.sandoval.gonzalez</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>srifenbark</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Done (doc changes complete)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>73449</commentid>
    <comment_count>0</comment_count>
    <who name="Phlip Balister">philip</who>
    <bug_when>2017-05-23 18:42:14 +0000</bug_when>
    <thetext>So I start adding a new layer to my custom distribution using this section of the manual:

5.1.8. Creating a General Layer Using the yocto-layer Script

but I can&apos;t find the yocto-layer script. I did find it in the meta-poky repo.

We should have a layer creation script that works for all distributions and is not poky specific.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73453</commentid>
    <comment_count>1</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-05-23 20:09:24 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; So I start adding a new layer to my custom distribution using this section
&gt; of the manual:
&gt; 
&gt; 5.1.8. Creating a General Layer Using the yocto-layer Script
&gt; 
&gt; but I can&apos;t find the yocto-layer script. I did find it in the meta-poky repo.
&gt; 

it is under the script folder, so belongs to oe-core:
~/poky&gt; git ls | grep yocto-layer
100755 blob d58facaa4186425ee105e578216b9b86ce5a24da    scripts/yocto-layer

&gt; We should have a layer creation script that works for all distributions and
&gt; is not poky specific.

the script is not tied to any poky version, as far as I know</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73461</commentid>
    <comment_count>2</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2017-05-24 04:01:51 +0000</bug_when>
    <thetext>I&apos;m afraid yocto-layer *is* from poky, it is not in OE-Core. The scripts directory in the poky repo does have some poky-only components, though I think they are limited to yocto-layer and yocto-bsp.

I do however agree it would be good to move this functionality into OE-Core, and it shouldn&apos;t be too much of a problem given that there&apos;s actually not much to the template (unlike yocto-bsp from which yocto-layer was originally derived). Having said that rather than a standalone script we might choose to make it part of bitbake-layers, with the template and perhaps even the plugin itself in OE-Core.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73468</commentid>
    <comment_count>3</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-05-24 13:59:40 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; I&apos;m afraid yocto-layer *is* from poky, it is not in OE-Core. The scripts
&gt; directory in the poky repo does have some poky-only components, though I
&gt; think they are limited to yocto-layer and yocto-bsp.

you are right, this is the list of files/folder that belong to poky [1]

poky_scripts = [&apos;scripts/yocto-bsp&apos;, &apos;scripts/yocto-kernel&apos;, &apos;scripts/yocto-layer&apos;, &apos;scripts/lib/bsp&apos;]

&gt; 
&gt; I do however agree it would be good to move this functionality into OE-Core,
&gt; and it shouldn&apos;t be too much of a problem given that there&apos;s actually not
&gt; much to the template (unlike yocto-bsp from which yocto-layer was originally
&gt; derived). Having said that rather than a standalone script we might choose
&gt; to make it part of bitbake-layers, with the template and perhaps even the
&gt; plugin itself in OE-Core.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe/tree/tests/test_mbox_mailinglist.py#n38</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74254</commentid>
    <comment_count>4</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-06-15 21:01:10 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; I&apos;m afraid yocto-layer *is* from poky, it is not in OE-Core. The scripts
&gt; directory in the poky repo does have some poky-only components, though I
&gt; think they are limited to yocto-layer and yocto-bsp.
&gt; 
&gt; I do however agree it would be good to move this functionality into OE-Core,

base on the following text, I believe you mean bitbake instead of oe-core.

&gt; and it shouldn&apos;t be too much of a problem given that there&apos;s actually not
&gt; much to the template (unlike yocto-bsp from which yocto-layer was originally
&gt; derived). Having said that rather than a standalone script we might choose
&gt; to make it part of bitbake-layers, with the template and perhaps even the
&gt; plugin itself in OE-Core.

so you mean we should migrate the poky/scripts/lib/bsp relevant templates into bitbake? if this is the case, also some parts of scripts/lib/bsp/engine.py must be migrated. IMO, using the poky engine is too much for this task so my approach would to have all meta layer creation logic inside the bitbbake/lib/bblayers/action.py.

Let me know what you think.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74304</commentid>
    <comment_count>5</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-06-16 22:59:10 +0000</bug_when>
    <thetext>First approach, still not send to the ML

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=lsandov1/bitbake-layers-create-layer</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74342</commentid>
    <comment_count>6</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-06-19 17:37:06 +0000</bug_when>
    <thetext>patch sent to the bb ML:

http://lists.openembedded.org/pipermail/bitbake-devel/2017-June/008748.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75025</commentid>
    <comment_count>7</comment_count>
    <who name="brian avery">brian.avery</who>
    <bug_when>2017-07-14 00:40:24 +0000</bug_when>
    <thetext>any status or feedback on this?
Once it is accepted, are we planning to remove yocto-layers and update the docs?  If so, could we make a bug to that effect and make it dependent on this one?

I was about to enter in a yocto-layers bug and it may now be irrelevant :)!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75136</commentid>
    <comment_count>8</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-07-19 15:25:48 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; any status or feedback on this?
&gt; Once it is accepted, are we planning to remove yocto-layers and update the
&gt; docs?  If so, could we make a bug to that effect and make it dependent on
&gt; this one?
&gt; 

All good questions that I do not have a definite answer. In my opinion, both code/docs can coexist. what I did is focused on bitbake and the latter is also used outside our oe-core world (perhaps oe-core is the project that uses it more). The only item missing is the documentation on bitbake and for this I have update this entry. 

&gt; I was about to enter in a yocto-layers bug and it may now be irrelevant :)!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75921</commentid>
    <comment_count>9</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-08-16 19:39:37 +0000</bug_when>
    <thetext>This feature has been merged into master [1] but it certainly needs to be documented somewhere, thus passing this to Scott for further directions.

Scott, let me know if you need help documenting this feature. I can draft some text then you clean it.

[1] 884f74250d: Leonardo Sandoval: Wed Aug 9 09:24:16 2017 +0100: action: new bitbake-layer plugin to create a simple layer</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75923</commentid>
    <comment_count>10</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-08-16 19:57:54 +0000</bug_when>
    <thetext>Leonardo, 

Tell me the impact to the user.  Is the script named the same?  Does it just live somewhere else now?  If you can describe the feature from the point of view of the user that would be using it then I can work something up. 

Thanks, 
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76034</commentid>
    <comment_count>11</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2017-08-21 19:23:10 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; Leonardo, 
&gt; 
&gt; Tell me the impact to the user.  Is the script named the same?

yes. The script name is the same (bitbake-layers). I did not implement the script, just a plugin used by the script as I describe below.

&gt;  Does it just
&gt; live somewhere else now? 

The script lives in the bitbake repository but what I have proposed lives into openeembedded-core, the latter being a plugin used by the former to create a simple layer.

&gt; If you can describe the feature from the point of
&gt; view of the user that would be using it then I can work something up. 
&gt;

This is what the user will see when asking for help to the script

------
~/poky-testing/poky-yocto-layer/build&gt; bitbake-layers --help
NOTE: Starting bitbake server...
usage: bitbake-layers [-d] [-q] [-F] [--color COLOR] [-h] &lt;subcommand&gt; ...

BitBake layers utility

optional arguments:
  -d, --debug           Enable debug output
  -q, --quiet           Print only errors
  -F, --force           Force add without recipe parse verification
  --color COLOR         Colorize output (where COLOR is auto, always, never)
  -h, --help            show this help message and exit

subcommands:
  &lt;subcommand&gt;
    add-layer           Add a layer to bblayers.conf.
    remove-layer        Remove a layer from bblayers.conf.
    flatten             flatten layer configuration into a separate output
                        directory.
    layerindex-fetch    Fetches a layer from a layer index along with its
                        dependent layers, and adds them to conf/bblayers.conf.
    layerindex-show-depends
                        Find layer dependencies from layer index.
    show-layers         show current configured layers.
    show-overlayed      list overlayed recipes (where the same recipe exists
                        in another layer)
    show-recipes        list available recipes, showing the layer they are
                        provided by
    show-appends        list bbappend files and recipe files they apply to
    show-cross-depends  Show dependencies between recipes that cross layer
                        boundaries.
    create-layer        Create a basic layer

Use bitbake-layers &lt;subcommand&gt; --help to get help on a specific command
------

What&apos;s new is the &apos;create-layer&apos; plugin. Looking for help into the latter

------
~/poky-testing/poky-yocto-layer/build&gt; bitbake-layers create-layer --help
NOTE: Starting bitbake server...
usage: bitbake-layers create-layer [-h] [--priority PRIORITY]
                                   [--example-recipe-name EXAMPLERECIPE]
                                   layerdir

Create a basic layer

positional arguments:
  layerdir              Layer directory to create

optional arguments:
  -h, --help            show this help message and exit
  --priority PRIORITY, -p PRIORITY
                        Layer directory to create
  --example-recipe-name EXAMPLERECIPE, -e EXAMPLERECIPE
                        Filename of the example recipe
------


In resume, this plugin creates a simple layer, with a way to configure the layer&apos;s priority and the example recipe name.

 
&gt; Thanks, 
&gt; Scott

Scott, let me know if this is enough info, otherwise I can elaborate something better.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76038</commentid>
    <comment_count>12</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-08-21 21:31:55 +0000</bug_when>
    <thetext>Thanks... I can work with this for now.  

Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78082</commentid>
    <comment_count>13</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2017-11-08 22:28:21 +0000</bug_when>
    <thetext>Hi, 

See http://www.yoctoproject.org/docs/2.5/dev-manual/dev-manual.html#managing-layers and http://www.yoctoproject.org/docs/2.5/dev-manual/dev-manual.html#creating-a-general-layer-using-the-bitbake-layers-script for changes to the dev-manual regarding the bitbake-layers script and culling out of the yocto-layers script. 

Let me know of any changes.

Thanks,
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79209</commentid>
    <comment_count>14</comment_count>
    <who name="Kristi">kristi</who>
    <bug_when>2018-01-25 01:06:45 +0000</bug_when>
    <thetext>Taking ownership of this bug. This one has been in REVIEW status for over two months.  I am leaving it open, but could someone to look over the material? 

Thanks! 
Kristi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79931</commentid>
    <comment_count>15</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2018-03-22 09:32:52 +0000</bug_when>
    <thetext>Hi, 

Part of this bug is complete.  I have purged the following tools from the YP manual set:

 * yocto-bsp
 * yocto-kernel
 * yocto-layer

Following sections have had some rewrites:

 * https://www.yoctoproject.org/docs/2.5/dev-manual/dev-manual.html#managing-layers
 * https://www.yoctoproject.org/docs/2.5/dev-manual/dev-manual.html#creating-a-general-layer-using-the-bitbake-layers-script - Here, the topic of layer creation has been isolated.  It was previously combined with the &apos;bitbake-layers add-layer&apos; command, which was not really the best.  That topic is not in a new section noted in the next bullet.
 * https://www.yoctoproject.org/docs/2.5/dev-manual/dev-manual.html#adding-a-layer-using-the-bitbake-layers-script

Re-assigning to me. 

Note: Two of the three sections were completed for this bug and it was in review for over two months with no interest from anyone to verify.  I am going to leave this now in review for a reasonable time and if no activity results I will mark it RESOLVED.

Thanks,
Scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80001</commentid>
    <comment_count>16</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2018-03-27 15:15:18 +0000</bug_when>
    <thetext>Hi,

I completed a detailed section on creating a BSP layer in the BSP manual.  I used the BeagleBone hardware as an example to examine.  Please look this over and comment as needed.

https://www.yoctoproject.org/docs/2.5/bsp-guide/bsp-guide.html#creating-a-new-bsp-layer-using-the-bitbake-layers-script

Thanks,
scott</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80581</commentid>
    <comment_count>17</comment_count>
    <who name="Stephano Cetola">stephano</who>
    <bug_when>2018-05-15 09:58:59 +0000</bug_when>
    <thetext>This text looks good. No other changes needed:

https://www.yoctoproject.org/docs/2.5/bsp-guide/bsp-guide.html#creating-a-new-bsp-layer-using-the-bitbake-layers-script</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80586</commentid>
    <comment_count>18</comment_count>
    <who name="Scott Rifenbark">srifenbark</who>
    <bug_when>2018-05-15 10:36:08 +0000</bug_when>
    <thetext>Thanks Stephano, 

I set the doc flag to &quot;done&quot;.

Scott</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>