diff mbox series

[6/7] efi_loader: disk: compile efi_disk when CONFIG_BLK

Message ID 20220419010158.47034-7-takahiro.akashi@linaro.org
State Accepted
Commit 38f255b96085d2e50558a16256c87ffd885f2f7e
Headers show
Series disk: don't compile in partition support for spl/tpl if not really necessary | expand

Commit Message

AKASHI Takahiro April 19, 2022, 1:01 a.m. UTC
Now we can build efi_loader with block device support (CONFIG_BLK) and
without CONFIG_PARTITIONS.
So change Makefile.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 lib/efi_loader/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Heinrich Schuchardt April 20, 2022, 7:42 a.m. UTC | #1
On 4/19/22 03:01, AKASHI Takahiro wrote:
> Now we can build efi_loader with block device support (CONFIG_BLK) and
> without CONFIG_PARTITIONS.
> So change Makefile.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> ---
>   lib/efi_loader/Makefile | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
> index 034d26cf0109..aaaa25cefe01 100644
> --- a/lib/efi_loader/Makefile
> +++ b/lib/efi_loader/Makefile
> @@ -68,7 +68,7 @@ obj-y += efi_watchdog.o
>   obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
>   obj-$(CONFIG_LCD) += efi_gop.o
>   obj-$(CONFIG_DM_VIDEO) += efi_gop.o
> -obj-$(CONFIG_PARTITIONS) += efi_disk.o
> +obj-$(CONFIG_BLK) += efi_disk.o

Why do we need efi_disk.o if CONFIG_PARTITIONS=n?

How can we be UEFI compliant without partition support?

Best regards

Heinrich

>   obj-$(CONFIG_NET) += efi_net.o
>   obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
>   obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += efi_smbios.o
AKASHI Takahiro April 21, 2022, 12:30 a.m. UTC | #2
On Wed, Apr 20, 2022 at 09:42:00AM +0200, Heinrich Schuchardt wrote:
> On 4/19/22 03:01, AKASHI Takahiro wrote:
> > Now we can build efi_loader with block device support (CONFIG_BLK) and
> > without CONFIG_PARTITIONS.
> > So change Makefile.
> > 
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > ---
> >   lib/efi_loader/Makefile | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
> > index 034d26cf0109..aaaa25cefe01 100644
> > --- a/lib/efi_loader/Makefile
> > +++ b/lib/efi_loader/Makefile
> > @@ -68,7 +68,7 @@ obj-y += efi_watchdog.o
> >   obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
> >   obj-$(CONFIG_LCD) += efi_gop.o
> >   obj-$(CONFIG_DM_VIDEO) += efi_gop.o
> > -obj-$(CONFIG_PARTITIONS) += efi_disk.o
> > +obj-$(CONFIG_BLK) += efi_disk.o
> 
> Why do we need efi_disk.o if CONFIG_PARTITIONS=n?

Why do you think so?
As you admitted in your comment at:
https://lists.denx.de/pipermail/u-boot/2022-April/481546.html

GPT(EFI_PARTITION) is optional under the current implementation
("EFI_LOADER should imply EFI_PARTITION" in your words).
As a matter of fact, EFI_LOADER (and efi_disk.o) can be compiled in
even without any partition table types.

If you don't agree, please drop this patch.
I don't care because it won't help reducing SPL code size anyway.

-Takahiro Akashi

> How can we be UEFI compliant without partition support?
> 
> Best regards
> 
> Heinrich
> 
> >   obj-$(CONFIG_NET) += efi_net.o
> >   obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
> >   obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += efi_smbios.o
>
Heinrich Schuchardt April 23, 2022, 8:08 p.m. UTC | #3
On 4/21/22 02:30, AKASHI Takahiro wrote:
> On Wed, Apr 20, 2022 at 09:42:00AM +0200, Heinrich Schuchardt wrote:
>> On 4/19/22 03:01, AKASHI Takahiro wrote:
>>> Now we can build efi_loader with block device support (CONFIG_BLK) and
>>> without CONFIG_PARTITIONS.
>>> So change Makefile.
>>>
>>> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
>>> ---
>>>    lib/efi_loader/Makefile | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
>>> index 034d26cf0109..aaaa25cefe01 100644
>>> --- a/lib/efi_loader/Makefile
>>> +++ b/lib/efi_loader/Makefile
>>> @@ -68,7 +68,7 @@ obj-y += efi_watchdog.o
>>>    obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
>>>    obj-$(CONFIG_LCD) += efi_gop.o
>>>    obj-$(CONFIG_DM_VIDEO) += efi_gop.o
>>> -obj-$(CONFIG_PARTITIONS) += efi_disk.o
>>> +obj-$(CONFIG_BLK) += efi_disk.o
>>
>> Why do we need efi_disk.o if CONFIG_PARTITIONS=n?
>
> Why do you think so?
> As you admitted in your comment at:
> https://lists.denx.de/pipermail/u-boot/2022-April/481546.html
>
> GPT(EFI_PARTITION) is optional under the current implementation
> ("EFI_LOADER should imply EFI_PARTITION" in your words).
> As a matter of fact, EFI_LOADER (and efi_disk.o) can be compiled in
> even without any partition table types.
>
> If you don't agree, please drop this patch.
> I don't care because it won't help reducing SPL code size anyway.

Without this patch db-88f6720_defconfig does not build after applying
the rest of the series:

arm-linux-gnueabi-ld.bfd: lib/efi_loader/efi_file.o: in function
`efi_file_from_path':
lib/efi_loader/efi_file.c:1095: undefined reference to `efi_fs_from_path'
arm-linux-gnueabi-ld.bfd: lib/efi_loader/efi_var_file.o: in function
`efi_set_blk_dev_to_system_partition':
lib/efi_loader/efi_var_file.c:54: undefined reference to
`efi_system_partition'

Best regards

Heinrich

>
> -Takahiro Akashi
>
>> How can we be UEFI compliant without partition support?
>>
>> Best regards
>>
>> Heinrich
>>
>>>    obj-$(CONFIG_NET) += efi_net.o
>>>    obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
>>>    obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += efi_smbios.o
>>
diff mbox series

Patch

diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
index 034d26cf0109..aaaa25cefe01 100644
--- a/lib/efi_loader/Makefile
+++ b/lib/efi_loader/Makefile
@@ -68,7 +68,7 @@  obj-y += efi_watchdog.o
 obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
 obj-$(CONFIG_LCD) += efi_gop.o
 obj-$(CONFIG_DM_VIDEO) += efi_gop.o
-obj-$(CONFIG_PARTITIONS) += efi_disk.o
+obj-$(CONFIG_BLK) += efi_disk.o
 obj-$(CONFIG_NET) += efi_net.o
 obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
 obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += efi_smbios.o