summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2012-01-24 16:44:35 -0800
committerGerrit <chrome-bot@google.com>2012-01-25 15:06:01 -0800
commitcf11fae2e4367bd2287b063217321efd10c5f189 (patch)
tree579a35fb6bf509ee81f573d74b325250a630bfd6 /lib
parentd0076d861920a2aa12ec007b29acca869c7d0cfd (diff)
vbexport: report correct number of scsi drives
Right now our code makes the assumption that there always is one SCSI drive in the system (the AHCI attached SDD). However, this might not be the case. This patch prevents vboot from using an uninitialized disk entry when instead it should go into recovery mode. BUG=chrome-os-partner:7716 TEST=none Signed-off-by: Stefan Reinauer <reinauer@google.com> Change-Id: I761bbb3c92a60d4205a217c7b025f699deed83b0 Reviewed-on: https://gerrit.chromium.org/gerrit/14753 Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Commit-Ready: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/vbexport/boot_device_scsi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/vbexport/boot_device_scsi.c b/lib/vbexport/boot_device_scsi.c
index a70d6262fef..6afbd25dca6 100644
--- a/lib/vbexport/boot_device_scsi.c
+++ b/lib/vbexport/boot_device_scsi.c
@@ -15,8 +15,10 @@
static int boot_device_scsi_start(uint32_t disk_flags)
{
- /* We expect to have at least one SCSI device */
- return 1;
+ /* boot_interface->start() returns the number of
+ * hard drives/boot devices for that interface
+ */
+ return scsi_get_disk_count();
}
static int boot_device_scsi_scan(block_dev_desc_t **desc, int max_devs,