我正在尝试编写一个简单的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中指定的文件名可以是文件的绝对路径或相对路径。如果文件名是相对的,则使用PATESPATH变量的内容的方式与使用PATH查找可执行文件的方式相同。
所以我的SRC_URI
中有文件名,本地files
目录中的脚本,我已经检查了构建的输出,路径指向我的脚本目录... 为什么我仍然会收到此错误 ?任何人都有关于我可能做错的想法吗?
这是我的完全比特食谱(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/
}
这里的树(从/ home / mike / ULF / ulf开始)显示文件的位置:
oe-ghmi/
├── classes
├── conf
├── recipes
│ └── images
│ ├── files
│ │ └── uim2svc.sh
│ ├── global-hmi-image.bb
│ ├── ttt.bb
来自bitbake -e ttt
的(截断的)输出:
FILESPATH =" ...:/家庭/麦克风/ ULF / ULF / OE-ghmi /食谱/图像/文件/ armv7a:/家庭/麦克风/ ULF / ULF / OE-ghmi /食谱/图像/文件/ ghmi:的 /家庭/麦克风/ ULF / ULF / OE-ghmi /食谱/图像/文件/ "
答案 0 :(得分: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部分的手册中有一个例子。 file:for patches and additional files :
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}
被打包,然后安装到${IMAGE_ROOTFS}
类的最终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 :(得分:0)
您需要在"" SRC_URI"上方添加以下行。像这样
LICENSE =" MIT" LIC_FILES_CHKSUM =" file:// $ {COREBASE} / LICENSE; md5 = 3f40d7994397109285ec7b81fdeb3b58" FILESEXTRAPATHS_prepend:=" $ {THISDIR}:" SRC_URI =" file://uim2svc.sh"
bitbake搜索dir同名配方名称,这就是为什么它要复制WORKDIR 现在您要添加FILESEXTRAPATHS行,然后它将从您的RECIPE的dir路径进行搜索。