[PATCH 2/9] cmd: Kconfig: Add missing dependency for cmd gpt

Tom Rini trini at konsulko.com
Wed Aug 19 14:25:37 CEST 2020


On Wed, Aug 19, 2020 at 10:51:51AM +0200, Michal Simek wrote:
> On 19. 08. 20 10:46, Heinrich Schuchardt wrote:
> > On 19.08.20 10:44, Michal Simek wrote:
> >> Command gpt select PARTITION_UUIDS which depends on PARTITIONS which is
> >> doesn't need to be enabled.
> >>
> >> Kconfig reports it like this.
> >>
> >> WARNING: unmet direct dependencies detected for PARTITION_UUIDS
> >>   Depends on [n]: PARTITIONS [=n]
> >>   Selected by [y]:
> >>   - CMD_GPT [=y]
> >>
> >> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
> >> ---
> >>
> >>  cmd/Kconfig | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/cmd/Kconfig b/cmd/Kconfig
> >> index 9ad511aa176f..692fae5b8e89 100644
> >> --- a/cmd/Kconfig
> >> +++ b/cmd/Kconfig
> >> @@ -1012,6 +1012,7 @@ config CMD_GPT
> >>  	bool "GPT (GUID Partition Table) command"
> >>  	select EFI_PARTITION
> >>  	select HAVE_BLOCK_DEVICE
> >> +	select PARTITIONS
> >>  	select PARTITION_UUIDS
> > 
> > It would be preferable to use "depends" instead of "select".
> > 
> > You don't want anybody to select this command on a device that does not
> > even have block devices.
> 
> Do we have any doc which is talking about preferred ways?
> 
> If you look at all patches I have used mostly depends on instead of
> select with 2 exception. This patch and then last one 9/9.
> 
> In this case I use select because as you use there is already a lot of
> other selection for EFI, BLOCK_DEVICE and UUIDS.

We don't have a preferred way to solve these problems because it depends
on what the problem even is to start with.  Library type functionality
should be select'd while configurable functionality should be depend'd
on.

In this case, PARTITION_UUIDS enables code in disk/part_dos.c and
disk/part_efi.c to get and store UUID information from the existing
table (and cmd/gpt.c is setting/etc those UUIDs).

So I suspect audit'ing these symbols down further to see what the code
usage of them requires is and going back up to the Kconfig logic is
what's needed here.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200819/a1cd8b2b/attachment.sig>


More information about the U-Boot mailing list