mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
Add kernel tests
BUG=chromium-os:38139 BRANCH=none TEST=make runtests Change-Id: Iee7c965d5c29063259c66d0ccb117c60f4f4a92e Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42314
This commit is contained in:
committed by
ChromeBot
parent
c3d488d155
commit
49cb0d3471
@@ -157,8 +157,7 @@ VbError_t LoadKernel(LoadKernelParams* params) {
|
||||
int recovery = VBNV_RECOVERY_LK_UNSPECIFIED;
|
||||
|
||||
/* Sanity Checks */
|
||||
if (!params ||
|
||||
!params->bytes_per_lba ||
|
||||
if (!params->bytes_per_lba ||
|
||||
!params->ending_lba) {
|
||||
VBDEBUG(("LoadKernel() called with invalid params\n"));
|
||||
retval = VBERROR_INVALID_PARAMETER;
|
||||
@@ -210,27 +209,26 @@ VbError_t LoadKernel(LoadKernelParams* params) {
|
||||
kernel_subkey = &shared->kernel_subkey;
|
||||
}
|
||||
|
||||
do {
|
||||
/* Read GPT data */
|
||||
gpt.sector_bytes = (uint32_t)blba;
|
||||
gpt.drive_sectors = params->ending_lba + 1;
|
||||
if (0 != AllocAndReadGptData(params->disk_handle, &gpt)) {
|
||||
VBDEBUG(("Unable to read GPT data\n"));
|
||||
shcall->check_result = VBSD_LKC_CHECK_GPT_READ_ERROR;
|
||||
break;
|
||||
goto bad_gpt;
|
||||
}
|
||||
|
||||
/* Initialize GPT library */
|
||||
if (GPT_SUCCESS != GptInit(&gpt)) {
|
||||
VBDEBUG(("Error parsing GPT\n"));
|
||||
shcall->check_result = VBSD_LKC_CHECK_GPT_PARSE_ERROR;
|
||||
break;
|
||||
goto bad_gpt;
|
||||
}
|
||||
|
||||
/* Allocate kernel header buffers */
|
||||
kbuf = (uint8_t*)VbExMalloc(KBUF_SIZE);
|
||||
if (!kbuf)
|
||||
break;
|
||||
goto bad_gpt;
|
||||
|
||||
/* Loop over candidate kernel partitions */
|
||||
while (GPT_SUCCESS == GptNextKernelEntry(&gpt, &part_start, &part_size)) {
|
||||
@@ -516,7 +514,8 @@ VbError_t LoadKernel(LoadKernelParams* params) {
|
||||
|
||||
|
||||
} /* while(GptNextKernelEntry) */
|
||||
} while(0);
|
||||
|
||||
bad_gpt:
|
||||
|
||||
/* Free kernel buffer */
|
||||
if (kbuf)
|
||||
|
||||
Reference in New Issue
Block a user