代码之家  ›  专栏  ›  技术社区  ›  Mark

在yocto中添加层时出现问题

  •  2
  • Mark  · 技术社区  · 7 年前

    我对yocto很陌生,正在努力学习如何使用它。我遵循了mega手册一节中的步骤 section 5.1.9 . 我跑了

    yocto-layer create mylayer

    编辑我的bblayers。conf文件包含以下内容:

     BBLAYERS = ?" \
        /usr/local/src/yocto/meta \
        /usr/local/src/yocto/meta-poky \
        /usr/local/src/yocto/meta-yocto-bsp \
        /usr/local/src/yocto/meta-mylayer \
        "
    

    我跑了 source oe-init-build-env 然后 bitbake core-image-sato runqemu qemu86 nographics 登录后 find / -name helloworld

    # We have a conf and classes directory, add to BBPATH
    BBPATH .= ":${LAYERDIR}"
    
    # We have recipes-* directories, add to BBFILES
    BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
        ${LAYERDIR}/recipes-*/*/*.bbappend"
    
    BBFILE_COLLECTIONS += "mylayer"
    BBFILE_PATTERN_mylayer = "^${LAYERDIR}/"
    BBFILE_PRIORITY_mylayer = "6"
    

    #
    # This file was derived from the 'Hello World!' example recipe in the
    # Yocto Project Development Manual.
    #
    
    SUMMARY = "Simple helloworld application"
    SECTION = "examples"
    LICENSE = "MIT"
    LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
    
    SRC_URI = "file://helloworld.c"
    
    S = "${WORKDIR}"
    
    do_compile() {
         ${CC} ${LDFLAGS} helloworld.c -o helloworld
    }
    
    do_install() {
         install -d ${D}${bindir}
         install -m 0755 helloworld ${D}${bindir}
    }
    

    meta-mylayer/recipes-example/example/example-0.1/helloworld。c:

    #include <stdio.h>
    
    int main(int argc, char **argv)
    {
        printf("Hello World!\n");
    
        return 0;
    }
    
    1 回复  |  直到 7 年前
        1
  •  2
  •   Ross Burton    7 年前

    使用镜像配方中的image\u INSTALL在镜像中添加所需的软件包。

    http://www.yoctoproject.org/docs/latest/dev-manual/dev-manual.html#usingpoky-extend-customimage .