Yocto:cp可以';t stat file:没有这样的文件或目录

Yocto:cp可以';t stat file:没有这样的文件或目录,yocto,openembedded,Yocto,Openembedded,我试图在我的目标rootfs中复制两个文件夹(包含一些脚本)。我已经创建了一个自定义图层和一个自定义配方。 我的目录结构如下: ../sources/meta-company/recipes-bla_2.06/ └── bla ├── bla │   ├── dir1 │   │   ├── dir │   │   │   └── files.sh │   └── dir2 │   ├── dir │   │   ├── f

我试图在我的目标rootfs中复制两个文件夹(包含一些脚本)。我已经创建了一个自定义图层和一个自定义配方。 我的目录结构如下:

../sources/meta-company/recipes-bla_2.06/
└── bla
    ├── bla
    │   ├── dir1
    │   │   ├── dir
    │   │   │   └── files.sh
    │   └── dir2
    │       ├── dir
    │       │   ├── files.sql
    │       ├── test.sh
    └── bla_2.06.bb
我的.bb文件如下所示:

DESCRIPTION = " bla "

LICENSE = "CLOSED"

SRC_URI = "file://dir1/ \
           file://dir2/ "

do_install() {
    install -d ${D}/root/dir1
    install -d ${D}/root/dir2
    cp -r --no-dereference --preserve=mode,links -v ${S}/dir1/ ${D}/root/dir1
    cp -r --no-dereference --preserve=mode,links -v ${S}/dir2/ ${D}/root/dir2/
}

FILE_$PN = "/root/"
我得到的错误是:

> Log data follows: | DEBUG: Executing shell function do_install | cp:
> cannot stat
> '/home/amol/test/fsl-arm-yocto-bsp/build-cl-som-imx7-fsl-imx-x11/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/bla/1.0-r0/bla-1.0/dir1':
> No such file or directory | WARNING: exit code 1 from a shell command.
> | ERROR: Function failed: do_install (log file is located at
> /home/amol/test/fsl-arm-yocto-bsp/build-cl-som-imx7-fsl-imx-x11/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/seriald/1.0-r0/temp/log.do_install.49808)
> NOTE: recipe bla-1.0-r0: task do_install: Failed NOTE: Tasks Summary:
> Attempted 334 tasks of which 333 didn't need to be rerun and 1 failed.

我是yocto的新手,我的.bb文件正确吗?提前谢谢。

在您的
安装部分中有两个问题

  • ${S}
    指向源目录,但
    SRC_URI
    ${WORKDIR}
    中复制您的内容。因此,您应该在安装部分使用
    ${WORKSIR}
  • 您试图在
    ${D}/root/dir1
    内部复制
    ${S}/dir1/
    ,这意味着您的最终结构是
    /root/dir1/dir1/
    。你可能不想要这个
  • 所以修改后的版本看起来像

    do_install() {
        install -d ${D}/root/dir1
        install -d ${D}/root/dir2
        cp -r --no-dereference --preserve=mode,links -v ${WORKDIR}/dir1/* ${D}/root/dir1/
        cp -r --no-dereference --preserve=mode,links -v ${WORKDIR}/dir2/* ${D}/root/dir2/
    }
    

    进行了修改,现在我正在获取do_软件包:已安装文件/目录,但尚未发布。您需要
    文件${PN}=“/root/”
    尝试清理并重新编译
    bitbake-c cleanall配方bla
    -c cleansstate