/** @file\r
EBL commands for EFI and PI Devices\r
\r
- Copyright (c) 2007, Intel Corporation<BR>\r
- Portions copyright (c) 2008-2009, Apple Inc. All rights reserved.\r
+ Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+ Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
\r
- All rights reserved. This program and the accompanying materials\r
+ This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
EfiClose (FsFile);\r
break;\r
}\r
+ EfiClose (FsFile);\r
}\r
- EfiClose (FsFile);\r
}\r
}\r
\r
// Print out useful Block IO media properties\r
- if (File->FsBlockIoMedia.RemovableMedia) {\r
+ if (File->FsBlockIoMedia->RemovableMedia) {\r
AsciiPrint ("Removable ");\r
}\r
- if (!File->FsBlockIoMedia.MediaPresent) {\r
- AsciiPrint ("No Media ");\r
- }\r
- if (File->FsBlockIoMedia.LogicalPartition) {\r
- AsciiPrint ("Partition ");\r
+ if (!File->FsBlockIoMedia->MediaPresent) {\r
+ AsciiPrint ("No Media\n");\r
+ } else {\r
+ if (File->FsBlockIoMedia->LogicalPartition) {\r
+ AsciiPrint ("Partition ");\r
+ }\r
+ DeviceSize = MultU64x32 (File->FsBlockIoMedia->LastBlock + 1, File->FsBlockIoMedia->BlockSize);\r
+ AsciiPrint ("Size = 0x%lX\n", DeviceSize);\r
}\r
- DeviceSize = MultU64x32 (File->FsBlockIoMedia.LastBlock + 1, File->FsBlockIoMedia.BlockSize);\r
- AsciiPrint ("Size = 0x%lX\n", DeviceSize);\r
-\r
EfiClose (File);\r
}\r
\r
UINTN Max;\r
\r
CurrentRow = 0;\r
- \r
+\r
// Need to call here to make sure Device Counts are valid\r
EblUpdateDeviceLists ();\r
\r
+ // Now we can print out the info...\r
Max = EfiGetDeviceCounts (EfiOpenFirmwareVolume);\r
if (Max != 0) {\r
AsciiPrint ("Firmware Volume Devices:\n");\r
UINTN Size;\r
UINTN Offset;\r
UINTN Chunk = FILE_COPY_CHUNK;\r
- \r
+\r
if (Argc < 3) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
Status = EfiRead(Source, Buffer, &Chunk);\r
if (EFI_ERROR(Status)) {\r
- AsciiPrint("Read file error\n");\r
+ AsciiPrint("Read file error %r\n", Status);\r
goto Exit;\r
}\r
\r
Status = EfiWrite(Destination, Buffer, &Chunk);\r
if (EFI_ERROR(Status)) {\r
- AsciiPrint("Write file error\n");\r
+ AsciiPrint("Write file error %r\n", Status);\r
goto Exit;\r
} \r
}\r
\r
Status = EfiRead(Source, Buffer, &Chunk);\r
if (EFI_ERROR(Status)) {\r
- AsciiPrint("Read file error\n");\r
+ AsciiPrint("Read file error %r\n", Status);\r
goto Exit;\r
}\r
\r
Status = EfiWrite(Destination, Buffer, &Chunk);\r
if (EFI_ERROR(Status)) {\r
- AsciiPrint("Write file error\n");\r
+ AsciiPrint("Write file error %r\n", Status);\r
goto Exit;\r
} \r
}\r
\r
+\r
Exit:\r
if (Source != NULL) {\r
Status = EfiClose(Source);\r
AsciiPrint("Source close error %r\n", Status);\r
}\r
}\r
- \r
if (Destination != NULL) {\r
Status = EfiClose(Destination);\r
if (EFI_ERROR(Status)) {\r