14

I have a project which is using yocto for building libraries including gstreamer. I found out that I need to patch some gstreamer element thus creating new bitbake recipe with patch..

I usually have to run bitbake with image name as parameter which will rebuild whole yocto (which is quite long):

MACHINE=some_machine nice bitbake yocto-etc-etc

How do I rebuild just that part which I need and not whole yocto? I heard about devtool, but I am not sure how to use that.

2
  • The sstate-cache will do the job of choosing which to rebuild and which is not. So it would take long. If you want to know more about devtool. Go to devday.yocto.link to get the power point about the developer day training.
    – Charles C.
    Apr 8, 2016 at 2:45
  • You may rebuild gstreamer: bitbake -c clean && bitbake -c gstreamer And after to include it to your image: bitbake -c clean yourImage && bitbake yourImage
    – Ziegfried
    Nov 21, 2019 at 13:43

7 Answers 7

26

you can pass different command to bitbake based on what you need.

To remove temp:

bitbake -c clean gstreamer

To remove temp and sstate cache (I use this most):

bitbake -c cleansstate gstreamer

To remove download as well, and lets begin build starting from do_fetch and all

bitbake -c cleanall gstreamer

Once you are done with either of these clean, which ever suits you, you can simple give build command for the specified:

bitbake gstreamer
1
  • 1
    thanks for explaining all the clean types.. sometimes when I use cleanall the package fails to build.. then I have to remove also the package files in temp/work/*/package and temp/stamps/*/package.. only then it builds.. not sure why (I do not have the errors at hand).. btw you have typo s/remote/remove/ ..
    – nayana
    Jul 4, 2017 at 12:08
8

Certainly, this is easy to do. Just specify the recipe you want to build instead of the image name, for example if it was the main gstreamer recipe you had changed (which at least in current versions is called gstreamer1.0):

MACHINE=some-machine bitbake gstreamer1.0

Note that the name expected on the command line is always a recipe name or something from PROVIDES in a recipe, and not a runtime package name.

Regarding devtool, it can certainly put you into an environment where you can more easily make changes to the source for a recipe and generate patches from them, but the actual building part we are discussing here doesn't really change. You can find more information on how to use devtool in the Yocto Project Development Manual

2
  • also I have to notice that finaly I used MACHINE=xx bitbake -c package_write_ipk then copy the package and install with ipkg install - well I am not sure if it actualy worked because I messed up something but it looks intelligent at least, I will test it someday. Anyway thanks for useful info this is how its done properly.. it answers my question how to build one task..
    – nayana
    May 5, 2016 at 12:20
  • Note that this is building one recipe - a "task" is something like do_compile or do_package_write_ipk, i.e. just one of a number of parts of what's required to be executed to build a recipe. May 10, 2016 at 1:17
4

You can also

clean: Removes all output files for a target cleanall: Removes all output files, shared state cache, and downloaded source files for a target, depending on the changes

bitbake -c clean task 
bitbake -c cleanall task
2
  • I always had to rm -rf yocto/temp/stamps/target/module and the same for temp/work.. is this doing this.. btw how does it relate my question? I asked about building .. anyway thanks for useful info
    – nayana
    May 5, 2016 at 12:16
  • Sorry, I forgot to mention you clean how I wrote up and then build anew May 5, 2016 at 20:18
3

First you can create a patch on the gstreamer using quilt or diff etc...

Put the patch into your meta layer and include it into,SRC_URI += "file://xxxx.patch".

Make sure you have added FILESEXTRAPATHS_PREPEND variable in the bbappend file of recipe.

Then do a cleansstate of the package.

bitabake gstreamer** -c cleansstate

Then execute do_patch operation and check our patch has been applied properly.

bitabake gstreamer*** -c patch

Then do the full build of the component followed by built the final target.

1

You can also launch the taskes you are interested in, for example:

If you want to apply only the patch you can do something like:

# Apply the patch you have located and sourced in SRC_URI variable previously
MACHINE=some_machine nice bitbake -c patch gstreamer
# Compile the recipe 
MACHINE=some_machine nice bitbake -c compile gstreamer

# In case there are more necessary tasks, launch them as previous

Now you can get the generated package, and pass it to your board (eg. via ssh/serial(zmodem) ), test it and repeat until you like the resul, then regenerate the image doing:

for i in clean cleanall cleansstate;do bitbake -c ${i} gstreamer;done
MACHINE=some_machine nice bitbake yocto-etc-etc
0

you can build any specific recipe by providing the recipe name along with the bitbake command

For instance, If you want to build gstreamer

poky/meta/recipes-multimedia/gstreamer1.0_1.16.3.bb

you can use the following command

MACHINE=<your-machine-name> bitbake gstreamer1.0

Note that the PROVIDES value will be parsed from .bb filename excluding the characters after underscore.

Additional suggestions

If you want to do some experimental changes in your source and wants to compile for each minimalistic change, you could do that by navigating to work directory

cd build/tmp/work/armv5e-poky-linux-gnueabi/gstreamer1.0/1.16.3-r0/

here you can apply your changes in src directory and you can use ./temp/run.do_compile to compile, which will take very less time compared to the entire build time.

0

You can same the machine name in the file root**/build/conf/local.conf** : MACHINE = "some_machine"

Then from the root directory : source ./oe-init-build-env

This will redirect you to the buid/ directory Then (from the build directory) : bitbake gstreamer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.