Bitbake not installing my file in the rootfs image
Remove all lines that aren't necessy, just to be on the safe side.
FILESEXTRAPATHS
is not necessary; it's only used when you're writing a .bbappend
file to modify a recipe in another layer.
ALLOW_EMPT_${PN}
is also not needed. It's used to allow PN to be empty, which is only useful if you're creating other packages. In your case, you wnat the firmware files in PN, thus it's better to have bitbake error out while building your package if the files can't be installed.
INSANE_SKIP_${PN} += "installed-vs-shipped"
is also not needed. It's only required if you install files in your do_install
that you're not putting in a package. Normally, you're advised to not install them or delete the files instead.
Your do_install()
should work fine; though I'd recommend to use install
instead of cp
and chmod
. That way you're also ensured that the owner and group will be correct. (Checks for this are added as a new QA check in Jethro).
PACKAGES = "${PN}"
is not needed.
Remove ${D}
from you FILES_${PN}
definition. The paths in FILES
should be the path on the target (i.e. not including the D
-directory).
This should get you up'n'running.
Thanks, good starting point. I finally did it this way for installing two .sh scripts.
I created this file structure (the folder name "files" is automatically known by Yocto and can best be kept as is):
> bitbake-layers create-layer meta-mylayer
> cp -r meta-mylayer ../sources/yocto/meta-layers/
> cat >> conf/bblayers.conf << EOF
> ${BSPDIR}/sources/meta-mynetworklayer \
> EOF
> pwd
/yocto/meta-layers/meta-mylayer/recipes-tools/somename
> tree .
.
├── files
│ ├── somescript1.sh
│ └── somescript2.sh
└── somename.bb
I added the refenrence to "somename" to the local.conf:
IMAGE_INSTALL_append = " somename"
And the somename.bb file looks this way:
DESCRIPTION = "Some description"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI += " file://somescript1.sh \
file://somescript2.sh \
"
inherit allarch
do_compile[noexec] = "1"
do_install() {
install -d ${D}${bindir}
install -m 0770 ${WORKDIR}/somescript*.sh ${D}/${bindir}
}
Yocto will find the files in the folder "files" automatically, it will copy them to the temporary ${WORKDIR} and the second "install" line makes sure that both files will later on the target be present in the folder /usr/bin. Because ${bindir} (e.g. /usr/bin) is used as copy target no FILES_${PN} is needed in this case.