Enhance error message print for OsLoader

This patch added some additional error message print during the
boot media initializtion and file loading. It makes it easier to
identify issues in case of failure.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This commit is contained in:
Maurice Ma 2019-04-19 10:20:37 -07:00
parent 0d8fad8bbc
commit 3c8f71a16c
1 changed files with 8 additions and 7 deletions

View File

@ -52,14 +52,14 @@ FindBootPartition (
//
Status = MediaSetInterfaceType (BootOption->DevType);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Invalid Boot device configured\n"));
DEBUG ((DEBUG_ERROR, "Failed to set media interface - %r\n", Status));
return RETURN_UNSUPPORTED;
}
DEBUG ((DEBUG_INFO, "Getting boot image from... %a\n", GetBootDeviceNameString(BootOption->DevType)));
DEBUG ((DEBUG_INFO, "Getting boot image from %a\n", GetBootDeviceNameString(BootOption->DevType)));
Status = MediaInitialize (BootMediumPciBase, DevInitAll);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Failed to init media - %r\n", Status));
return Status;
}
@ -70,6 +70,7 @@ FindBootPartition (
DEBUG ((DEBUG_INFO, "Try to find boot partition\n"));
Status = FindPartitions (BootOption->HwPart, HwPartHandle);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "Failed to find partition - %r\n", Status));
return Status;
}
AddMeasurePoint (0x4060);
@ -295,7 +296,7 @@ LoadLinuxFile (
}
Ptr[FileInfo->Len] = 0;
AsciiStrToUnicodeStrS (Ptr, FileName, sizeof(FileName) / sizeof(CHAR16));
AsciiStrToUnicodeStrS (Ptr, FileName, sizeof(FileName) / sizeof(CHAR16));
FileSize = 0;
FileBuffer = NULL;
Status = GetFileByName (FsHandle, FileName, &FileBuffer, &FileSize);
@ -373,13 +374,13 @@ GetTraditionalLinux (
MenuEntry = LinuxBootCfg.MenuEntry;
MenuEntry[0].Name.Pos = 0;
MenuEntry[0].Name.Len = 5;
AsciiStrCpyS (MenuEntry[0].Name.Buf, sizeof(MenuEntry[0].Name.Buf), "Linux");
AsciiStrCpyS (MenuEntry[0].Name.Buf, sizeof(MenuEntry[0].Name.Buf), "Linux");
MenuEntry[0].InitRd.Pos = 0;
MenuEntry[0].InitRd.Len = 6;
AsciiStrCpyS (MenuEntry[0].InitRd.Buf, sizeof(MenuEntry[0].InitRd.Buf), "initrd");
AsciiStrCpyS (MenuEntry[0].InitRd.Buf, sizeof(MenuEntry[0].InitRd.Buf), "initrd");
MenuEntry[0].Kernel.Pos = 0;
MenuEntry[0].Kernel.Len = 7;
AsciiStrCpyS (MenuEntry[0].Kernel.Buf, sizeof(MenuEntry[0].Kernel.Buf), "vmlinuz");
AsciiStrCpyS (MenuEntry[0].Kernel.Buf, sizeof(MenuEntry[0].Kernel.Buf), "vmlinuz");
MenuEntry[0].Command.Pos = 0;
MenuEntry[0].Command.Len = ConfigFileSize;
EntryIdx = 0;