2014-10-27 130 views
1

我想写一个简单的bitbake配方,它会将一些脚本安装到目标根文件系统中。我必须失去了一些东西,因为我觉得我设置正确,但我不断收到错误消息:为什么不能bitbake找到并安装我的脚本?

ERROR: Function failed: do_install (see /home/mike/ULF/ulf/build-ulf/out/work/armv7ahf-vfp-neon-linux-gnueabihf/ttt/1.0-r0/temp/log.do_install.493 for further information) 
ERROR: Logfile of failure stored in: /home/mike/ULF/ulf/build-ulf/out/work/armv7ahf-vfp-neon-linux-gnueabihf/ttt/1.0-r0/temp/log.do_install.493 
Log data follows: 
| DEBUG: Executing shell function do_install 
| install: cannot stat `uim2svc.sh': No such file or directory 
| ERROR: Function failed: do_install (see /home/mike/ULF/ulf/build-ulf/out/work/armv7ahf-vfp-neon-linux-gnueabihf/ttt/1.0-r0/temp/log.do_install.493 for further information) 
ERROR: Task 2 (/home/mike/ULF/ulf/oe-ghmi/recipes/images/ttt.bb, do_install) failed with exit code '1' 

现在,我已经读bitbake documenation on the local-file-fetcher和它说:

该子模块处理以file://开头的URL。您在URL中指定的文件名可以是文件的绝对路径或相对路径。如果文件名是相对的,则FILESPATH变量的内容以与PATH用于查找可执行文件相同的方式使用。

所以我在SRC_URI有文件名,在当地files目录的脚本,我已经签出从构建和路径点输出到我的脚本目录...... 所以为什么我得到这个错误仍然?任何人有关于我可能做错什么的想法?


这里是我的全bitbake的食谱(ttt.bb):

LICENSE = "MIT" 
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" 
SRC_URI = "file://uim2svc.sh" 

do_install() { 
    install -d ${IMAGE_ROOTFS}/etc 
    install -d -m 0755 ${IMAGE_ROOTFS}/etc/init.d 
    install -m 0755 uim2svc.sh ${IMAGE_ROOTFS}/etc/init.d/ 
} 

而这里的树(起始/家/麦克风/ ULF/ULF)显示了文件:

oe-ghmi/ 
├── classes 
├── conf 
├── recipes 
│   └── images 
│    ├── files 
│    │   └── uim2svc.sh 
│    ├── global-hmi-image.bb 
│    ├── ttt.bb 

而且从bitbake -e ttt(截断)输出的:

FILESPATH =“...:/ home/mike/ULF/ulf/oe-ghmi/recipes/images/files/armv7a:/ home/mike/ULF/ulf/oe-ghmi/recipes/images /文件/ ghmi:/家庭/麦克风/ ULF/ULF/OE-ghmi /食谱/图像/文件/

回答

6

按照OpenEmbedded manual,部分9.13:

When source code is specified as a part of SRC_URI it is unpacked into 
the work directory, ${WORKDIR}. 

因此,您的脚本被bitbake检测到并部署在${WORKDIR}。方法do_install()应引用文件相对于${WORKDIR}。 手册中有一个例子,其中9.13.2。文件:补丁和其他文件

Non-patch files are copied to the work directory, ${WORKDIR}. You can access 
these files from within a recipe by referring to them relative to the work 
directory. The following example, from the quagga recipe, shows the above 
init script being included in the package by copying it during the install 
task 

和提供的代码展示了如何做到这一点:

do_install() { 
# Install init script and default settings 
install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d ${D}${sysconfdir}/ 
install -m 0644 ${WORKDIR}/quagga.init ${D}${sysconfdir}/init.d/quagga 
... 

这可能也是值得注意的是,文件不会直接复制到${IMAGE_ROOTFS},但$改为{D}。从部分7.4 Tasks

install 
The install task is responsible for actually installing everything. 
This needs to install the software into the destination directory, D. 
This directory won’t actually be a part of the final package though. 
In other words if you install something into ${D}/bin then it will end 
up in the /bin directory in the package and therefore on the target. 

一旦完成do_install,目录${D}打包,然后安装到最终ROOTFS目录,${IMAGE_ROOTFS},通过rootfs_ipkg类(由recepie你正在构建的图像调用)。从部分9.10 rootfs_ipkg class

The rootf_ipk class is used to create a root filesystem for the target 
device from a set of .ipkg packages. 

在执行的任务:

4. Configures ipkg to allow it to be used locally to install into the 
root filesystem ${IMAGE_ROOTFS}; 
5. Installs locale related .ipkg packages; 

${IMAGE_ROOTFS}最终产生最终的文件系统。

+1

值得再补充的是,对于_be_installed_into_the_real_rootfs,软件包应该添加到IMAGE_INSTALL_append =“xxx”在local.conf或相应的图像收件人 – pmod 2016-10-13 21:38:29

0

你需要添加下面的线以上的 “” SRC_URI “像这样

FILESEXTRAPATHS_prepend:= ”$ {} THISDIR:“

LICENSE = ”MIT“ LIC_FILES_CHKSUM =” 文件:// $ {} COREBASE /证; MD5 = 3f40d7994397109285ec7b81fdeb3b58" FILESEXTRAPATHS_prepend:= “$ {} THISDIR:” SRC_URI = “文件://uim2svc.sh”

的搜索bitbake的食谱名的目录名称相同这就是为什么它现在复制WORKDIR 现在你正在添加FIL ESEXTRAPATHS行,然后它会从您的RECIPE的目录路径搜索。

相关问题