<?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>5090</bug_id>
          
          <creation_ts>2013-08-30 15:27:00 +0000</creation_ts>
          <short_desc>KMETA mis-used for both directories and branches</short_desc>
          <delta_ts>2014-10-14 07:49:30 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Kernel</product>
          <component>kernel-configuration</component>
          <version>1.5</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></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.7 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Peter A. Bigot">pab</reporter>
          <assigned_to name="Bruce Ashfield">bruce.ashfield</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>dvhart</cc>
    
    <cc>sgw</cc>
    
    <cc>sjolley.yp.pm</cc>
    
    <cc>yp.kernel.watcher</cc>
    
    <cc>yp.watcher</cc>
          
          <qa_contact name="Lucian Musat">georgex.l.musat</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>36101</commentid>
    <comment_count>0</comment_count>
    <who name="Peter A. Bigot">pab</who>
    <bug_when>2013-08-30 15:27:00 +0000</bug_when>
    <thetext>I&apos;m starting with the current poky linux-yocto_3.10.bb recipe and attempting to add support for a new machine.  I want to use standard features, but also need ones specific to the machine architecture.  Per [1] I started trying to do this with recipe-space features, but this isn&apos;t going to fly: the list of features belongs in the scc file, and having to put them in KERNEL_FEATURES in the recipe instead is a maintenance headache.

So instead I created branches in a local Linux kernel repository.  I named the meta branch yocto-3.10/meta-gumstix instead of meta because I use this repository for other versions of Linux as well, am using yocto-3.10/meta as the local branch that tracks meta from the Yocto yocto-3.10 upstream repository, and want to distinguish it from a version that adds gumstix metadata.  (If that all makes sense.)  I then use:

    KMETA_overo = &quot;yocto-3.10/gumstix-meta&quot;

in my bbappend, and provide a SRC_URI that fetches from my local repository.

This breaks horribly, because the kgit scripts use KMETA for both the branch name and the name of the root directory within that branch.  This is most obvious in kgit-checkpoint which ends with:

    mv $checkpoint_branch .$checkpoint_branch

when creating the hidden .meta directory, and in kgit-meta which whines:

    meta_dir_name=$KMETA
    # intervening attempts to find $meta_dir_name in file system
    echo &quot;ERROR cannot locate &apos;$meta_dir_name&apos; directory&quot;

I&apos;ve given up and named the branch &quot;meta&quot; so the scripts behave and I can get on with my work, but I think the proper solution is to stop using KMETA and other machinations to identify a directory name, and instead require that metadata be in a constantly named source root directory &quot;meta&quot; (in branch ${KMETA}) or &quot;.meta&quot; (in branch ${KBRANCH} when ${KMETA} is empty).

[1] http://article.gmane.org/gmane.comp.handhelds.openembedded.core/41298/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36102</commentid>
    <comment_count>1</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2013-08-30 16:00:59 +0000</bug_when>
    <thetext>The actual problem is a lack of documentation around changing the meta
branch, it was supposed to be done in 1.4, but I don&apos;t recall it making the release
and post 3.10 kernel introduction, updated docs are pending since the workflow
changed around in tree meta data.

It has surprised several people, and surprises .. are not good. Docs will help, but
also making things a bit smarter will help more.

We can&apos;t fix the directory name, since there are users and use cases that actually
do need several meta data branches and hence, non conflicting directories.

In the distant past, special tags, hints or commits were all tried in the tree to indicate
the directory / branch combinations, and they all failed as &quot;too clunky&quot; or &quot;not obvious&quot;.

The current approach is a compromise between usability and flexibility.

That being said, I have the M5 milestone to see about making things a bit smarter
using your use case as an example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36104</commentid>
    <comment_count>2</comment_count>
    <who name="Peter A. Bigot">pab</who>
    <bug_when>2013-08-30 16:27:20 +0000</bug_when>
    <thetext>Thanks.

This is just the workaround.  My use case is better served by the ability to support a PATH concept for locating features regardless of whether they come from a kernel source (KBRANCH) directory, an in-repository (KMETA) branch patching a directory into the kernel sources, or files provided in SRC_URI from recipe-space.  Ideally all three should be permitted, with increasing priority.

What I really want is a BSP scc that can live in recipe space and re-use the fragments from the meta branch through include directives rather than KERNEL_FEATURES.  This got messy because I apparently couldn&apos;t have a bsp file recipe space that could locate metadata from the standard hierarchy: it seems that anything read from recipe space can&apos;t see the features that are elsewhere.

For example, one thing I need to handle is that features/media/media-camera.cfg specifies CONFIG_MEDIA_SUBDRV_AUTOSELECT=y which disables visibility of the I2C camera I need to support.  To work around this I need to replicate features/media/media-camera.scc and everything it recursively includes, instead of just overriding the one file that&apos;s wrong.

Perhaps that should be a different bug/enhancement request.

I&apos;m also finding &quot;in-tree&quot; to be incomplete: it seems to cover both the presence of a kernel tree metadata directory in KBRANCH as well as a distinct KMETA branch which gets copied into the kernel tree during the patch process, which I think are conceptually different approaches.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36109</commentid>
    <comment_count>3</comment_count>
    <who name="Peter A. Bigot">pab</who>
    <bug_when>2013-08-30 17:04:12 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; This is just the workaround.  My use case is better served by the ability to
&gt; support a PATH concept for locating features regardless of whether they come
&gt; from a kernel source (KBRANCH) directory, an in-repository (KMETA) branch
&gt; patching a directory into the kernel sources, or files provided in SRC_URI
&gt; from recipe-space.  Ideally all three should be permitted, with increasing
&gt; priority.

It would also be good, if backwards incompatible, to eliminate any automatic recursive searching for metadata files.  It&apos;s confusing to have my bsp scc do:

  include features/media/v4l2.scc

which in turn does:

  kconf v4l2.cfg

which manages to find features/media/v4l2.cfg when there could be any number of specialized v4l2.cfg files that would be more appropriate.

I think putting everything in recipe space is going to turn out to be easier until all this gets a little more orthogonal.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36110</commentid>
    <comment_count>4</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2013-08-30 17:09:43 +0000</bug_when>
    <thetext>Peter, lots of good ideas here. We really appreciate the feedback. I think I see at least 3 bugs here. The original, the recipe-space-descriptions-can&apos;t-see-kernel-space-meta-data, and the one in comment 3 about include/kconf paths. Some of this is likely just a doc fix to the kernel-dev manual. Others could likely be improved in the tooling.

Would you please open a bug for each specific issue?

Also, as a matter of process, it would have probably been best to have this discussion on the linux-yocto mailing list first, and then opened the bugs as they became well defined. Again, thank you for taking the time to report the issues.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36111</commentid>
    <comment_count>5</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2013-08-30 17:11:05 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; This is just the workaround.  My use case is better served by the ability to
&gt; &gt; support a PATH concept for locating features regardless of whether they come
&gt; &gt; from a kernel source (KBRANCH) directory, an in-repository (KMETA) branch
&gt; &gt; patching a directory into the kernel sources, or files provided in SRC_URI
&gt; &gt; from recipe-space.  Ideally all three should be permitted, with increasing
&gt; &gt; priority.
&gt; 
&gt; It would also be good, if backwards incompatible, to eliminate any automatic
&gt; recursive searching for metadata files.  It&apos;s confusing to have my bsp scc
&gt; do:
&gt; 
&gt;   include features/media/v4l2.scc
&gt; 
&gt; which in turn does:
&gt; 
&gt;   kconf v4l2.cfg
&gt; 
&gt; which manages to find features/media/v4l2.cfg when there could be any number
&gt; of specialized v4l2.cfg files that would be more appropriate.

The searching is required for backwards compatibility, but non-relative path based
configs and patches have been discouraged for some time .. some do slip in, but
in general things are better.

Note that &quot;kconf v4l2.cfg&quot;, really isn&apos;t searching. The search path is the current
directory and then the known kernel-cache directories. So in this case, it simply
looks in the current dir, matches and will go no further.

&gt; 
&gt; I think putting everything in recipe space is going to turn out to be easier
&gt; until all this gets a little more orthogonal.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36112</commentid>
    <comment_count>6</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2013-08-30 17:12:12 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Peter, lots of good ideas here. We really appreciate the feedback. I think I
&gt; see at least 3 bugs here. The original, the
&gt; recipe-space-descriptions-can&apos;t-see-kernel-space-meta-data, and the one in

recipe space features are already tracked, and should work, I just haven&apos;t gotten
to replying to it yet :)

&gt; comment 3 about include/kconf paths. Some of this is likely just a doc fix
&gt; to the kernel-dev manual. Others could likely be improved in the tooling.
&gt; 
&gt; Would you please open a bug for each specific issue?
&gt; 
&gt; Also, as a matter of process, it would have probably been best to have this
&gt; discussion on the linux-yocto mailing list first, and then opened the bugs
&gt; as they became well defined. Again, thank you for taking the time to report
&gt; the issues.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36113</commentid>
    <comment_count>7</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2013-08-30 17:19:39 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Thanks.
&gt; 
&gt; This is just the workaround.  My use case is better served by the ability to
&gt; support a PATH concept for locating features regardless of whether they come
&gt; from a kernel source (KBRANCH) directory, an in-repository (KMETA) branch
&gt; patching a directory into the kernel sources, or files provided in SRC_URI
&gt; from recipe-space.  Ideally all three should be permitted, with increasing
&gt; priority.

Most of this is already in place, since the yocto 1.4 release.  Out of tree KERNEL_FEATURES
are possible, and out of tree .scc files can use in tree features. You can even specify
entire kernel-cache repositories on the SRC_URI and use them as KERNEL_FEATURES.

There&apos;s a bitbake issue that needs to be resolved around directory handling to allow entire
directories to be specified in userspace as feature dirs, but that&apos;s a minor issue at the
moment, so it&apos;s on the back burner.

&gt; 
&gt; What I really want is a BSP scc that can live in recipe space and re-use the
&gt; fragments from the meta branch through include directives rather than
&gt; KERNEL_FEATURES.  This got messy because I apparently couldn&apos;t have a bsp
&gt; file recipe space that could locate metadata from the standard hierarchy: it
&gt; seems that anything read from recipe space can&apos;t see the features that are
&gt; elsewhere.

This should work, the revs of the tools may have introduced a regression. Each
kernel-cache, and recipe space feature is included on a search path. You can
specify a .scc file relative to the root of any search dir and it should be found.  Just
like gcc or cpp do.

If you have an example of a broken out of tree .scc file, attach it and I&apos;ll fix the issue.

&gt; 
&gt; For example, one thing I need to handle is that
&gt; features/media/media-camera.cfg specifies CONFIG_MEDIA_SUBDRV_AUTOSELECT=y
&gt; which disables visibility of the I2C camera I need to support.  To work
&gt; around this I need to replicate features/media/media-camera.scc and
&gt; everything it recursively includes, instead of just overriding the one file
&gt; that&apos;s wrong.

Again, this should be working. You should be able to include the feature
and override what you need. In 1.6, there will be some other options to include
and override automatically, but I won&apos;t get into that now.

&gt; 
&gt; Perhaps that should be a different bug/enhancement request.
&gt; 
&gt; I&apos;m also finding &quot;in-tree&quot; to be incomplete: it seems to cover both the
&gt; presence of a kernel tree metadata directory in KBRANCH as well as a
&gt; distinct KMETA branch which gets copied into the kernel tree during the
&gt; patch process, which I think are conceptually different approaches.

I&apos;m not following this. The meta branch is a convenience container for kernel
meta data. Since it follows the kernel, you can do standalone builds without a
build system and there is no branching/revision management issues. 

The contents of the meta branch are simply untracked in the BSP branches so 
they&apos;ll be globally visible to the tools, regardless of what branch they are on.

So yes, a build is a combination of a board branch KBRANCH, and a meta data
branch KMETA.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36114</commentid>
    <comment_count>8</comment_count>
    <who name="Peter A. Bigot">pab</who>
    <bug_when>2013-08-30 17:23:23 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Also, as a matter of process, it would have probably been best to have this
&gt; discussion on the linux-yocto mailing list first, and then opened the bugs
&gt; as they became well defined. Again, thank you for taking the time to report
&gt; the issues.

Originally this was just a bug that KMETA was being mis-used.  It&apos;s blown up beyond that, and I agree the whole thing should be aired in linux-yocto.  I&apos;m writing up an intro mail and will move discussion there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36115</commentid>
    <comment_count>9</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2013-08-30 17:28:51 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #4)
&gt; &gt; Also, as a matter of process, it would have probably been best to have this
&gt; &gt; discussion on the linux-yocto mailing list first, and then opened the bugs
&gt; &gt; as they became well defined. Again, thank you for taking the time to report
&gt; &gt; the issues.
&gt; 
&gt; Originally this was just a bug that KMETA was being mis-used.  It&apos;s blown up
&gt; beyond that, and I agree the whole thing should be aired in linux-yocto. 
&gt; I&apos;m writing up an intro mail and will move discussion there.

Take into account my recent updates please .. otherwise, I&apos;ll be forced to spend
time writing up the same answers .. instead of working on the code :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36116</commentid>
    <comment_count>10</comment_count>
    <who name="Peter A. Bigot">pab</who>
    <bug_when>2013-08-30 19:34:03 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Peter, lots of good ideas here. We really appreciate the feedback. I think I
&gt; see at least 3 bugs here. The original,

Yes: exactly how KMETA defines the directory name that&apos;s created in the kernel source tree should be documented.

&gt; the
&gt; recipe-space-descriptions-can&apos;t-see-kernel-space-meta-data,

I&apos;ve confirmed this seems fixed in master; I&apos;d encountered it in dylan originally.

&gt; and the one in comment 3 about include/kconf paths.

I&apos;m not sure yet whether this is a bug; it&apos;s the focus of the linux-yocto email I&apos;ve just sent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37756</commentid>
    <comment_count>11</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2013-10-09 00:21:22 +0000</bug_when>
    <thetext>Moving this to 1.6, where I can address the flexibility and do documentation updates at the same time.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44661</commentid>
    <comment_count>12</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2014-07-24 14:56:10 +0000</bug_when>
    <thetext>Bruce, can you update this this, or close if the changes are in</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44728</commentid>
    <comment_count>13</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2014-07-25 19:00:13 +0000</bug_when>
    <thetext>Still pending. I updated the release milestone.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45847</commentid>
    <comment_count>14</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2014-09-25 15:11:53 +0000</bug_when>
    <thetext>This has been fixed the the tree. meta branches and the containing directories
can now be different.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>