[Buildroot] Using two package mutually exclusive

Nicolas Cavallari Nicolas.Cavallari at green-communications.fr
Thu Jun 16 07:36:37 UTC 2022


On 16/06/2022 08:16, Oscar Gomez Fuente wrote:
> Hi everyone,
> 
> 
> I am having some kind of problems using Config.in in my own packages.
> I have my own directory on: [BUILDROOT_PATH]/packages/my_folder
> 
> And I have two packages: package_a and package_b:
> 
> 1. [BUILDROOT_PATH]/packages/my_folder/package_a
> 2. [BUILDROOT_PATH]/packages/my_folder/package_b
> 
> The Config.in in the package_a is that:
> 
> config BR2_PACKAGE_A
>      bool "a"
>      default n
>      depends on !BR2_PACKAGE_B
> comment "You cannot use the package A because package B is selected"
>      depends on BR2_PACKAGE_B
> 
> And the Config.in in the package_b is like that:
> 
> config BR2_PACKAGE_B
>      bool "b"
>      default n
>      depends on !BR2_PACKAGE_A
> comment "You cannot use the package B because package A is selected"
>      depends on BR2_PACKAGE_A
> 
> Therefore, when package A is selected it shouldn't have to appear the
> package B and viceversa, but it didn't work and I don't know why.
> 
> I realize that if I  select and deselect another different package on
> the same page, it works. It seems to be the screen is not updated.
> 
> Does anyone know why?

You are also probably getting a warning about a circular dependency in the 
console. This is because Kconfig's dependency resolution is fairly limited.

The easiest way to fix it is to add a "depend on !BR_OTHER_PACKAGE" on only one 
package.  This is enough to prevent both from being selected at the same time
and keep Kconfig happy.



More information about the buildroot mailing list