]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Beatify the debug string for displaying boot device when boot EFI device path.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 31 Aug 2009 07:13:33 +0000 (07:13 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 31 Aug 2009 07:13:33 +0000 (07:13 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9209 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c

index 7c47a873339e006744682aa1cad2ef93c1fb485a..0eb59e89c8f737f2f0d16eeb4e30bde33519f959 100644 (file)
@@ -253,8 +253,69 @@ BdsLibBootViaBootOption (
     Status = SecurityProtocol->FileAuthenticationState (SecurityProtocol, 0, DevicePath);\r
   }\r
 \r
-  DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Booting %S\n", Option->Description));\r
+  DEBUG_CODE_BEGIN();\r
+    UINTN                     DevicePathTypeValue;\r
+    CHAR16                    *HiiString;\r
+    CHAR16                    *BootStringNumber;\r
+    UINTN                     BufferSize;\r
+  \r
+    DevicePathTypeValue = BdsGetBootTypeFromDevicePath (Option->DevicePath);\r
+  \r
+    //\r
+    // store number string of boot option temporary.\r
+    //\r
+    HiiString = NULL;\r
+    switch (DevicePathTypeValue) {\r
+    case BDS_EFI_ACPI_FLOPPY_BOOT:\r
+      HiiString = L"EFI Floppy";\r
+      break;\r
+    case BDS_EFI_MEDIA_CDROM_BOOT:\r
+    case BDS_EFI_MESSAGE_SATA_BOOT:\r
+    case BDS_EFI_MESSAGE_ATAPI_BOOT:\r
+      HiiString = L"EFI DVD/CDROM";\r
+      break;\r
+    case BDS_EFI_MESSAGE_USB_DEVICE_BOOT:\r
+      HiiString = L"EFI USB Device";\r
+      break;\r
+    case BDS_EFI_MESSAGE_SCSI_BOOT:\r
+      HiiString = L"EFI SCSI Device";\r
+      break;\r
+    case BDS_EFI_MESSAGE_MISC_BOOT:\r
+      HiiString = L"EFI Misc Device";\r
+      break;\r
+    case BDS_EFI_MESSAGE_MAC_BOOT:\r
+      HiiString = L"EFI Network";\r
+      break;\r
+    case BBS_DEVICE_PATH:\r
+      //\r
+      // Do nothing for legacy boot option.\r
+      //\r
+      break;\r
+    default:\r
+      DEBUG((EFI_D_INFO, "Can not find HiiString for given device path type 0x%x\n", DevicePathTypeValue));\r
+    }\r
 \r
+    //\r
+    // If found Hii description string then cat Hii string with original description.\r
+    //\r
+    if (HiiString != NULL) {\r
+      BootStringNumber = Option->Description;\r
+      BufferSize = StrSize(BootStringNumber);\r
+      BufferSize += StrSize(HiiString);\r
+      Option->Description = AllocateZeroPool(BufferSize);\r
+      StrCpy (Option->Description, HiiString);\r
+      if (StrnCmp (BootStringNumber, L"0", 1) != 0) {\r
+        StrCat (Option->Description, L" ");\r
+        StrCat (Option->Description, BootStringNumber);\r
+      } \r
+      \r
+      FreePool (BootStringNumber);\r
+    }\r
+  \r
+    DEBUG ((DEBUG_INFO | DEBUG_LOAD, "Booting %S\n", Option->Description));\r
+    \r
+  DEBUG_CODE_END();\r
+  \r
   Status = gBS->LoadImage (\r
                   TRUE,\r
                   mBdsImageHandle,\r