TipsAndTricks/Incorporating closed source components

From Yocto Project
Jump to: navigation, search

Incorporating closed source components

As users of open source tools, we'd often like all of the software we use to be distributed in source form; however that's not always possible. Particularly in a commercial setting where there are third parties involved it may not be practical, in which case if you're using OpenEmbedded you may need a way to both produce and subsequently consume the binary-only components.

  1. Create a file describing the redistribution terms for the binaries in plain text form.
  2. Create a separate build directory where you do have recipe which compiles the component you want to deliver from source. This recipe would go into a separate layer that you do not use as part of normal image/SDK builds and that is not released publicly. Within do_install the recipe should install all files as normal, plus install the license text created in step 1 to some location e.g. ${docdir} so that it gets distributed along with the output.
  3. Build the recipe and take the package (rpm/ipk) produced from this as what you deliver for use in the next step. Alternatively if you would prefer a plain tarball instead, add the following to the recipe (not to your local.conf/distro config):
    IMAGE_CLASSES += "package_tar"
  4. Store the package created in step 3 somewhere such that it can be fetched by any user wishing to use it, e.g. an http/https server, and obtain a URL for the package.
  5. Create a recipe in one of the layers you do use for image/SDK builds that points at the URL and installs the files in the package verbatim given that they are already in the structure matching the target. There is a shortcut for this - to create each recipe use devtool add -b, or recipetool create -b if you just want the recipe with less hand-holding. LICENSE should be set to "CLOSED" for this recipe or alternatively make up some name that you can use to refer to the license text you prepared in step 1 e.g. "<softwarename>-Proprietary". You may want to name this recipe slightly differently to the original recipe used in step 1 for clarity, e.g. if the original was called widget-driver then you could name this one widget-driver-bin.
  6. Add the packages produced from the recipe created in step 4 to the image recipe so they end up in the image and corresponding SDK.

Of course, in a typical scenario, steps 1-4 and 5-6 may be done by developers in different organisations. As the developer incorporating the closed source components you will want to ensure reproducible builds in future, so you may need to mirror the binary package file(s) locally. You can use MIRRORS or PREMIRRORS to point to this mirror.

Personal tools