Yocto recipe: how to install in a specific folder
I think you want to copy your compiled program to a folder such as ${bindir}
:
Quoting from Yocto ref-manual 1.1:
When specifying paths as part of the CONFFILES variable, it is recommended to use the appropriate path variables. For example, $ {sysconfdir}, not / etc or $ {bindir}, not / usr / bin. These variables are listed at the top of the meta / conf / bitbake.conf file in the source directory .
You can copy files from the working directory to any directory on the target file system. For example, take a look at the hello-world example (note that the example is from the 1.1 reference manual, but I haven't found it in the new version yet):
DESCRIPTION = "Simple helloworld application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
PR = "r0"
SRC_URI = "file://helloworld.c"
S = "${WORKDIR}"
do_compile() {
${CC} helloworld.c -o helloworld
}
do_install() {
install -d ${D}${bindir}
install -m 0755 helloworld ${D}${bindir}
}
In this example, the binary helloworld
will be copied onto /usr/bin
in your image (may also be /opt
, see source directory for variable definition).
source to share
do_install () {
install -d ${D}{base_prefix}/opt/xyz/
install -m ${WORKDIR}/yourbinary ${D}${base_prefix}/opt/xyz/
}
FILES _ $ {PN} = "$ {base_prefix} / opt / *"
above 1st line creates a directory in imagedir in that opt ââ/ xvz /
The second line will copy your binary to select / xyz / dir
Using the third line to copy your opt / xyz / binary to yocto rootfs.
source to share