From cf11fae2e4367bd2287b063217321efd10c5f189 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 24 Jan 2012 16:44:35 -0800 Subject: 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 Change-Id: I761bbb3c92a60d4205a217c7b025f699deed83b0 Reviewed-on: https://gerrit.chromium.org/gerrit/14753 Tested-by: Stefan Reinauer Reviewed-by: Duncan Laurie Commit-Ready: Stefan Reinauer Reviewed-by: Vadim Bendebury --- lib/vbexport/boot_device_scsi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') 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, -- cgit v1.2.3