Make LoadKernel() pass back the kernel partition's UniqueGuid.

LoadKernel already returns the partition number for the selected kernel.
This change makes it also return the GPT Entry's UniqueGuid, which will
eventually be passed to the kernel itself, so the kernel can determine which
of several possible devices it has booted from. It doesn't know for certain
because the BIOS and the kernel may enumerate the devices in a different
order.

BUG=chromium-os:4984

Review URL: http://codereview.chromium.org/3056014
This commit is contained in:
Bill Richardson
2010-07-23 17:22:25 -07:00
parent e272940ec5
commit 5deb67f225
6 changed files with 33 additions and 3 deletions

View File

@@ -10,12 +10,12 @@
#include "boot_device.h"
#include "cgptlib.h"
#include "cgptlib_internal.h"
#include "load_kernel_fw.h"
#include "rollback_index.h"
#include "utility.h"
#include "vboot_common.h"
#define KBUF_SIZE 65536 /* Bytes to read at start of kernel partition */
@@ -131,7 +131,6 @@ int LoadKernel(LoadKernelParams* params) {
/* Sanity Checks */
if (!params ||
!params->header_sign_key_blob ||
!params->bytes_per_lba ||
!params->ending_lba ||
!params->kernel_buffer ||
@@ -350,6 +349,7 @@ int LoadKernel(LoadKernelParams* params) {
* Adjust here, until cgptlib is fixed. */
good_partition = gpt.current_kernel + 1;
params->partition_number = gpt.current_kernel + 1;
GetCurrentKernelUniqueGuid(&gpt, &params->partition_guid);
params->bootloader_address = preamble->bootloader_address;
params->bootloader_size = preamble->bootloader_size;
/* If we're in developer or recovery mode, there's no rollback