]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmbeddedPkg/Ebl/Dir.c
Change UI for dir of FV to make it less confusing.
[mirror_edk2.git] / EmbeddedPkg / Ebl / Dir.c
index ff1b557ed18a20e2d954e54dda9714f3b9adbd1e..126ef5d7c78ca802e01b8a96a1c821b9bb7a043a 100644 (file)
 \r
 GLOBAL_REMOVE_IF_UNREFERENCED   CHAR8 *gFvFileType[] = {\r
   "All",\r
 \r
 GLOBAL_REMOVE_IF_UNREFERENCED   CHAR8 *gFvFileType[] = {\r
   "All",\r
-  "Raw",\r
-  "Freeform",\r
+  "Bin",\r
+  "section",\r
   "SEC",\r
   "PeiCore",\r
   "DxeCore",\r
   "PEIM",\r
   "Driver",\r
   "SEC",\r
   "PeiCore",\r
   "DxeCore",\r
   "PEIM",\r
   "Driver",\r
-  "Combo Driver",\r
-  "Application",\r
+  "Combo",\r
+  "App",\r
   "NULL",\r
   "FV"\r
 };\r
   "NULL",\r
   "FV"\r
 };\r
@@ -89,6 +89,7 @@ EblDirCmd (
   UINTN                         BestMatchCount;\r
   CHAR16                        UnicodeFileName[MAX_CMD_LINE];\r
   CHAR8                         *Path;\r
   UINTN                         BestMatchCount;\r
   CHAR16                        UnicodeFileName[MAX_CMD_LINE];\r
   CHAR8                         *Path;\r
+  CHAR8                         *TypeStr;\r
 \r
 \r
   if (Argc <= 1) {\r
 \r
 \r
   if (Argc <= 1) {\r
@@ -156,10 +157,10 @@ EblDirCmd (
                                 &Size\r
                                 );\r
       if (!EFI_ERROR (GetNextFileStatus)) {\r
                                 &Size\r
                                 );\r
       if (!EFI_ERROR (GetNextFileStatus)) {\r
-         // Calculate size of entire file\r
-         Section = NULL;\r
-         Size = 0;\r
-         Status = Fv->ReadFile (\r
+        // Calculate size of entire file\r
+        Section = NULL;\r
+        Size = 0;\r
+        Status = Fv->ReadFile (\r
                       Fv,\r
                       &NameGuid, \r
                       Section,\r
                       Fv,\r
                       &NameGuid, \r
                       Section,\r
@@ -168,10 +169,12 @@ EblDirCmd (
                       &Attributes,\r
                       &AuthenticationStatus\r
                       );\r
                       &Attributes,\r
                       &AuthenticationStatus\r
                       );\r
-         if (!((Status == EFI_BUFFER_TOO_SMALL) || !EFI_ERROR (Status))) {\r
-          // EFI_SUCCESS or EFI_BUFFER_TOO_SMALL mean size is valid \r
-          Size = 0;\r
-         }\r
+        if (!((Status == EFI_BUFFER_TOO_SMALL) || !EFI_ERROR (Status))) {\r
+           // EFI_SUCCESS or EFI_BUFFER_TOO_SMALL mean size is valid \r
+            Size = 0;\r
+        }\r
+        \r
+        TypeStr = (Type <= EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE) ? gFvFileType[Type] : "UNKNOWN";\r
 \r
         // read the UI seciton to do a name match.\r
         Section = NULL;\r
 \r
         // read the UI seciton to do a name match.\r
         Section = NULL;\r
@@ -186,7 +189,7 @@ EblDirCmd (
                         );\r
         if (!EFI_ERROR (Status)) {\r
           if (StrStr (Section, MatchSubString) != NULL) {\r
                         );\r
         if (!EFI_ERROR (Status)) {\r
           if (StrStr (Section, MatchSubString) != NULL) {\r
-            AsciiPrint ("  %g %s %a %,d\n", &NameGuid, Section, gFvFileType[Type], Size);\r
+            AsciiPrint ("%,6d %7a %g %s\n", Size, TypeStr, &NameGuid, Section);\r
             if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {\r
               break;\r
             }\r
             if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {\r
               break;\r
             }\r
@@ -194,7 +197,7 @@ EblDirCmd (
           FreePool (Section);\r
         } else {\r
           if (*MatchSubString == '\0') {\r
           FreePool (Section);\r
         } else {\r
           if (*MatchSubString == '\0') {\r
-            AsciiPrint ("  %g %a %,d\n", &NameGuid, gFvFileType[Type], Size);\r
+            AsciiPrint ("%,6d %7a %g\n", Size, TypeStr, &NameGuid);\r
             if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {\r
               break;\r
             }\r
             if (EblAnyKeyToContinueQtoQuit (&CurrentRow, FALSE)) {\r
               break;\r
             }\r