Skip to contentSkip to conversation

Best way to remove DISTRO_FEATURES?

DISCUSSION Neuer User 6 participants 17 messages May 14, 2014 – May 16, 2014

lore
Share & tools
lore

Neuer User

author
#0 lore raw

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

#1 lore raw

Depending on your situation.
If it is a one time yob you can do:
DISTRO_FEATURES_remove = " xxxxx" in your local.conf

author
#2 lore raw

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

Am 14.05.2014 15:36, schrieb Vaduva alexandru:

Quoted 8 lines

Depending on your situation.
If it is a one time yob you can do:
DISTRO_FEATURES_remove = " xxxxx" in your local.conf

#3 lore raw
Quoted 1 line · 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

#4 lore raw
Quoted 5 lines · Ross
Quoted 1 line · 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

Quoted 3 lines

Ross

author
#5 lore raw
In reply to Burton, Ross

Am 14.05.2014 15:58, schrieb Burton, Ross:

Quoted 8 lines · Neuer User
Quoted 1 line

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

#6 lore raw
Quoted 1 line · 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.

Quoted 2 lines

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

author
#7 lore raw

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

Am 14.05.2014 16:13, schrieb Burton, Ross:

Quoted 19 lines · Neuer User
Quoted 1 line

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.

Quoted 2 lines

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

#8 lore raw

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 <[email protected]> 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

Am 14.05.2014 16:13, schrieb Burton, Ross:

Quoted 19 lines · Neuer User
Quoted 1 line

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.

Quoted 2 lines

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

Signature · 4 lines
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto
#9 lore raw
In reply to Neuer User
Quoted 2 lines · 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.

Quoted 2 lines

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

author
#10 lore raw

Am 14.05.2014 16:27, schrieb Burton, Ross:

Quoted 8 lines · Neuer User
Quoted 2 lines

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.

Quoted 7 lines
Quoted 2 lines

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?!

Quoted 3 lines

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). :-/

Quoted 2 lines

Ross

author
#11 lore raw

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. :-)

Am 14.05.2014 16:35, schrieb Neuer User:

Quoted 34 lines

Am 14.05.2014 16:27, schrieb Burton, Ross:

Quoted 8 lines · Neuer User
Quoted 2 lines

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.

Quoted 7 lines
Quoted 2 lines

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?!

Quoted 3 lines

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). :-/

Quoted 2 lines

Ross

#12 lore raw
Quoted 9 lines · 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

author
#13 lore raw

Am 15.05.2014 22:43, schrieb Richard Purdie:

Quoted 9 lines · Neuer User
Quoted 8 lines

Probably solved. It should be

include conf/distro/poky.conf

instead of

include poky.conf.

Quoted 9 lines
Quoted 1 line

(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

#14 lore raw
In reply to Neuer User
Quoted 2 lines · 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*.

Quoted 7 lines
Quoted 3 lines

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

#15 lore raw
In reply to Neuer User
Quoted 3 lines · 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

Signature · 2 lines
Anders Darander
ChargeStorm AB / eStorm AB
#16 lore raw
In reply to Neuer User
Quoted 3 lines · 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