public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: "Liu, Zhiguang" <zhiguang.liu@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Justen, Jordan L" <jordan.l.justen@intel.com>,
	Andrew Fish <afish@apple.com>
Subject: Re: [PATCH 1/2] EmulatorPkg: Make the shell be the first boot option
Date: Sun, 5 May 2019 03:23:32 +0000	[thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C125F06@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20190429052443.2908-2-zhiguang.liu@intel.com>

Please run ecc to make sure your coding style is proper.

> -----Original Message-----
> From: Liu, Zhiguang <zhiguang.liu@intel.com>
> Sent: Monday, April 29, 2019 1:25 PM
> To: devel@edk2.groups.io
> Cc: Justen, Jordan L <jordan.l.justen@intel.com>; Andrew Fish
> <afish@apple.com>; Ni, Ray <ray.ni@intel.com>
> Subject: [PATCH 1/2] EmulatorPkg: Make the shell be the first boot option
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1649
> 
> Make the shell be the first boot option by default,
> So it can boot into UEFI Internal Shell directly,
> when run the emulator if user don't change boot order.
> 
> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
> 
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Ray Ni <ray.ni@intel.com>
> ---
>  EmulatorPkg/Library/PlatformBmLib/PlatformBm.c | 31
> ++++++++++++++++++++++++++++++-
>  1 file changed, 30 insertions(+), 1 deletion(-)
> 
> diff --git a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.c
> b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.c
> index 2a97e385be..459ac5c4b5 100644
> --- a/EmulatorPkg/Library/PlatformBmLib/PlatformBm.c
> +++ b/EmulatorPkg/Library/PlatformBmLib/PlatformBm.c
> @@ -388,6 +388,34 @@ PlatformBootManagerChangeDevicePath (
>      }
>    }
>  }
> +/**
> +  Returns the priority number.
> +
> +  @param BootOption
> +**/
> +UINTN
> +BootOptionPriority (
> +  CONST EFI_BOOT_MANAGER_LOAD_OPTION *BootOption
> +  )
> +{
> +  //
> +  // Make sure Shell is first
> +  //
> +  if (StrCmp (BootOption->Description, L"UEFI Shell") == 0) {
> +    return 0;
> +  }
> +  return 100;
> +}
> +
> +INTN
> +EFIAPI
> +CompareBootOption (
> +  CONST EFI_BOOT_MANAGER_LOAD_OPTION  *Left,
> +  CONST EFI_BOOT_MANAGER_LOAD_OPTION  *Right
> +  )
> +{
> +  return BootOptionPriority (Left) - BootOptionPriority (Right);
> +}
> 
>  /**
>    Do the platform specific action after the console is connected.
> @@ -432,9 +460,10 @@ PlatformBootManagerAfterConsole (
>    default:
>      PlatformBdsDiagnostics (IGNORE, TRUE);
>      PlatformBootManagerChangeDevicePath(&FirstBoot);
> -    PlatformBdsRegisterStaticBootOptions ();
>      PlatformBdsConnectSequence ();
>      EfiBootManagerRefreshAllBootOption ();
> +    PlatformBdsRegisterStaticBootOptions ();
> +    if(FirstBoot)EfiBootManagerSortLoadOptionVariable
> (LoadOptionTypeBoot, (SORT_COMPARE) CompareBootOption);
>      break;
>    }
>  }
> --
> 2.21.0.windows.1


  reply	other threads:[~2019-05-05  3:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29  5:24 [PATCH 0/2] fix boot order bugs Zhiguang Liu
2019-04-29  5:24 ` [PATCH 1/2] EmulatorPkg: Make the shell be the first boot option Zhiguang Liu
2019-05-05  3:23   ` Ni, Ray [this message]
2019-04-29  5:24 ` [PATCH 2/2] EmulatorPkg: Save the modified order after rebooting Zhiguang Liu
2019-05-05  3:22   ` [edk2-devel] " Ni, Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=734D49CCEBEEF84792F5B80ED585239D5C125F06@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox