From 275d78c5f63f37c892649c453cfc6ba00f454c78 Mon Sep 17 00:00:00 2001 From: wuyizhong Date: Fri, 30 Jun 2006 18:02:35 +0000 Subject: [PATCH] Using ModuleType to determine FFS file extension. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@685 6f19259b-4bc3-4df7-8a09-765794883524 --- .../framework/tasks/GenFfsFileTask.java | 64 ++++++++----------- 1 file changed, 27 insertions(+), 37 deletions(-) diff --git a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFfsFileTask.java b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFfsFileTask.java index 575fded67e..ceff3205fe 100644 --- a/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFfsFileTask.java +++ b/Tools/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFfsFileTask.java @@ -58,6 +58,10 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes { /// String baseName = ""; /// + /// + /// + String moduleType; + /// /// module Guid /// String ffsFileGuid = ""; @@ -153,7 +157,7 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes { // Create ffs file. File name = FfsFileGuid + BaseName + ffsSuffix. // If outputDir's value was set, file will output to the outputDir. // - ffsSuffix = TypeToSuffix (this.ffsFileType); + ffsSuffix = TypeToSuffix (this.moduleType); if (!this.outputDir.equals("")) { String temp; outputPath = this.outputDir; @@ -698,43 +702,21 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes { @return The suffix of ffs file **/ private String TypeToSuffix (String ffsFileType){ - if (ffsFileType.equals("EFI_FV_FILETYPE_ALL")) { - return ""; + String[][] suffix = { { "BASE", ".FFS"}, + { "SEC", ".SEC" }, { "PEI_CORE", ".PEI" }, + { "PEIM", ".PEI" }, { "DXE_CORE", ".DXE" }, + { "DXE_DRIVER", ".DXE" }, { "DXE_RUNTIME_DRIVER", ".DXE" }, + { "DXE_SAL_DRIVER", ".DXE" }, { "DXE_SMM_DRIVER", ".DXE" }, + { "TOOL", ".FFS" }, { "UEFI_DRIVER", ".DXE" }, + { "UEFI_APPLICATION", ".APP" }, { "USER_DEFINED", ".FFS" } }; + + for (int i = 0; i < suffix.length; i++) { + if (suffix[i][0].equalsIgnoreCase(moduleType)) { + return suffix[i][1]; + } } - if (ffsFileType.equals("EFI_FV_FILETYPE_RAW")) { - return EFI_FV_FFS_FILETYPE_STR; - } - if (ffsFileType.equals("EFI_FV_FILETYPE_FREEFORM")) { - return EFI_FV_FFS_FILETYPE_STR; - } - if (ffsFileType.equals("EFI_FV_FILETYPE_SECURITY_CORE")) { - return EFI_FV_SEC_FILETYPE_STR; - } - if (ffsFileType.equals("EFI_FV_FILETYPE_PEI_CORE")) { - return EFI_FV_PEI_FILETYPE_STR; - } - if (ffsFileType.equals("EFI_FV_FILETYPE_DXE_CORE")) { - return EFI_FV_DXE_FILETYPE_STR; - } - if (ffsFileType.equals("EFI_FV_FILETYPE_PEIM")) { - return EFI_FV_PEI_FILETYPE_STR; - } - if (ffsFileType.equals("EFI_FV_FILETYPE_DRIVER")) { - return EFI_FV_DXE_FILETYPE_STR; - } - if (ffsFileType.equals("EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER")) { - return EFI_FV_PEI_FILETYPE_STR; - } - if (ffsFileType.equals("EFI_FV_FILETYPE_APPLICATION")) { - return EFI_FV_APP_FILETYPE_STR; - } - if (ffsFileType.equals("EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE")) { - return EFI_FV_FVI_FILETYPE_STR; - } - if (ffsFileType.equals("EFI_FV_FILETYPE_FFS_PAD")) { - return EFI_FV_FFS_FILETYPE_STR; - } - return ""; + + return ".FFS"; } @@ -959,4 +941,12 @@ public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes { public void setOutputDir(String outputDir) { this.outputDir = outputDir; } + + public String getModuleType() { + return this.moduleType; + } + + public void setModuleType(String moduleType) { + this.moduleType = moduleType; + } }