Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bitbake not installing my file in the rootfs image

Tags:

yocto

bitbake


I have created a bitbake recipe that would copy 2 of my files (firmware binaries for VPU) into /lib/firmware/ directory on targets root filesystem.

I have tried many options so I'm now not sure what in my recipe is unnecessary/redundant and what is needed. I think that FILESEXTRAPATHS.., SRC_URI.. and do_install.. should be enough but it doesn't work with just it and neither with all other stuff.

DESCRIPTION = "VPU libraries provided by fsl"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"

PACKAGE_ARCH = "all"
ALLOW_EMPTY_${PN} = "1"

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += " \
    file://vpu_fw_imx6d.bin \
    file://vpu_fw_imx6q.bin \
"

INSANE_SKIP_${PN} += "installed-vs-shipped"

do_install () {
    install -d ${D}${base_libdir}/firmware/
    cp ${WORKDIR}/vpu_fw_imx6d.bin ${D}${base_libdir}/firmware/
    cp ${WORKDIR}/vpu_fw_imx6q.bin ${D}${base_libdir}/firmware/
    chmod 755 ${D}${base_libdir}/firmware/vpu_fw_imx6d.bin
    chmod 755 ${D}${base_libdir}/firmware/vpu_fw_imx6q.bin
}
PACKAGES = "${PN}"
FILES_${PN} += " \
        ${D}${base_libdir}/firmware/vpu_fw_imx6d.bin \
        ${D}${base_libdir}/firmware/vpu_fw_imx6q.bin \
"

Could you please point me what I do wrong?

EDIT:
Anders answer really helped and resolved the issue.

I'm posting "fixed" recipe in case someone finds it helpful.

DESCRIPTION = "VPU libraries provided by fsl"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"

PACKAGE_ARCH = "all"

SRC_URI += " \
    file://vpu_fw_imx6d.bin \
    file://vpu_fw_imx6q.bin \
"

do_install () {
    install -d ${D}${base_libdir}/firmware/
    install -m 755 ${WORKDIR}/vpu_fw_imx6d.bin ${D}${base_libdir}/firmware/
    install -m 755 ${WORKDIR}/vpu_fw_imx6q.bin ${D}${base_libdir}/firmware/
}

FILES_${PN} += " \
        ${base_libdir}/firmware/vpu_fw_imx6d.bin \
        ${base_libdir}/firmware/vpu_fw_imx6q.bin \
"
like image 743
lewiatan Avatar asked Dec 03 '15 13:12

lewiatan


People also ask

What is Workdir in BitBake?

The default value of ${WORKDIR} is defined in bitbake variables. But you can change it in the recipe. It points toward the directory where bitbake unpacks the package. You can get the value of ${WORKDIR} from the bitbake environment bitbake -e <recipe-name> | grep ^WORKDIR=

What is BitBake file?

BitBake is a make-like build tool with the special focus of distributions and packages for embedded Linux cross compilation, although it is not limited to that. It is inspired by Portage, which is the package management system used by the Gentoo Linux distribution.


1 Answers

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.

like image 105
Anders Avatar answered Oct 24 '22 00:10

Anders