问题
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 apkg_post_inst_${PN}(){xxx}
script to yourwpa-supplicant
, that during rootfs-creation time, detects which image is being built, and selects the corretctwpa_supplicant.conf
. - Another solution is remove
wpa_supplicant.conf
from thewpa-supplicant
package in your bbappend. Create two new packageswpa-supplicant-conf1
andwpa-supplicant-conf2
, which just includes the respectivewpa_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