Discussion:
Best way to remove DISTRO_FEATURES?
Neuer User
2014-05-14 13:04:34 UTC
Permalink
Hi

I have a small custom image based on the core-image-minimal.

Due to some DISTRO features (3g, nfc, a.o.) I get useless packages
included (ofono, neard). What is the best way to remove them?

Can the distro content be changed? Or would I need to build my own
distro? (Which would be not so easy looking at the complex poky.conf
configuration files...)

Thanks

Michael

--
Vaduva alexandru
2014-05-14 13:36:12 UTC
Permalink
Depending on your situation.
If it is a one time yob you can do:
DISTRO_FEATURES_remove = " xxxxx" in your local.conf
Neuer User
2014-05-14 13:54:42 UTC
Permalink
Well, no, not a one-time job. So I rather added

DISTRO_FEATURES_remove = " 3g bluetooth irda nfc zeroconf x11 wayland"

to my image.bb file. Guess, this is then the recommended way to go?

Thanks,

Michael
Post by Vaduva alexandru
Depending on your situation.
DISTRO_FEATURES_remove = " xxxxx" in your local.conf
--
--
Burton, Ross
2014-05-14 13:58:43 UTC
Permalink
Post by Neuer User
to my image.bb file. Guess, this is then the recommended way to go?
Not in your image recipe, no, as then e.g. connman will still think
that you need 3g and nfc.

Ross
--
Philip Balister
2014-05-14 14:02:24 UTC
Permalink
Post by Burton, Ross
Post by Neuer User
to my image.bb file. Guess, this is then the recommended way to go?
Not in your image recipe, no, as then e.g. connman will still think
that you need 3g and nfc.
What Ross said. DISTRO features should only be changed in distro conf
file (or local conf files for testing/local changes).

Philip
Post by Burton, Ross
Ross
--
Neuer User
2014-05-14 14:03:29 UTC
Permalink
Post by Burton, Ross
Post by Neuer User
to my image.bb file. Guess, this is then the recommended way to go?
Not in your image recipe, no, as then e.g. connman will still think
that you need 3g and nfc.
Ross
Right. It doesn't work.

Hmm, so I need my own distro?

Actually, it is not 100% clear to me what the difference and the
interaction of "distro" and "image" is.

What I need is several (slightly to strongly) different images for my
system. Some are for testing only (include some debug apps), some are
for production purposes, some are used as initramfs (very minimal).

So, I should build my own distro, include poky.conf and add the
DISTRO_FEATURES_remove there?

Thanks

Michael

--
Burton, Ross
2014-05-14 14:13:19 UTC
Permalink
Post by Neuer User
Hmm, so I need my own distro?
You don't need to as local.conf is sufficient, but changes to
local.conf are specific to *your current* builds.

Defining a distro is trivial, just make your own distro.conf and
either include poky.conf or actually look at it and see how little
that conf file is actually doing. The default values (which is not
Poky) are a good starting point.
Post by Neuer User
Actually, it is not 100% clear to me what the difference and the
interaction of "distro" and "image" is.
Distro affects everything you build, an image is simply instructions
on how to put some packages together into a disk image.

Ross
--
Neuer User
2014-05-14 14:22:35 UTC
Permalink
Ok, thanks, did this:

made new file "meta-mylayer/conf/distro/mydistro.conf":

include poky.conf

DISTRO_FEATURES_remove = " 3g bluetooth irda nfc zeroconf x11 wayland"

Then changed conf/local.conf:

DISTRO ?= "mydistro"


Then started a bitbake. Got a strange error "LCONF_VERSION is 6, should
be 5 in bblayers.conf". So I changed it to 5.

Then bitbake works, but it seems to recompile ALL packages?! Is this
correct. (I stopped it as it will take half a day to finish).

Thanks again for your help!

Michael
Post by Burton, Ross
Post by Neuer User
Hmm, so I need my own distro?
You don't need to as local.conf is sufficient, but changes to
local.conf are specific to *your current* builds.
Defining a distro is trivial, just make your own distro.conf and
either include poky.conf or actually look at it and see how little
that conf file is actually doing. The default values (which is not
Poky) are a good starting point.
Post by Neuer User
Actually, it is not 100% clear to me what the difference and the
interaction of "distro" and "image" is.
Distro affects everything you build, an image is simply instructions
on how to put some packages together into a disk image.
Ross
--
Vaduva alexandru
2014-05-14 14:27:10 UTC
Permalink
Read this for more information and to understand the difference between distro, machine or image features.


Yocto Project Reference Manual

Yocto Project Reference Manual
Chapter7.Classes Table of Contents 7.1. allarch.bbclass 7.2. archiver.bbclass 7.3. autotools.bbclass 7.4. autotools-brokensep.bbclass 7.5. base.bbclass 7.6. bin_package.bbclass 7.7. binconfig.bbclass
View on www.yoctoproject.org Preview by Yahoo

On Wednesday, May 14, 2014 5:23 PM, Neuer User <auslands-kv-***@public.gmane.org> wrote:

Ok, thanks, did this:

made new file "meta-mylayer/conf/distro/mydistro.conf":

include poky.conf

DISTRO_FEATURES_remove = " 3g bluetooth irda nfc zeroconf x11 wayland"

Then changed conf/local.conf:

DISTRO ?= "mydistro"


Then started a bitbake. Got a strange error "LCONF_VERSION is 6, should
be 5 in bblayers.conf". So I changed it to 5.

Then bitbake works, but it seems to recompile ALL packages?! Is this
correct. (I stopped it as it will take half a day to finish).

Thanks again for your help!

Michael
Post by Burton, Ross
Post by Neuer User
Hmm, so I need my own distro?
You don't need to as local.conf is sufficient, but changes to
local.conf are specific to *your current* builds.
Defining a distro is trivial, just make your own distro.conf and
either include poky.conf or actually look at it and see how little
that conf file is actually doing.  The default values (which is not
Poky) are a good starting point.
Post by Neuer User
Actually, it is not 100% clear to me what the difference and the
interaction of "distro" and "image" is.
Distro affects everything you build, an image is simply instructions
on how to put some packages together into a disk image.
Ross
--
Burton, Ross
2014-05-14 14:27:09 UTC
Permalink
Post by Neuer User
Then started a bitbake. Got a strange error "LCONF_VERSION is 6, should
be 5 in bblayers.conf". So I changed it to 5.
So that's because the Poky layers are a version higher than the
oe-core layers. Once you stop using Poky the version drops. Annoying
but you won't have to do it again.
Post by Neuer User
Then bitbake works, but it seems to recompile ALL packages?! Is this
correct. (I stopped it as it will take half a day to finish).
Yes. bitbake doesn't know that "nfc" only actually impacts a few
recipes, so a changed DISTRO_FEATURES means a new toolchain which
means everything else rebuilds.

Half a day for a build suggests you're building in a VM or a slow
laptop: I recommend using a desktop machine with plenty of RAM.

Ross
--
Neuer User
2014-05-14 14:35:10 UTC
Permalink
Post by Burton, Ross
Post by Neuer User
Then started a bitbake. Got a strange error "LCONF_VERSION is 6, should
be 5 in bblayers.conf". So I changed it to 5.
So that's because the Poky layers are a version higher than the
oe-core layers. Once you stop using Poky the version drops. Annoying
but you won't have to do it again.
Hmm, even if I include poky.conf? Or should I rather use "inherit"?
Would it make a difference? I will make a fast test.
Post by Burton, Ross
Post by Neuer User
Then bitbake works, but it seems to recompile ALL packages?! Is this
correct. (I stopped it as it will take half a day to finish).
Yes. bitbake doesn't know that "nfc" only actually impacts a few
recipes, so a changed DISTRO_FEATURES means a new toolchain which
means everything else rebuilds.
Strangely, when adding the "DISTRO_FEATURES_remove" to local.conf
instead of making a new distro, bitbake does not recompile everything?!
Post by Burton, Ross
Half a day for a build suggests you're building in a VM or a slow
laptop: I recommend using a desktop machine with plenty of RAM.
It's a VM, but just for management purposes. The host is a core-i7
desktop machine. However, I do have Qt5 and this alone takes app 1-2
hours to build. (Actually, only Qt5webkit alone takes more than half an
hour). :-/
Post by Burton, Ross
Ross
--
Neuer User
2014-05-14 14:42:05 UTC
Permalink
Probably solved. It should be

include conf/distro/poky.conf

instead of

include poky.conf.

(Stupid newbie error).

Now bblayers.conf has been automatically updated to "6" again and the
system only recompiles a few packages. Should be finished in 10 min or
so. :-)
Post by Neuer User
Post by Burton, Ross
Post by Neuer User
Then started a bitbake. Got a strange error "LCONF_VERSION is 6, should
be 5 in bblayers.conf". So I changed it to 5.
So that's because the Poky layers are a version higher than the
oe-core layers. Once you stop using Poky the version drops. Annoying
but you won't have to do it again.
Hmm, even if I include poky.conf? Or should I rather use "inherit"?
Would it make a difference? I will make a fast test.
Post by Burton, Ross
Post by Neuer User
Then bitbake works, but it seems to recompile ALL packages?! Is this
correct. (I stopped it as it will take half a day to finish).
Yes. bitbake doesn't know that "nfc" only actually impacts a few
recipes, so a changed DISTRO_FEATURES means a new toolchain which
means everything else rebuilds.
Strangely, when adding the "DISTRO_FEATURES_remove" to local.conf
instead of making a new distro, bitbake does not recompile everything?!
Post by Burton, Ross
Half a day for a build suggests you're building in a VM or a slow
laptop: I recommend using a desktop machine with plenty of RAM.
It's a VM, but just for management purposes. The host is a core-i7
desktop machine. However, I do have Qt5 and this alone takes app 1-2
hours to build. (Actually, only Qt5webkit alone takes more than half an
hour). :-/
Post by Burton, Ross
Ross
--
Richard Purdie
2014-05-15 20:43:19 UTC
Permalink
Post by Neuer User
Probably solved. It should be
include conf/distro/poky.conf
instead of
include poky.conf.
(Stupid newbie error).
FWIW if you said "require" instead of "include" you'd have got a useful
error saying it couldn't find the file.

Cheers,

Richard

--
Neuer User
2014-05-16 07:04:04 UTC
Permalink
Post by Richard Purdie
Post by Neuer User
Probably solved. It should be
include conf/distro/poky.conf
instead of
include poky.conf.
(Stupid newbie error).
FWIW if you said "require" instead of "include" you'd have got a useful
error saying it couldn't find the file.
Cheers,
Richard
Ah, really? So, "include" means, "if you find it then include it - if
not, then doesn't matter"?

Good to know :-)

Thanks to everybody. I have it working now :-)

Michael

--

Burton, Ross
2014-05-14 14:43:29 UTC
Permalink
Post by Neuer User
Strangely, when adding the "DISTRO_FEATURES_remove" to local.conf
instead of making a new distro, bitbake does not recompile everything?!
Well, there's some logic to avoid rebuilds if the distro features
change in a way that the recipe *can't* change, but changing the
distro name impacts *everything*.
Post by Neuer User
Post by Burton, Ross
Half a day for a build suggests you're building in a VM or a slow
laptop: I recommend using a desktop machine with plenty of RAM.
It's a VM, but just for management purposes. The host is a core-i7
desktop machine. However, I do have Qt5 and this alone takes app 1-2
hours to build. (Actually, only Qt5webkit alone takes more than half an
hour). :-/
Oh, WebKit, fair enough. :) Doing it outside of the VM is advisable,
but try giving the VM more memory: pretty sure my average i7 can build
webkit quicker than that.

Ross
--
Anders Darander
2014-05-14 14:01:30 UTC
Permalink
Post by Neuer User
Well, no, not a one-time job. So I rather added
DISTRO_FEATURES_remove = " 3g bluetooth irda nfc zeroconf x11 wayland"
to my image.bb file. Guess, this is then the recommended way to go?
Well, the quick solution is to add that line to local.conf.

The image.bb file is far to late to change the distro configuration.

The better, long term solution would be to define your own distro. Which
really isn't that hard.

Cheers,
Anders
--
Anders Darander
ChargeStorm AB / eStorm AB
--
Burton, Ross
2014-05-14 13:56:48 UTC
Permalink
Post by Neuer User
Can the distro content be changed? Or would I need to build my own
distro? (Which would be not so easy looking at the complex poky.conf
configuration files...)
The "quick" solution is DISTRO_FEATURES_remove="nfc 3g" in local.conf.
For most non-trivial uses of Yocto you'll want your own distro
anyway, but you can either copy poky.conf or include poky.conf from
your own distro.conf and then use DISTRO_FEATURES_remove.

Ross
--
Continue reading on narkive:
Loading...