<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 27, 2017 at 4:51 AM, Razvan Heghedus <span dir="ltr">&lt;<a href="mailto:razvan.heghedus@ni.com" target="_blank">razvan.heghedus@ni.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><div><div class="h5">
    <p><br>
    </p>
    <br>
    <div class="m_-2468894063971137113moz-cite-prefix">On 06/26/2017 06:50 PM, Bruce Ashfield
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr"><br>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Wed, Jun 21, 2017 at 8:00 AM,
            Heghedus Razvan <span dir="ltr">&lt;<a href="mailto:razvan.heghedus@ni.com" target="_blank">razvan.heghedus@ni.com</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Make all dependencies
              from kernel family packages which depend<br>
              on another kernel related package to depend on the same
              version.<br>
              This creates a consistent state where kernel, kernel
              images and<br>
              kernel modules have the same version, making a kernel
              upgrade<br>
              leading to upgrades of the image and modules.<br>
              <br>
              The upgrade works only if the KERNEL_VERSION_PKG_NAME
              remains<br>
              the same for the newer versions.<br>
              <br>
              Signed-off-by: Heghedus Razvan &lt;<a href="mailto:razvan.heghedus@ni.com" target="_blank">razvan.heghedus@ni.com</a>&gt;<br>
              ---<br>
               meta/classes/kernel-module-sp<wbr>lit.bbclass  |  7
              ++++---<br>
               meta/classes/kernel.bbclass               | 15
              +++++++++------<br>
               meta/recipes-kernel/linux/lin<wbr>ux-yocto.inc |  4 ++++<br>
               3 files changed, 17 insertions(+), 9 deletions(-)<br>
              <br>
              diff --git a/meta/classes/kernel-module-s<wbr>plit.bbclass
              b/meta/classes/kernel-module-s<wbr>plit.bbclass<br>
              index 5e10dcf735..e247e66901 100644<br>
              --- a/meta/classes/kernel-module-s<wbr>plit.bbclass<br>
              +++ b/meta/classes/kernel-module-s<wbr>plit.bbclass<br>
              @@ -33,7 +33,7 @@ PACKAGESPLITFUNCS_prepend =
              &quot;split_kernel_module_packages &quot;<br>
               KERNEL_MODULES_META_PACKAGE ?= &quot;kernel-modules&quot;<br>
              <br>
               KERNEL_MODULE_PACKAGE_PREFIX ?= &quot;&quot;<br>
              -KERNEL_MODULE_PACKAGE_SUFFIX ?= &quot;-${KERNEL_VERSION}&quot;<br>
              +KERNEL_MODULE_PACKAGE_SUFFIX ?=
              &quot;-${KERNEL_VERSION_PKG_NAME}&quot;<br>
               KERNEL_MODULE_PROVIDE_VIRTUAL ?= &quot;1&quot;<br>
              <br>
               python split_kernel_module_packages () {<br>
              @@ -114,6 +114,7 @@ python split_kernel_module_packages ()
              {<br>
                           for dep in vals[&quot;depends&quot;].split(&quot;,&quot;):<br>
                               on = legitimize_package_name(dep)<br>
                               dependency_pkg = format % on<br>
              +                dependency_pkg += &#39;
              ${@get_full_package_version(d)<wbr>}&#39;<br>
                               modinfo_deps.append(dependenc<wbr>y_pkg)<br>
                       for dep in modinfo_deps:<br>
                           if not dep in rdepends:<br>
              @@ -138,10 +139,10 @@ python split_kernel_module_packages
              () {<br>
                   postinst = d.getVar(&#39;pkg_postinst_modules<wbr>&#39;)<br>
                   postrm = d.getVar(&#39;pkg_postrm_modules&#39;)<br>
              <br>
              -    modules = do_split_packages(d,
              root=&#39;${nonarch_base_libdir}/m<wbr>odules&#39;,
              file_regex=module_regex, output_pattern=module_pattern,
              description=&#39;%s kernel module&#39;, postinst=postinst,
              postrm=postrm, recursive=True, hook=frob_metadata,
              extra_depends=&#39;kernel-%s&#39; % (d.getVar(&quot;KERNEL_VERSION&quot;)))<br>
              +    modules = do_split_packages(d,
              root=&#39;${nonarch_base_libdir}/m<wbr>odules&#39;,
              file_regex=module_regex, output_pattern=module_pattern,
              description=&#39;%s kernel module&#39;, postinst=postinst,
              postrm=postrm, recursive=True, hook=frob_metadata,
              extra_depends=&#39;kernel-%s %s&#39; %
              (d.getVar(&quot;KERNEL_VERSION_PKG_<wbr>NAME&quot;),
              get_full_package_version(d)))<br>
                   if modules:<br>
                       metapkg = d.getVar(&#39;KERNEL_MODULES_META_<wbr>PACKAGE&#39;)<br>
              -        d.appendVar(&#39;RDEPENDS_&#39; + metapkg, &#39; &#39;+&#39;
              &#39;.join(modules))<br>
              +        d.appendVar(&#39;RDEPENDS_&#39; + metapkg, &#39; &#39;+&#39;
              &#39;.join([&#39;{0} {1}&#39;.format(module,
              get_full_package_version(d)) for module in modules]))<br>
              <br>
                   # If modules-load.d and modprobe.d are empty at this
              point, remove them to<br>
                   # avoid warnings. removedirs only raises an OSError
              if an empty<br>
              diff --git a/meta/classes/kernel.bbclass
              b/meta/classes/kernel.bbclass<br>
              index 7a134d5c29..605c101e62 100644<br>
              --- a/meta/classes/kernel.bbclass<br>
              +++ b/meta/classes/kernel.bbclass<br>
              @@ -55,7 +55,7 @@ python __anonymous () {<br>
              <br>
                       d.setVar(&#39;FILES_kernel-image-<wbr>&#39; + typelower, &#39;/&#39; +
              imagedest + &#39;/&#39; + type + &#39;-${KERNEL_VERSION_NAME}&#39;)<br>
              <br>
              -        d.appendVar(&#39;RDEPENDS_kernel-i<wbr>mage&#39;, &#39; &#39; +
              &#39;kernel-image-&#39; + typelower)<br>
              +        d.appendVar(&#39;RDEPENDS_kernel-i<wbr>mage&#39;, &#39; &#39; +
              &#39;kernel-image-&#39; + typelower + &#39;
              ${@get_full_package_version(d)<wbr>}&#39;)<br>
              <br>
                       d.setVar(&#39;PKG_kernel-image-&#39; + typelower,
              &#39;kernel-image-&#39; + typelower +
              &#39;-${KERNEL_VERSION_PKG_NAME}&#39;)<br>
              <br>
              @@ -493,14 +493,17 @@ FILES_kernel-image = &quot;&quot;<br>
               FILES_kernel-dev = &quot;/boot/System.map*
              /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}
              ${nonarch_base_libdir}/modules<wbr>/${KERNEL_VERSION}/build&quot;<br>
               FILES_kernel-vmlinux = &quot;/boot/vmlinux-${KERNEL_VERSIO<wbr>N_NAME}&quot;<br>
               FILES_kernel-modules = &quot;&quot;<br>
              -RDEPENDS_kernel = &quot;kernel-base&quot;<br>
              +RDEPENDS_kernel = &quot;kernel-base
              ${@get_full_package_version(d)<wbr>}&quot;<br>
            </blockquote>
            <div><br>
            </div>
            <div>Is that really supposed to be a space, between
              kernel-base and the package version<br>
            </div>
            <div>call ? I guess so, since I see the same thing below in
              the RDEPENDS_kernel-base</div>
            <div>line below .. but it just reads strange to me.  i.e. if
              that&#39;s a RDEPENDS, where is the</div>
            <div>package get_full_package_version(d) created ?</div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
    </blockquote></div></div>
    Yes, the space is supposed to be there. If it&#39;s inconvenient here,
    it can be moved in the string returned by get_full_package_version()<span class=""><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>Are you trying to set a generic versionless RDEPENDS
              and a versioned one that doesn&#39;t</div>
            <div>contain &#39;kernel-&#39; in the name ?</div>
            <div> </div>
          </div>
        </div>
      </div>
    </blockquote></span>
    This will create a versioned RDEPENDS. The syntax for a versioned
    package is: &quot;package_name (= package_version)&quot;. This only append the
    version to the current value.</div></blockquote><div><br></div><div>right. I was thinking of package rdepends, but not from the point of view of a</div><div>package manager.</div><div><br></div><div>I think it would be better to get it all from the utility function, since that makes it</div><div>clear that it is a constructed value of the form you mentioned.</div><div><br></div><div>Also, what if someone doesn&#39;t want the versioned depends ? If everything is in a</div><div>routine, they could override to get the behaviour they want.</div><div><br></div><div>Out of curiosity .. have you tested this with both rpm and ipk ? I&#39;ve run into problems</div><div>with versioned depends and ipk in the past, so it would be good to confirm that this</div><div>works consistently.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><div><div class="h5"><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
               # Allow machines to override this dependency if kernel
              image files are<br>
               # not wanted in images as standard<br>
              -RDEPENDS_kernel-base ?= &quot;kernel-image&quot;<br>
              -PKG_kernel-image = &quot;kernel-image-${@legitimize_pa<wbr>ckage_name(&#39;${KERNEL_VERSION}&#39;<wbr>)}&quot;<br>
              +RDEPENDS_kernel-base ?= &quot;kernel-image
              ${@get_full_package_version(d)<wbr>}&quot;<br>
              +PKG_kernel-image = &quot;kernel-image-${KERNEL_VERSION<wbr>_PKG_NAME}&quot;<br>
               RDEPENDS_kernel-image += &quot;${@base_conditional(&#39;KERNEL_I<wbr>MAGETYPE&#39;,
              &#39;vmlinux&#39;, &#39;kernel-vmlinux&#39;, &#39;&#39;, d)}&quot;<br>
              -PKG_kernel-base = &quot;kernel-${@legitimize_package_<wbr>name(&#39;${KERNEL_VERSION}&#39;)}&quot;<br>
              -RPROVIDES_kernel-base += &quot;kernel-${KERNEL_VERSION}&quot;<br>
              +PKG_kernel-base = &quot;kernel-${KERNEL_VERSION_PKG_N<wbr>AME}&quot;<br>
              +RPROVIDES_kernel-base += &quot;kernel-${KERNEL_VERSION_PKG_N<wbr>AME}&quot;<br>
              +PKG_kernel-vmlinux = &quot;kernel-vmlinux-${KERNEL_VERSI<wbr>ON_PKG_NAME}&quot;<br>
            </blockquote>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">+PKG_kernel-modules =
              &quot;kernel-modules-${KERNEL_VERSI<wbr>ON_PKG_NAME}&quot;<br>
              +PKG_kernel-dev = &quot;kernel-dev-${KERNEL_VERSION_P<wbr>KG_NAME}&quot;<br>
               ALLOW_EMPTY_kernel = &quot;1&quot;<br>
               ALLOW_EMPTY_kernel-base = &quot;1&quot;<br>
               ALLOW_EMPTY_kernel-image = &quot;1&quot;<br>
              diff --git a/meta/recipes-kernel/linux/li<wbr>nux-yocto.inc
              b/meta/recipes-kernel/linux/li<wbr>nux-yocto.inc<br>
              index 637506a2a8..c3d1284ad2 100644<br>
              --- a/meta/recipes-kernel/linux/li<wbr>nux-yocto.inc<br>
              +++ b/meta/recipes-kernel/linux/li<wbr>nux-yocto.inc<br>
              @@ -67,3 +67,7 @@ do_install_append(){<br>
               addtask kernel_version_sanity_check after
              do_kernel_metadata do_kernel_checkout before do_compile<br>
               addtask validate_branches before do_patch after
              do_kernel_checkout<br>
               addtask kernel_configcheck after do_configure before
              do_compile<br>
              +<br>
              +def get_full_package_version(d):<br>
              +    return &quot;(= &quot; + d.getVar(&quot;PKGV&quot;) + &quot;-&quot; +
              d.getVar(&quot;PKGR&quot;) + &quot;)&quot;<br>
            </blockquote>
            <div><br>
            </div>
            <div>This doesn&#39;t belong in linux-yocto.inc, since it is
              called in kernel.bbclass. It needs to be in the base</div>
            <div>class and have a namespace that indicates it is
              specific to the kernel.</div>
            <div><br>
            </div>
          </div>
        </div>
      </div>
    </blockquote></div></div>
    Yeah, you&#39;re right, this shouldn&#39;t be in linux-yocto.inc. I will
    move it to the base class, but I need some info about namespace
    thing, because I don&#39;t recall reading about it in documentations.</div></blockquote><div><br></div><div>Nothing fancy here, more convention than something technical. If this is only working for</div><div>the kernel, it should be def kernel_get_full_package_version() so the context is clear and</div><div>if another class/package add something similar, we won&#39;t collide.</div><div><br></div><div>Bruce</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><span class=""><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <div>Bruce</div>
            <div> </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              +<br>
              <span class="m_-2468894063971137113gmail-HOEnZb"><font color="#888888">--<br>
                  2.13.1<br>
                  <br>
                  --<br>
                  ______________________________<wbr>_________________<br>
                  Openembedded-core mailing list<br>
                  <a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openem<wbr>bedded.org</a><br>
                  <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br>
                </font></span></blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div class="m_-2468894063971137113gmail_signature">&quot;Thou shalt not follow the NULL
            pointer, for chaos and madness await thee at its end&quot;</div>
        </div>
      </div>
    </blockquote>
    <br>
    </span><span class="HOEnZb"><font color="#888888"><pre class="m_-2468894063971137113moz-signature" cols="72">-- 

Razvan
</pre>
  </font></span></div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">&quot;Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end&quot;</div>
</div></div>