diff mbox series

[v7,6/9] efi_loader: add CDROM short-form device path

Message ID 20231016064526.2410856-7-masahisa.kojima@linaro.org
State New
Headers show
Series Add EFI HTTP boot support | expand

Commit Message

Masahisa Kojima Oct. 16, 2023, 6:45 a.m. UTC
UEFI specification does not mandate to support the short-form
of the CDROM media device path.
Fedora installation ISO image is identified as CDROM media
device path, supporting short-form CDROM media device path is
required to automatically add the boot option having default
file of Fedora installation image.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
---
 lib/efi_loader/efi_device_path.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Heinrich Schuchardt Oct. 18, 2023, 10:19 a.m. UTC | #1
On 10/16/23 08:45, Masahisa Kojima wrote:
> UEFI specification does not mandate to support the short-form
> of the CDROM media device path.
> Fedora installation ISO image is identified as CDROM media
> device path, supporting short-form CDROM media device path is
> required to automatically add the boot option having default
> file of Fedora installation image.

How is the CDROM media path created?
Why would the image not be found if the path is not shortened?
What is Fedora specific here?
What does EDK II do?

Best regards

Heinrich

>
> Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> ---
>   lib/efi_loader/efi_device_path.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
> index ed7214f3a3..ac673ab117 100644
> --- a/lib/efi_loader/efi_device_path.c
> +++ b/lib/efi_loader/efi_device_path.c
> @@ -110,7 +110,8 @@ struct efi_device_path *efi_dp_shorten(struct efi_device_path *dp)
>   	while (dp) {
>   		if (EFI_DP_TYPE(dp, MESSAGING_DEVICE, MSG_USB_WWI) ||
>   		    EFI_DP_TYPE(dp, MEDIA_DEVICE, HARD_DRIVE_PATH) ||
> -		    EFI_DP_TYPE(dp, MEDIA_DEVICE, FILE_PATH))
> +		    EFI_DP_TYPE(dp, MEDIA_DEVICE, FILE_PATH) ||
> +		    EFI_DP_TYPE(dp, MEDIA_DEVICE, CDROM_PATH))
>   			return dp;
>
>   		dp = efi_dp_next(dp);
Masahisa Kojima Oct. 19, 2023, 3:21 a.m. UTC | #2
Hi Heinrich,

On Wed, 18 Oct 2023 at 19:25, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> On 10/16/23 08:45, Masahisa Kojima wrote:
> > UEFI specification does not mandate to support the short-form
> > of the CDROM media device path.
> > Fedora installation ISO image is identified as CDROM media
> > device path, supporting short-form CDROM media device path is
> > required to automatically add the boot option having default
> > file of Fedora installation image.
>
> How is the CDROM media path created?

Fedora installation media only has a ISO 9660 filesystem without
MBR/GPT partition table.
U-Boot disk driver classifies it as PART_TYPE_ISO, then EFI-subsystem
creates a CDROM media path for it.

> Why would the image not be found if the path is not shortened?

We discussed in the separate patch that we drop the patch#4(automatically
create the boot option with default application file path appended),
so this patch is also dropped.

> What is Fedora specific here?

Fedora installation media has ISO 9660 filesystem only.
Other disto such as Debian has a MBR partition table, U-Boot creates
HardDisk device path for these medias.

> What does EDK II do?

EDK II does the same for Fedora install image, CDROM media path is created.

Thanks,
Masahisa Kojima

>
> Best regards
>
> Heinrich
>
> >
> > Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
> > ---
> >   lib/efi_loader/efi_device_path.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
> > index ed7214f3a3..ac673ab117 100644
> > --- a/lib/efi_loader/efi_device_path.c
> > +++ b/lib/efi_loader/efi_device_path.c
> > @@ -110,7 +110,8 @@ struct efi_device_path *efi_dp_shorten(struct efi_device_path *dp)
> >       while (dp) {
> >               if (EFI_DP_TYPE(dp, MESSAGING_DEVICE, MSG_USB_WWI) ||
> >                   EFI_DP_TYPE(dp, MEDIA_DEVICE, HARD_DRIVE_PATH) ||
> > -                 EFI_DP_TYPE(dp, MEDIA_DEVICE, FILE_PATH))
> > +                 EFI_DP_TYPE(dp, MEDIA_DEVICE, FILE_PATH) ||
> > +                 EFI_DP_TYPE(dp, MEDIA_DEVICE, CDROM_PATH))
> >                       return dp;
> >
> >               dp = efi_dp_next(dp);
>
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index ed7214f3a3..ac673ab117 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -110,7 +110,8 @@  struct efi_device_path *efi_dp_shorten(struct efi_device_path *dp)
 	while (dp) {
 		if (EFI_DP_TYPE(dp, MESSAGING_DEVICE, MSG_USB_WWI) ||
 		    EFI_DP_TYPE(dp, MEDIA_DEVICE, HARD_DRIVE_PATH) ||
-		    EFI_DP_TYPE(dp, MEDIA_DEVICE, FILE_PATH))
+		    EFI_DP_TYPE(dp, MEDIA_DEVICE, FILE_PATH) ||
+		    EFI_DP_TYPE(dp, MEDIA_DEVICE, CDROM_PATH))
 			return dp;
 
 		dp = efi_dp_next(dp);