Bitbake not installing my file in the rootfs image

前端 未结 2 1418
心在旅途
心在旅途 2020-12-29 09:29


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

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-29 09:49

    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.

提交回复
热议问题