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
This commit is contained in:
wuyizhong 2006-06-30 18:02:35 +00:00
parent 626b85a58c
commit 275d78c5f6
1 changed files with 27 additions and 37 deletions

View File

@ -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;
}
}