Bitbake: modify a bbappend depending on the image compiled

淺唱寂寞╮ 提交于 2019-12-24 07:37:43

问题


I have two different images which use a lot of common packages. One of them is the wpa-supplicant, which provides a file wpa_supplicant.conf installed by the default recipe. However, I want my own wpa_supplicant.conf to be installed.

I have this solved by having a .bbappend in my layer. But now I only want this append to be applied when I compile one of the images, but not the other.

In short: is there a way to enable/disable a .bbappend depending on the image compiled?

NOTES:

  • I have seen this answer which is similar, but creating a new package that install my file does not work: many packages will try to install the same file and Bitbake returns error.

    • The error here is that I cannot install the same file from two different packages, that's why this is not a duplicate of this question IMO.

Thanks!


回答1:


Well, just as is stated in the answer that you link to, you can't have the image influence any other recipe. The reason is that each recipe is built indepent of which image you're building.

Are the different images intended to be installed onto the same MACHINE? Otherwise you could have different wpa_supplicant.conf for each MACHINE.

For the same MACHINE:

  • Using ROOTFS_POSTPROCESS_COMMAND is one way to solve this
  • Add both wpa_supplicant.conf-files (with differing names) andadd a pkg_post_inst_${PN}(){xxx} script to your wpa-supplicant, that during rootfs-creation time, detects which image is being built, and selects the corretct wpa_supplicant.conf.
  • Another solution is remove wpa_supplicant.conf from the wpa-supplicant package in your bbappend. Create two new packages wpa-supplicant-conf1 and wpa-supplicant-conf2, which just includes the respective wpa_supplicant.conf. Those two should ideally have a

wpa-supplicant-conf1:

RCONFLICTS_${PN} = "wpa-supplicant-conf2" 

and for wpa-supplicant-conf2

RCONFLICTS_${PN} = "wpa-supplicant-conf1"

in their recipes.



来源:https://stackoverflow.com/questions/42295803/bitbake-modify-a-bbappend-depending-on-the-image-compiled

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!