Difference between revisions of "How to add binary files via a custom recipe"

From KoanSoftware Wiki
Jump to: navigation, search
(Created page with "== How to add binary files via a custom recipe == When using Yocto Project it sometimes may be necessary to insert binary files via a custom recipe. Below is an example of a...")
 
(No difference)

Latest revision as of 08:32, 4 December 2024

How to add binary files via a custom recipe

When using Yocto Project it sometimes may be necessary to insert binary files via a custom recipe.

Below is an example of a recipe to manage that

#
# binary_0.1.bb
#

DESCRIPTION = "Install custom files to /root directory"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""

SRC_URI = "file://my-binary \
	   file://my-config-file"

do_install() {
    # Create the /root directory in the target filesystem
    install -d ${D}${sysconfdir}/root

    # Install your binary and config file
    install -m 0755 ${WORKDIR}/my-binary ${D}/root/my-binary
    install -m 0644 ${WORKDIR}/my-config-file ${D}/root/my-config-file
}

FILES:${PN} = "/root"