diff mbox series

dev-manual: add real example of "bin_package"-style recipe

Message ID 3b0e77d9-f64b-6238-ddc1-375c082ec3f8@crashcourse.ca
State New
Headers show
Series dev-manual: add real example of "bin_package"-style recipe | expand

Commit Message

Robert P. J. Day June 21, 2025, 10:44 a.m. UTC
For the section on "Packaging Externally Produced Binaries," end that
section with an actual example of such a recipe from the OE code base.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>

---

Comments

Quentin Schulz June 23, 2025, 1:54 p.m. UTC | #1
Hi Robert,

On 6/21/25 12:44 PM, Robert P. J. Day via lists.yoctoproject.org wrote:
> 
> For the section on "Packaging Externally Produced Binaries," end that
> section with an actual example of such a recipe from the OE code base.
> 
> Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
> 
> ---
> 
> diff --git a/documentation/dev-manual/new-recipe.rst b/documentation/dev-manual/new-recipe.rst
> index c49881efe..5dab196a8 100644
> --- a/documentation/dev-manual/new-recipe.rst
> +++ b/documentation/dev-manual/new-recipe.rst
> @@ -1397,6 +1397,25 @@ doing the following:
>      where you have installed them and whether those files are in
>      different locations than the defaults.
> 
> +As a straightforward example of a ``bin_package``-style recipe, consider

Please refer to classes with a reference and not highlights, so here:

:ref:`ref-classes-bin-package`

instead of

``bin_package``

> +this snippet from the ``wireless-regdb`` recipe file, which fetches

Can we have a link to the recipe file maybe? Considering the recipe is 
often enough updated that we would quickly end up having a dead link, 
maybe point to the parent directory so e.g.:

:oe_git:`wireless-regdb 
</openembedded-core/tree/meta/recipes-kernel/wireless-regdb>`

> +a single tarball of (architecture-independent) binary content and manually
> +installs several files with no need for any configuration or compilation::
> +

Note that you don't need the recipe to be architecture-independent to 
use bin_package (though you should set the appropriate 
COMPATIBLE_MACHINE so that it can only be used on known-to-work 
architectures).

It is not unusual to see patchelf commands in do_compile/do_install to 
operate on the prebuilt binaries as well though I cannot provide any 
example right now.

Looks good to me otherwise!
Thanks!
Quentin
diff mbox series

Patch

diff --git a/documentation/dev-manual/new-recipe.rst b/documentation/dev-manual/new-recipe.rst
index c49881efe..5dab196a8 100644
--- a/documentation/dev-manual/new-recipe.rst
+++ b/documentation/dev-manual/new-recipe.rst
@@ -1397,6 +1397,25 @@  doing the following:
    where you have installed them and whether those files are in
    different locations than the defaults.

+As a straightforward example of a ``bin_package``-style recipe, consider
+this snippet from the ``wireless-regdb`` recipe file, which fetches
+a single tarball of (architecture-independent) binary content and manually
+installs several files with no need for any configuration or compilation::
+
+   SRC_URI = "https://www.kernel.org/pub/software/network/${BPN}/${BP}.tar.xz"
+   SRC_URI[sha256sum] = "57f8e7721cf5a880c13ae0c202edbb21092a060d45f9e9c59bcd2a8272bfa456"
+
+   inherit bin_package allarch
+
+   do_install() {
+       install -d -m0755 ${D}${nonarch_libdir}/crda
+       install -d -m0755 ${D}${sysconfdir}/wireless-regdb/pubkeys
+       install -m 0644 regulatory.bin ${D}${nonarch_libdir}/crda/regulatory.bin
+       install -m 0644 wens.key.pub.pem ${D}${sysconfdir}/wireless-regdb/pubkeys/wens.key.pub.pem
+       install -m 0644 -D regulatory.db ${D}${nonarch_base_libdir}/firmware/regulatory.db
+       install -m 0644 regulatory.db.p7s ${D}${nonarch_base_libdir}/firmware/regulatory.db.p7s
+   }
+
 Following Recipe Style Guidelines
 =================================