public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] Add UBUNTU boot loader
@ 2017-09-07  2:54 zwei4
  2017-09-07  5:51 ` Gary Lin
  0 siblings, 1 reply; 3+ messages in thread
From: zwei4 @ 2017-09-07  2:54 UTC (permalink / raw)
  To: edk2-devel; +Cc: xianhu2x

From: xianhu2x <xianhuix.liu@intel.com>

Contributed-under: TianoCore Contribution Agreement 1.1

Signed-off-by: xianhu2x <xianhuix.liu@intel.com>
---
 .../Library/GenericBdsLib/BdsBoot.c                | 26 ++++++++++++++++++++++
 Core/MdePkg/Include/Uefi/UefiSpec.h                | 11 ++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c b/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
index d1da635f3..dec5d8cef 100644
--- a/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
+++ b/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
@@ -2384,6 +2384,21 @@ BdsLibBootViaBootOption (
                           0,
                           &ImageHandle
                           );
+          //
+          //Try UBUNTU boot loader
+          //
+          if (EFI_ERROR(Status)) {
+            FilePath = FileDevicePath (Handle, EFI_REMOVABLE_MEDIA_FILE_NAME_UBUNTU);
+            Status = gBS->LoadImage (
+                            TRUE,
+                            gImageHandle,
+                            FilePath,
+                            NULL,
+                            0,
+                            &ImageHandle
+                            );
+          }
+           
         }
       }
     }
@@ -3721,6 +3736,17 @@ BdsLibGetBootableHandle (
                  &DosHeader,
                  Hdr
                  );
+      //
+      //Try UBUNTU boot loader
+      //
+      if (EFI_ERROR(Status)) {
+        Status = BdsLibGetImageHeader (
+                   SimpleFileSystemHandles[Index],
+                   EFI_REMOVABLE_MEDIA_FILE_NAME_UBUNTU,
+                   &DosHeader,
+                   Hdr
+                   );
+      }
       if (!EFI_ERROR (Status) &&
         EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Hdr.Pe32->FileHeader.Machine) &&
         Hdr.Pe32->OptionalHeader.Subsystem == EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION) {
diff --git a/Core/MdePkg/Include/Uefi/UefiSpec.h b/Core/MdePkg/Include/Uefi/UefiSpec.h
index 57cb4e804..e5556952b 100644
--- a/Core/MdePkg/Include/Uefi/UefiSpec.h
+++ b/Core/MdePkg/Include/Uefi/UefiSpec.h
@@ -2166,11 +2166,12 @@ typedef struct {
 //
 // EFI File location to boot from on removable media devices
 //
-#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32    L"\\EFI\\BOOT\\BOOTIA32.EFI"
-#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64    L"\\EFI\\BOOT\\BOOTIA64.EFI"
-#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64     L"\\EFI\\BOOT\\BOOTX64.EFI"
-#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM     L"\\EFI\\BOOT\\BOOTARM.EFI"
-#define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.EFI"
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32       L"\\EFI\\BOOT\\BOOTIA32.EFI"
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64       L"\\EFI\\BOOT\\BOOTIA64.EFI"
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64        L"\\EFI\\BOOT\\BOOTX64.EFI"
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM        L"\\EFI\\BOOT\\BOOTARM.EFI"
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64    L"\\EFI\\BOOT\\BOOTAA64.EFI"
+#define EFI_REMOVABLE_MEDIA_FILE_NAME_UBUNTU_X64 L"\\EFI\\UBUNTU\\GRUBX64.EFI"
 
 #if   defined (MDE_CPU_IA32)
   #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
-- 
2.14.1.windows.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add UBUNTU boot loader
  2017-09-07  2:54 [PATCH] Add UBUNTU boot loader zwei4
@ 2017-09-07  5:51 ` Gary Lin
  2017-09-07  5:54   ` Wei, David
  0 siblings, 1 reply; 3+ messages in thread
From: Gary Lin @ 2017-09-07  5:51 UTC (permalink / raw)
  To: zwei4; +Cc: edk2-devel, xianhu2x

On Thu, Sep 07, 2017 at 10:54:30AM +0800, zwei4 wrote:
> From: xianhu2x <xianhuix.liu@intel.com>
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> 
Is there any reason to add an ubuntu specific boot path? It's not
defined in UEFI spec and the default path to \EFI\BOOT\BOOT<arch>.efi
should be sufficient for a removable device.

Gary Lin

> Signed-off-by: xianhu2x <xianhuix.liu@intel.com>
> ---
>  .../Library/GenericBdsLib/BdsBoot.c                | 26 ++++++++++++++++++++++
>  Core/MdePkg/Include/Uefi/UefiSpec.h                | 11 ++++-----
>  2 files changed, 32 insertions(+), 5 deletions(-)
> 
> diff --git a/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c b/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
> index d1da635f3..dec5d8cef 100644
> --- a/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
> +++ b/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
> @@ -2384,6 +2384,21 @@ BdsLibBootViaBootOption (
>                            0,
>                            &ImageHandle
>                            );
> +          //
> +          //Try UBUNTU boot loader
> +          //
> +          if (EFI_ERROR(Status)) {
> +            FilePath = FileDevicePath (Handle, EFI_REMOVABLE_MEDIA_FILE_NAME_UBUNTU);
> +            Status = gBS->LoadImage (
> +                            TRUE,
> +                            gImageHandle,
> +                            FilePath,
> +                            NULL,
> +                            0,
> +                            &ImageHandle
> +                            );
> +          }
> +           
>          }
>        }
>      }
> @@ -3721,6 +3736,17 @@ BdsLibGetBootableHandle (
>                   &DosHeader,
>                   Hdr
>                   );
> +      //
> +      //Try UBUNTU boot loader
> +      //
> +      if (EFI_ERROR(Status)) {
> +        Status = BdsLibGetImageHeader (
> +                   SimpleFileSystemHandles[Index],
> +                   EFI_REMOVABLE_MEDIA_FILE_NAME_UBUNTU,
> +                   &DosHeader,
> +                   Hdr
> +                   );
> +      }
>        if (!EFI_ERROR (Status) &&
>          EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Hdr.Pe32->FileHeader.Machine) &&
>          Hdr.Pe32->OptionalHeader.Subsystem == EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION) {
> diff --git a/Core/MdePkg/Include/Uefi/UefiSpec.h b/Core/MdePkg/Include/Uefi/UefiSpec.h
> index 57cb4e804..e5556952b 100644
> --- a/Core/MdePkg/Include/Uefi/UefiSpec.h
> +++ b/Core/MdePkg/Include/Uefi/UefiSpec.h
> @@ -2166,11 +2166,12 @@ typedef struct {
>  //
>  // EFI File location to boot from on removable media devices
>  //
> -#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32    L"\\EFI\\BOOT\\BOOTIA32.EFI"
> -#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64    L"\\EFI\\BOOT\\BOOTIA64.EFI"
> -#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64     L"\\EFI\\BOOT\\BOOTX64.EFI"
> -#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM     L"\\EFI\\BOOT\\BOOTARM.EFI"
> -#define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64 L"\\EFI\\BOOT\\BOOTAA64.EFI"
> +#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32       L"\\EFI\\BOOT\\BOOTIA32.EFI"
> +#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64       L"\\EFI\\BOOT\\BOOTIA64.EFI"
> +#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64        L"\\EFI\\BOOT\\BOOTX64.EFI"
> +#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM        L"\\EFI\\BOOT\\BOOTARM.EFI"
> +#define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64    L"\\EFI\\BOOT\\BOOTAA64.EFI"
> +#define EFI_REMOVABLE_MEDIA_FILE_NAME_UBUNTU_X64 L"\\EFI\\UBUNTU\\GRUBX64.EFI"
>  
>  #if   defined (MDE_CPU_IA32)
>    #define EFI_REMOVABLE_MEDIA_FILE_NAME   EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
> -- 
> 2.14.1.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add UBUNTU boot loader
  2017-09-07  5:51 ` Gary Lin
@ 2017-09-07  5:54   ` Wei, David
  0 siblings, 0 replies; 3+ messages in thread
From: Wei, David @ 2017-09-07  5:54 UTC (permalink / raw)
  To: Gary Lin; +Cc: edk2-devel@lists.01.org, Liu, XianhuiX

Please ignore this patch. I sent another one with title [edk2] [PATCH][edk2-platforms] Ubuntu boot

Thanks,
David  Wei                                 


> -----Original Message-----
> From: Gary Lin [mailto:glin@suse.com]
> Sent: Thursday, September 7, 2017 1:52 PM
> To: Wei, David <david.wei@intel.com>
> Cc: edk2-devel@lists.01.org; Liu, XianhuiX <xianhuix.liu@intel.com>
> Subject: Re: [edk2] [PATCH] Add UBUNTU boot loader
> 
> On Thu, Sep 07, 2017 at 10:54:30AM +0800, zwei4 wrote:
> > From: xianhu2x <xianhuix.liu@intel.com>
> >
> > Contributed-under: TianoCore Contribution Agreement 1.1
> >
> Is there any reason to add an ubuntu specific boot path? It's not
> defined in UEFI spec and the default path to \EFI\BOOT\BOOT<arch>.efi
> should be sufficient for a removable device.
> 
> Gary Lin
> 
> > Signed-off-by: xianhu2x <xianhuix.liu@intel.com>
> > ---
> >  .../Library/GenericBdsLib/BdsBoot.c                | 26
> ++++++++++++++++++++++
> >  Core/MdePkg/Include/Uefi/UefiSpec.h                | 11 ++++-----
> >  2 files changed, 32 insertions(+), 5 deletions(-)
> >
> > diff --git
> a/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
> b/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
> > index d1da635f3..dec5d8cef 100644
> > --- a/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
> > +++ b/Core/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
> > @@ -2384,6 +2384,21 @@ BdsLibBootViaBootOption (
> >                            0,
> >                            &ImageHandle
> >                            );
> > +          //
> > +          //Try UBUNTU boot loader
> > +          //
> > +          if (EFI_ERROR(Status)) {
> > +            FilePath = FileDevicePath (Handle,
> EFI_REMOVABLE_MEDIA_FILE_NAME_UBUNTU);
> > +            Status = gBS->LoadImage (
> > +                            TRUE,
> > +                            gImageHandle,
> > +                            FilePath,
> > +                            NULL,
> > +                            0,
> > +                            &ImageHandle
> > +                            );
> > +          }
> > +
> >          }
> >        }
> >      }
> > @@ -3721,6 +3736,17 @@ BdsLibGetBootableHandle (
> >                   &DosHeader,
> >                   Hdr
> >                   );
> > +      //
> > +      //Try UBUNTU boot loader
> > +      //
> > +      if (EFI_ERROR(Status)) {
> > +        Status = BdsLibGetImageHeader (
> > +                   SimpleFileSystemHandles[Index],
> > +                   EFI_REMOVABLE_MEDIA_FILE_NAME_UBUNTU,
> > +                   &DosHeader,
> > +                   Hdr
> > +                   );
> > +      }
> >        if (!EFI_ERROR (Status) &&
> >          EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Hdr.Pe32-
> >FileHeader.Machine) &&
> >          Hdr.Pe32->OptionalHeader.Subsystem ==
> EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION) {
> > diff --git a/Core/MdePkg/Include/Uefi/UefiSpec.h
> b/Core/MdePkg/Include/Uefi/UefiSpec.h
> > index 57cb4e804..e5556952b 100644
> > --- a/Core/MdePkg/Include/Uefi/UefiSpec.h
> > +++ b/Core/MdePkg/Include/Uefi/UefiSpec.h
> > @@ -2166,11 +2166,12 @@ typedef struct {
> >  //
> >  // EFI File location to boot from on removable media devices
> >  //
> > -#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
> L"\\EFI\\BOOT\\BOOTIA32.EFI"
> > -#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64
> L"\\EFI\\BOOT\\BOOTIA64.EFI"
> > -#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64
> L"\\EFI\\BOOT\\BOOTX64.EFI"
> > -#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM
> L"\\EFI\\BOOT\\BOOTARM.EFI"
> > -#define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
> L"\\EFI\\BOOT\\BOOTAA64.EFI"
> > +#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
> L"\\EFI\\BOOT\\BOOTIA32.EFI"
> > +#define EFI_REMOVABLE_MEDIA_FILE_NAME_IA64
> L"\\EFI\\BOOT\\BOOTIA64.EFI"
> > +#define EFI_REMOVABLE_MEDIA_FILE_NAME_X64
> L"\\EFI\\BOOT\\BOOTX64.EFI"
> > +#define EFI_REMOVABLE_MEDIA_FILE_NAME_ARM
> L"\\EFI\\BOOT\\BOOTARM.EFI"
> > +#define EFI_REMOVABLE_MEDIA_FILE_NAME_AARCH64
> L"\\EFI\\BOOT\\BOOTAA64.EFI"
> > +#define EFI_REMOVABLE_MEDIA_FILE_NAME_UBUNTU_X64
> L"\\EFI\\UBUNTU\\GRUBX64.EFI"
> >
> >  #if   defined (MDE_CPU_IA32)
> >    #define EFI_REMOVABLE_MEDIA_FILE_NAME
> EFI_REMOVABLE_MEDIA_FILE_NAME_IA32
> > --
> > 2.14.1.windows.1
> >
> > _______________________________________________
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> >


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-07  5:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-07  2:54 [PATCH] Add UBUNTU boot loader zwei4
2017-09-07  5:51 ` Gary Lin
2017-09-07  5:54   ` Wei, David

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox