简体   繁体   English

使用 yocto/bitbake 时,在不同配方生成的目录中安装文件而不会发生冲突的正确方法是什么?

[英]When using yocto/bitbake, what's a correct way to install files in directories generated by a different recipe without conflicts?

In my system quite a few recipes are set to use monit and so need to install files in the /etc/monit.d directory - doing that by having在我的系统中,相当多的配方设置为使用 monit,因此需要在/etc/monit.d目录中安装文件 - 通过使用

install -d ${D}${sysconfdir}/monit.d
install -m 0644 ${WORKDIR}/file_to_install.monit ${D}${sysconfdir}/monit.d/file_to_install.monit

in their do_install() .在他们的do_install()中。 This however makes bitbake complain that " file /etc/monit.d conflicts between attempted installs of " my recipe and monit.然而,这使得 bitbake 抱怨“ file /etc/monit.d conflicts between attempted installs of ”我的食谱和 monit 之间发生冲突。

Monit is already set as a dependency of my recipe so I'd imagine that it would be taken as the one with higher priority, but it doesn't. Monit 已经被设置为我的食谱的依赖项,所以我想它会被视为具有更高优先级的那个,但事实并非如此。 What is the correct way to do this then?那么正确的方法是什么?

The problem is due to different permissions of those folders.问题是由于这些文件夹的权限不同。 The monit_5.2 recipe uses permissions set to 700. Default install permissions when not using -m is 755 monit_5.2 配方使用权限设置为 700。不使用 -m 时的默认安装权限为 755

install -m 700 -d ${D}${sysconfdir}/monit.d
install -m 0644 ${WORKDIR}/file_to_install.monit ${D}${sysconfdir}/monit.d/file_to_install.monit

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM