Skip to contentSkip to conversation

conditional kernel configuration

DISCUSSION Mike Turquette 2 participants 3 messages Dec 1, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

I was recently looking into configuring the kernel dynamically based on IMAGE_FEATURES. Here is a snippet from my kernel recipe:

OVERRIDE_WLAN = "${@base_contains("IMAGE_FEATURES", "my-conn", ":mywlan", "",d)}"
OVERRIDES .= "${OVERRIDE_WLAN}"

SRC_URI = "git://some_tree" SRC_URI_prepend_mywlan = "git://some_other_tree_with_wlan"

This is a simplified example of what my recipe does (in fact I don't fetch from git in this recipe at all). But the point is clear:
looking for my-conn in IMAGE_FEATURES (which is set or not set in my-cool-image.bb) should determine whether SRC_URI has one tree or both trees in it.

The problem is that IMAGE_FEATURES only has the stuff specified in local.conf when the kernel recipe gets selected (this obviously happens when I bitbake mykernel, but also when I bitbake my-cool-image). All of the features specified in my-cool-image.bb are not in it (yet).

Am I going about this the wrong way? I would really like to conditionally set which code to build in my kernel recipe based on whether or not the my-conn task is included in IMAGE_FEATURES.

Any other solutions that depart from my IMAGE_FEATURES scrape method are very welcome too!

Thanks,
Mike

#1 lore raw
Quoted 4 lines · Mike Turquette

Hi,

I was recently looking into configuring the kernel dynamically based on IMAGE_FEATURES.

First: there's no such thing as IMAGE_FEATURES in OE:

koen@dominion:/OE/org.openembedded.dev$ grep IMAGE_FEATURES . -rn
koen@dominion:/OE/org.openembedded.dev$

Secondly: This looks a lot like USE flags, which we decided not to use in OE since it's impossible to do deterministic builds with them and at run-time there are a QA nightmare.

To illustrate the second point:

a) clean tmp/
b) unset 'my-conn', build image
c) set 'my-conn', build image

You now have an image in deploy where 'my-conn' is present, but the kernel is lacking WLAN support since it didn't get rebuilt after b).

I suspect what you need is a switch whether to include wlan *modules* into the image or not.

regards,

Koen

Quoted 30 lines

Here is a snippet from my kernel recipe:

OVERRIDE_WLAN = "${@base_contains("IMAGE_FEATURES", "my-conn", ":mywlan", "",d)}"
OVERRIDES .= "${OVERRIDE_WLAN}"

SRC_URI = "git://some_tree" SRC_URI_prepend_mywlan = "git://some_other_tree_with_wlan"

This is a simplified example of what my recipe does (in fact I don't fetch from git in this recipe at all). But the point is clear:
looking for my-conn in IMAGE_FEATURES (which is set or not set in my-cool-image.bb) should determine whether SRC_URI has one tree or both trees in it.

The problem is that IMAGE_FEATURES only has the stuff specified in local.conf when the kernel recipe gets selected (this obviously happens when I bitbake mykernel, but also when I bitbake my-cool-image). All of the features specified in my-cool-image.bb are not in it (yet).

Am I going about this the wrong way? I would really like to conditionally set which code to build in my kernel recipe based on whether or not the my-conn task is included in IMAGE_FEATURES.

Any other solutions that depart from my IMAGE_FEATURES scrape method are very welcome too!

Thanks,
Mike

#2 lore raw
Quoted 8 lines · Koen Kooi
Quoted 5 lines · Mike Turquette

Hi,

I was recently looking into configuring the kernel dynamically based on IMAGE_FEATURES.

First: there's no such thing as IMAGE_FEATURES in OE:

You've found me out! I'm based off of Poky and assumed this was a similar to OE.

Quoted 6 lines
koen@dominion:/OE/org.openembedded.dev$ grep IMAGE_FEATURES . -rn
koen@dominion:/OE/org.openembedded.dev$

Secondly: This looks a lot like USE flags, which we decided not to use in OE since it's impossible to do deterministic builds with them and at run-time there are a QA nightmare.

Yes, it is similar to USE flags to a degree.

Quoted 8 lines

To illustrate the second point:

a) clean tmp/
b) unset 'my-conn', build image
c) set 'my-conn', build image

You now have an image in deploy where 'my-conn' is present, but the kernel is lacking WLAN support since it didn't get rebuilt after b).

Right. I understood this problem going into it, but it seemed an acceptable issue given that state of the code I'm wrestling with.

Quoted 2 lines

I suspect what you need is a switch whether to include wlan *modules* into the image or not.

This is by and large be the best solution. However I'm given very little flexibility with the code I'm being handed at work so I'll keep searching until the code gets cleaned up.

Thanks,
Mike

Quoted 44 lines

regards,

Koen

Quoted 25 lines

Here is a snippet from my kernel recipe:

OVERRIDE_WLAN = "${@base_contains("IMAGE_FEATURES", "my-conn", ":mywlan", "",d)}"
OVERRIDES .= "${OVERRIDE_WLAN}"

SRC_URI = "git://some_tree" SRC_URI_prepend_mywlan = "git://some_other_tree_with_wlan"

This is a simplified example of what my recipe does (in fact I don't fetch from git in this recipe at all). But the point is clear:
looking for my-conn in IMAGE_FEATURES (which is set or not set in my-cool-image.bb) should determine whether SRC_URI has one tree or both trees in it.

The problem is that IMAGE_FEATURES only has the stuff specified in local.conf when the kernel recipe gets selected (this obviously happens when I bitbake mykernel, but also when I bitbake my-cool-image). All of the features specified in my-cool-image.bb are not in it (yet).

Am I going about this the wrong way? I would really like to conditionally set which code to build in my kernel recipe based on whether or not the my-conn task is included in IMAGE_FEATURES.

Quoted 5 lines

Any other solutions that depart from my IMAGE_FEATURES scrape method are very welcome too!

Thanks,
Mike

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel