Bug 5749 - bitbake is unable to parse MACHINE_EXTRA_RRECOMMENDS variable
Summary: bitbake is unable to parse MACHINE_EXTRA_RRECOMMENDS variable
Status: RESOLVED WORKSFORME
Alias: None
Product: Kernel
Classification: Yocto Project Subprojects
Component: linux-yocto (show other bugs)
Version: unspecified
Hardware: x86 arm
: Medium normal
Target Milestone: 1.8
Assignee: shammi
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-01-22 07:10 UTC by shammi
Modified: 2015-04-09 15:29 UTC (History)
8 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shammi 2014-01-22 07:10:19 UTC
bitbake is unable to parse MACHINE_EXTRA_RRECOMMENDS variable from machine file.
i am trying to insert out of tree kernel module but bitbake is unable to add
MACHINE_EXTRA_RRECOMMENDS +="kernel-module-mcc".
Comment 1 Darren Hart 2014-01-23 15:45:42 UTC
shammi, can you provide some context? A few lines from the file defining this and the exact error reported? This sort of error is frequently a usage error.
Comment 2 Darren Hart 2014-01-23 15:46:06 UTC
.
Comment 3 shammi 2014-01-24 03:17:57 UTC
 I am using MACHINE_EXTRA_RRECOMMENDS +=""kernel-module-mcc" where mcc is my external module.after that i am doing core-image-base.but bitbake is unbale to add this to  my image .When i am manually putting "mcc" module inside 
packagegroup-base.bb bitbake is building my module.

same case with core-image-minimal here i am using MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS +="mcc" but bitbake is unable to build my module.
when i am manually coping this inside packagegroup-core-boot.bb bitbake is building this.
I am using DPKG package manager.
Comment 4 Darren Hart 2014-01-29 18:23:15 UTC
Is that exactly what you are using?

MACHINE_EXTRA_RRECOMMENDS +=""kernel-module-mcc"

If so, the initial "" would indeed cause a parse error.
Comment 5 shammi 2014-01-30 02:47:34 UTC
sorry i am using MACHINE_EXTRA_RRECOMMENDS +="kernel-module-mcc" by mistake i typed that.bitbake is unable to parse this.if i am filling the varibale manually
inside packagegroup bitbake is parsing and building the module.
Comment 6 Darren Hart 2014-02-19 16:40:00 UTC
We'll need more context to help out here. The exact error, the complete recipe, etc.
Comment 7 shammi 2014-02-20 02:43:47 UTC
I am not getting any error. thing is that when i am writing MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS +="mcc" in machine file and building
core-image-minimal .module should be compiled and should appear in /lib/modules.
but bitbake is not parsing this varibale.
But when manually i am filing this variable inside packagegroup-core-boot.bb.
bitbake is compling it and coying it to /lib/modules.

Why its happening Acc to your manual it should work.
Comment 8 Richard Purdie 2014-04-14 12:17:08 UTC
I suspect the problem here is you both need to trigger the external kernel module to build and include it in the image. What is the name of your external module .bb file?

Does something like:

MACHINE_EXTRA_RRECOMMENDS +="mcc kernel-module-mcc" 

work?

The reason I ask is that "kernel-module-*" is provided by the standard kernel and you somehow need to trigger the build of the external module. If its been built and its included in RRECOMMENDS, it will go into the image. If the recipe was called mcc_xxx.bb, the mcc in the above should help ensure it gets built.
Comment 9 shammi 2014-04-16 04:45:52 UTC
I tried everything but my module is not getting build.please give some solution about this.
 in your manual nothing mentioned about trigerring the module.my module is external module.
Comment 10 shammi 2014-05-13 03:12:11 UTC
My module is not getting build. As someone told in previous reply that "Need to trigger the external kernel module to build and include it in the image".

         Can you tell me how to trigger the external kernel module.

My module is external not related to kernel.I am working on freescale vybrid.
having two cores cortex a5+corttex m4. My module is for cortex m4 "mcc".
Comment 11 Darren Hart 2014-05-23 03:51:15 UTC
Shammi, Richard suggested you try adding both "mcc" and "kernel-module-mcc". Did you try that? The kernel-module- is a special prefix - it's possible the documentation is missing something about the naming convention.

If you are concerned about it not getting parsed, you can always verify what bitbake is seeing with the -e argument. For example:

$ bitbake core-image-minimal -e | grep MACHINE_EXTRA_RRECOMMENDS=

You can try RDEPENDS instead of RRECOMMENDS to trigger a failure if it can't meet the requirements.

Try looking in the build output to see if the module is being built, but not installed. build/tmp/deploy/<packageformat>/<machine>/kernel-module-*

We haven't seen your mcc recipe, so it's very possible something is wrong there as well.

When you provide comments here, it is very important that you provide as much information about your environment as possible. We have been probing, but you continue to provide very minimal bits of information. We don't know anything about your configuration and environment other than what you tell us.
Comment 12 shammi 2014-05-23 03:57:35 UTC
I have tried everything what you  are telling.Even module is not getting being downloaded.
Comment 13 Darren Hart 2014-05-23 04:53:06 UTC
I'm trying to reproduce using hello-mod from meta-skeleton. I might be seeing similar issues. I'll report back after the builds complete and I can confirm the results.
Comment 14 Darren Hart 2014-05-23 17:50:00 UTC
hello-mod in meta-skeleton is the default example to validate this mechanism. To use it, add meta-skeleton to your BBLAYERS.

That can be build manually by building "hello-mod". To include the module package in an image, you use "kernel-module-hello". As Richard suggested earlier, adding "kernel-module-hello" along to one of the MACHINE_* variables doesn't work, if you add it as an RRECOMMENDS, the build will complete, if you add it to an image-relevant RDEPENDS, the build will fail on a missing dependency. This is due to hello-mod not PROVIDING kernel-module-hello (I'm guessing there). That seems like something we should fix, because we don't expect users to have to use "hello-mod kernel-module-hello" to get it to build. I suspect this was overlooked in the documentation as most use cases involve adding a module that was built by the provider for virtual/kernel which is always built (it doesn't need to be explicitly added).

Please verify that you can build with hello-mod by adding:

MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "hello-mod kernel-module-hello"


Finally, pay close attention to the difference between MACHINE_ESSENTIAL_EXTRA* and MACHINE_EXTRA*. ESSENTIAL is applied to core-image-minimal, EXTRA is not. See the reference manual for a detailed treatment of these variables. Then, consider RRECOMMENDS and RDEPENDS. The former means include the package if you have it (you didn't have it since you didn't build it), but don't complain if you don't (because it might be built into the kernel and we don't want to break in that case). The latter means this package must be installed, or it is a hard failure.

So with that context, I suggest using MACHINE_ESSENTIAL_EXTRA_RDEPENDS for now as it will throw meaningful errors to help us resolve the issue. Set it to include the name of the recipe itself (mcc I think you said) and the name of the package that recipe generates (probably kernel-module-mcc). If you aren't sure, build it manually and look for the package it creates in deploy/<packagetype>/<machine>/*mcc*. Then set the variable:

MACHINE_ESSENTIAL_EXTRA_RDEPENDS+="mcc kernel-module-mcc"

Verify it is correct with:

bitbake <target> -e | grep MACHINE_ESSENTIAL_EXTRA_RDEPENDS=
(please send us the output)

Then, clean mcc and rebuild:
bitbake -c cleansstate mcc
bitbake <target>

And let us know what you find.
Comment 15 Darren Hart 2014-05-29 00:11:00 UTC
shammi, does comment 14 address the issue for you?
Comment 16 Paul Eggleton 2014-05-29 15:28:39 UTC
I might have missed something, but it seems like the problem might be that kernel itself has PACKAGES_DYNAMIC that satisfies kernel-module-.*; thus as far as BitBake is concerned, kernel-module-mcc might be being provided by the kernel rather than the external module recipe. If that's what's happening I'm not entirely sure where the problem needs to be solved, but it might explain what's going on.
Comment 17 Stephen K Jolley 2014-06-18 17:36:36 UTC
Assigned to the person who we are requesting INFO from per RP.
Comment 18 Paul Eggleton 2014-07-17 15:25:41 UTC
So it does seem like the situation I've described above could happen; should we change how our external kernel module support works or how it is documented so that this is no longer an issue? Darren could you please investigate and comment?
Comment 19 Darren Hart 2014-11-14 18:43:51 UTC
Shammi, does Comment 14 address your concern?

Moving to 1.8 for final follow-up by me of Paul's comments.
Comment 20 Jessica 2015-02-09 23:25:05 UTC
Hi Brendan

I'm re-assign this bug to you to follow up...

Thanks,
Jessica
Comment 21 Jessica 2015-02-09 23:26:27 UTC
Hi Shammi,

Any more info that you can provide us?

Thanks,
Jessica
Comment 22 Paul Eggleton 2015-04-09 15:29:40 UTC
This bug has remained open in NEEDINFO state with no response for quite some time so I am marking it as resolved. At minimum I do think there is an underlying documentation issue to be solved though, so I have entered bug 7591 to cover that.