diff options
author | Bill Richardson <wfrichar@chromium.org> | 2012-01-25 14:06:24 -0800 |
---|---|---|
committer | Stefan Reinauer <reinauer@chromium.org> | 2012-01-25 15:12:09 -0800 |
commit | bf020a0d4db68897058503767067567565450dde (patch) | |
tree | 2708dc94eb04c8aaa6f14beda2e61aec6742c20b /firmware | |
parent | 5fd35971de5e9fe2a7988519dc8d13ea3af0c0c5 (diff) | |
download | vboot-bf020a0d4db68897058503767067567565450dde.tar.gz |
Make VbTryLoadKernel() go to recovery when no valid disks are found
Previously, it was going to recovery only when no disks existed. That didn't
catch the case where disks exist but none of them are usable.
BUG=chrome-os-partner:7715
TEST=manual
I've added a test specifically for this, so just
make
make runtests
should verify it.
To test on actual hardware, find a disk or USB drive that has something
other than 512 bytes per LBA, and try it. It won't be bootable, but using it
shouldn't hang the system or cause weird behavior.
Once in recovery, press TAB, and you should see the reason code
VBNV_RECOVERY_RW_NO_DISK
Change-Id: I475ddd01e13fa806025a2107c260c030d098a17e
Reviewed-on: https://gerrit.chromium.org/gerrit/14816
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Commit-Ready: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/lib/vboot_api_kernel.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index 8ed22cbf..bcb3d232 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -75,7 +75,9 @@ uint32_t VbTryLoadKernel(VbCommonParams* cparams, LoadKernelParams* p, if (512 != disk_info[i].bytes_per_lba || /* cgptlib restriction */ 32 > disk_info[i].lba_count || /* ditto */ get_info_flags != disk_info[i].flags) { /* got only what we asked for */ - VBDEBUG((" skipping - bogus parameters\n")); + VBDEBUG((" skipping: bytes_per_lba=%Ld lba_count=%Ld flags=0x%x\n", + disk_info[i].bytes_per_lba, disk_info[i].lba_count, + disk_info[i].flags)); continue; } p->disk_handle = disk_info[i].handle; @@ -92,8 +94,11 @@ uint32_t VbTryLoadKernel(VbCommonParams* cparams, LoadKernelParams* p, } /* If we didn't succeed, don't return a disk handle */ - if (VBERROR_SUCCESS != retval) + if (VBERROR_SUCCESS != retval) { + VbSetRecoveryRequest(VBNV_RECOVERY_RW_NO_DISK); + retval = VBERROR_NO_DISK_FOUND; p->disk_handle = NULL; + } VbExDiskFreeInfo(disk_info, p->disk_handle); |