Adding gptpriority grub command

gptpriority grub command takes diskname, partition number
and environment variable(optional) as its arguments and returns the
priority the of the specified partition in the given disk. If
environment variable is given, the result value is exported to it.
Decription and usage of the command can be obtained with
"gptpriority --help" in grub shell.

During image_to_live rebooting, system always booted to default image instead
of booting newly installed image. This command is needed to obtain the
highest priority parition in the disk(updated by image_to_live for new image)
and boot the image from that parition. Note: This changes are for UEFI boot.

BUG=None
TEST=Built the changes with chromeOS image and checked the usage of
     gptpriority command in grub shell. And also the results of this
     command is used in grub.cfg to update the "default" value and
     verified the selection of the image to boot based on that default
     value.

Change-Id: I0175a5d22099bfb4387bb2d2e2a0810d23f126b4
Reviewed-on: https://gerrit.chromium.org/gerrit/58274
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Sathish Kuppuswamy <sathish.kuppuswamy@intel.com>
Tested-by: Sathish Kuppuswamy <sathish.kuppuswamy@intel.com>
2 files changed