添加额外的文件到bitbake配方

时间:2018-01-10 11:55:52

标签: yocto bitbake

我正在尝试创建一个将.jar添加到目标的/ home / root的配方。

我的图层中有以下结构:

bernardo@bernardo-ThinkCentre-Edge72:~/yocto/genericx86-64-rocko-18.0.0/build$ tree ../meta-datavision/recipes-devtools/horus/
../meta-datavision/recipes-devtools/horus/
├── horus-1.3
│   ├── application.properties
│   └── horus-1.3.0.jar
└── horus_1.3.bb

1 directory, 3 files

这是我的食谱(horus_1.3.bb):

bernardo@bernardo-ThinkCentre-Edge72:~/yocto/genericx86-64-rocko-18.0.0/build$ cat ../meta-datavision/recipes-devtools/horus/horus_1.3.bb 
SUMMARY = "Horus Vizentec"
DESCRIPTION = "Horus Vizentec"
LICENSE = "CLOSED"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" 

SRC_URI += " file://horus-1.3.0.jar \
         file://application.properties"

do_install(){
    install -m 0755 ${WORKDIR}/horus-1.3.0.jar ${D}/home/root
    install -m 0755 ${WORKDIR}/application.properties ${D}/home/root
}

但是,当我尝试构建时,出现No such file or directory错误:

bernardo@bernardo-ThinkCentre-Edge72:~/yocto/genericx86-64-rocko-18.0.0/build$ bitbake core-image-sato
WARNING: Host distribution "ubuntu-14.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |##################################| Time: 0:00:00
Loaded 2030 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.35.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "universal-4.8"
TARGET_SYS        = "x86_64-poky-linux"
MACHINE           = "genericx86-64"
DISTRO            = "poky"
DISTRO_VERSION    = "2.4"
TUNE_FEATURES     = "m64 core2"
TARGET_FPU        = ""
meta              
meta-poky         = "<unknown>:<unknown>"
meta-datavision   = "master:fbc80d7199bef45f87762098ae34d199bb3a9765"
meta-yocto-bsp    = "<unknown>:<unknown>"
meta-oe           = "rocko:6e3fc5b8d904d06e3aa77e9ec9968ab37a798188"

Initialising tasks: 100% |#############################| Time: 0:00:16
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: horus-1.3-r0 do_install: Function failed: do_install (log file is located at /home/bernardo/yocto/genericx86-64-rocko-18.0.0/build/tmp/work/core2-64-poky-linux/horus/1.3-r0/temp/log.do_install.8961)
ERROR: Logfile of failure stored in: /home/bernardo/yocto/genericx86-64-rocko-18.0.0/build/tmp/work/core2-64-poky-linux/horus/1.3-r0/temp/log.do_install.8961
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/home/bernardo/yocto/genericx86-64-rocko-18.0.0/meta/recipes-devtools/quilt/quilt-native_0.65.bb:do_populate_sysroot', 'virtual:native:/home/bernardo/yocto/genericx86-64-rocko-18.0.0/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb:do_populate_sysroot', 'virtual:native:/home/bernardo/yocto/genericx86-64-rocko-18.0.0/meta/recipes-extended/unzip/unzip_6.0.bb:do_populate_sysroot', '/home/bernardo/yocto/genericx86-64-rocko-18.0.0/meta/recipes-core/glibc/glibc_2.26.bb:do_populate_sysroot', '/home/bernardo/yocto/genericx86-64-rocko-18.0.0/meta/recipes-devtools/gcc/gcc-cross_7.2.bb:do_populate_sysroot', '/home/bernardo/yocto/genericx86-64-rocko-18.0.0/meta/recipes-devtools/gcc/gcc-runtime_7.2.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['quilt-native', 'pseudo-native', 'unzip-native', 'glibc', 'gcc-cross-x86_64', 'gcc-runtime', 'linux-libc-headers', 'xz-native', 'binutils-cross-x86_64', 'automake-native', 'libmpc-native', 'mpfr-native', 'texinfo-dummy-native', 'zlib-native', 'libtool-native', 'gmp-native', 'autoconf-native', 'gnu-config-native', 'libgcc', 'gettext-minimal-native', 'bison-native', 'flex-native', 'm4-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_install
| install: cannot stat ‘/home/bernardo/yocto/genericx86-64-rocko-18.0.0/build/tmp/work/core2-64-poky-linux/horus/1.3-r0/horus-1.3.0.jar’: No such file or directory
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_install (log file is located at /home/bernardo/yocto/genericx86-64-rocko-18.0.0/build/tmp/work/core2-64-poky-linux/horus/1.3-r0/temp/log.do_install.8961)
ERROR: Task (/home/bernardo/yocto/genericx86-64-rocko-18.0.0/meta-datavision/recipes-devtools/horus/horus_1.3.bb:do_install) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4462 tasks of which 4461 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/bernardo/yocto/genericx86-64-rocko-18.0.0/meta-datavision/recipes-devtools/horus/horus_1.3.bb:do_install
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

我的食谱中缺少什么? 非常感谢任何帮助。

1 个答案:

答案 0 :(得分:1)

感谢提示家伙们! 经过一些调整后的配方,我终于开始工作了。 添加;unpack=0确实有帮助。

SUMMARY = "Horus Vizentec"
DESCRIPTION = "Horus Vizentec"
LICENSE = "CLOSED"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:" 
FILES_${PN} += "${datadir}/java"

SRC_URI += "file://horus-1.3.0.jar;unpack=0"
SRC_URI += "file://application.properties"

do_install(){
        install -m 0755 -d ${D}/usr/share/java
        install -m 0755 ${WORKDIR}/horus-1.3.0.jar ${D}/usr/share/java
        install -m 0755 ${WORKDIR}/application.properties ${D}/usr/share/java
}