From bb5a9925f5bc1055ad3f9cd4f3af83919e8dd6df Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Thu, 6 Oct 2011 13:19:18 +0800 Subject: CHROMIUM: add scsi_write to SCSI driver. Verified boot requires writing to GPT attributes (success / tries), so we need to implement *_write. "scsi write" command is also added to console for testing. BUG=chrome-os-partner:6258 TEST=(1) Modified GPT to trigger VBOOT updating GPT, and verified GPT changed successfully (by firmware) after reboot (2) ext2load usb 1:1 10000000 /part2.bin # load kernel partition dump scsi write 10000000 5000 5000 # write into kernel partition in #2 Change-Id: I8027b6075cdabf8df81ea1ba620ca0dcd3d33232 Signed-off-by: Hung-Te Lin Reviewed-on: http://gerrit.chromium.org/gerrit/8841 Reviewed-by: Vadim Bendebury Reviewed-by: Stefan Reinauer --- lib/vbexport/boot_device.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/vbexport/boot_device.c b/lib/vbexport/boot_device.c index 5392c73e43..8b842e1a0a 100644 --- a/lib/vbexport/boot_device.c +++ b/lib/vbexport/boot_device.c @@ -182,6 +182,11 @@ VbError_t VbExDiskWrite(VbExDiskHandle_t handle, uint64_t lba_start, if (lba_start >= dev->lba || lba_start + lba_count > dev->lba) return VBERROR_DISK_OUT_OF_RANGE; + if (!dev->block_write) { + VBDEBUG(PREFIX "interface (%d) does not support writing.\n", + (int)dev->if_type); + return VBERROR_DISK_WRITE_ERROR; + } if (dev->block_write(dev->dev, lba_start, lba_count, buffer) != lba_count) return VBERROR_DISK_WRITE_ERROR; -- cgit v1.2.3