使用bitbake是否可以根据目标映像对软件包使用不同的do_install? [英] Using bitbake is it possible to have a different do_install for a package based on the target image?

查看:394
本文介绍了使用bitbake是否可以根据目标映像对软件包使用不同的do_install?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们只有一台MACHINE,用于构建两个目标图像; foo-image和foobar-image.这两个映像使用相同版本的软件包,但是我们希望根据生成的映像对do_install任务进行更改.这样包装的配方文件看起来像这样:

We have a single MACHINE which we use to build two target images; foo-image and foobar-image. Both images consume the same version of a package, but we would like to add a change to the do_install task based on which image is built. So that the recipe file for the package looks something like this:

do_install (){
    //Some work
}

do_install_append_foobar-image(){
   //Some foobar work
}

最终,当我们为两个图像进行构建时:

Eventually when we do the build for the two images:

MACHINE=custom bitbake foo-image
MACHINE=custom bitbake foobar-image

foobar的映像将包含完成了appends任务中已完成工作的已安装软件包,而foo的映像则不会.

The image for foobar will contain the installed package that has done the work in the appends task, but the image for foo will not.

有什么办法可以做我概述的事情,或者有什么替代方法?

Is there any way to do what I have outlined or what would be an alternative?

推荐答案

经过深思熟虑,我们可能会对此进行反省.我们可能希望在MACHINE级别注入分隔符.由于最终两者将是单独的产品,因此这是最有意义的.通过这种方式,我们可以为特定产品的包装引入更改.

After some deliberation we were probably thinking about this backwards. We probably want to inject separation at the MACHINE level. Since both will be separate products in the end this makes the most sense. Doing it this way will allow us to introduce changes to packages for that specific product.

我们的构建行将变为:

MACHINE=custom1 bitbake foo-image
MACHINE=custom2 bitbake foobar-image

我们的软件包安装任务可以是:

And our install task for the package can be:

do_install (){
    //Some work
}

do_install_append_custom2(){
   //Some more work
}

这篇关于使用bitbake是否可以根据目标映像对软件包使用不同的do_install?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆