|
2 | 2 | # Redfish JSON resource to C structure converter source code generator.
|
3 | 3 | #
|
4 | 4 | # Copyright Notice:
|
5 |
| -# Copyright 2021-2022 DMTF. All rights reserved. |
| 5 | +# Copyright 2021-2024 DMTF. All rights reserved. |
6 | 6 | # License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-Tacklebox/blob/main/LICENSE.md
|
7 | 7 | #
|
8 | 8 | import os
|
@@ -109,7 +109,8 @@ def __init__ (self, RedfishCSInstance, SchemaFileInstance, RedfishCSStructList,
|
109 | 109 | self.Edk2RedfishIntpTempDxeInf = ""
|
110 | 110 | self.Edk2RedfishIntpTempInclude = ""
|
111 | 111 | self.Edk2RedfishIntpComponentDsc = ""
|
112 |
| - self.Edk2RedfishIntpLibDsc = "" |
| 112 | + self.Edk2RedfishIntpLibDsc = "" |
| 113 | + self.Edk2RedfishIntpFdf = "" |
113 | 114 | self.Edk2RedfishintpKeywordsDict = {}
|
114 | 115 | self.Edk2CStructureName = ""
|
115 | 116 |
|
@@ -292,6 +293,7 @@ def GenEdk2RedfishIntpFile(self):
|
292 | 293 |
|
293 | 294 | self.Edk2RedfishIntpComponentDsc = "RedfishSchemaCsInterpreter_Component.dsc"
|
294 | 295 | self.Edk2RedfishIntpLibDsc = "RedfishSchemaCsInterpreter_Lib.dsc"
|
| 296 | + self.Edk2RedfishIntpFdf = "RedfishSchemaCsInterpreter_Component.fdf" |
295 | 297 |
|
296 | 298 | self.Edk2RedfishIntpTempDxeC = self.Edk2RedfishIntpTempFilesDir + os.path.normpath("/RedfishCsDxe.temp")
|
297 | 299 | self.Edk2RedfishIntpTempDxeInf = self.Edk2RedfishIntpTempFilesDir + os.path.normpath("/RedfishCsInf.temp")
|
@@ -356,28 +358,50 @@ def GenEdk2RedfishIntpFile(self):
|
356 | 358 | if not os.path.exists (self.Edk2RedfishIntpOutputDir + os.path.normpath("/" + self.Edk2RedfishIntpLibDsc)):
|
357 | 359 | fo = open(self.Edk2RedfishIntpOutputDir + os.path.normpath("/" + self.Edk2RedfishIntpLibDsc),"w")
|
358 | 360 | fo.close()
|
359 |
| - |
| 361 | + if not os.path.exists (self.Edk2RedfishIntpOutputDir + os.path.normpath("/" + self.Edk2RedfishIntpFdf)): |
| 362 | + fo = open(self.Edk2RedfishIntpOutputDir + os.path.normpath("/" + self.Edk2RedfishIntpFdf),"w") |
| 363 | + fo.close() |
| 364 | + |
| 365 | + # |
| 366 | + # edk2 driver DSC |
| 367 | + # |
360 | 368 | fo = open(self.Edk2RedfishIntpOutputDir + os.path.normpath("/" + self.Edk2RedfishIntpComponentDsc),"a")
|
361 | 369 | if SchemaVersion == "":
|
362 |
| - fo.write("!if $(REDFISH_" + RedfishCs.ResourceType.upper() + ") OR $(REDFISH_CLIENT_ALL_AUTOGENED)\n") |
| 370 | + fo.write("!if ($(REDFISH_" + RedfishCs.ResourceType.upper() + ") == TRUE) OR ($(REDFISH_CLIENT_ALL_AUTOGENED) == TRUE)\n") |
363 | 371 | fo.write(" " + self.Edk2RedfishJsonCsPackagePath + "RedfishClientPkg/Converter/" + RedfishCs.ResourceType + "/" + RedfishCsSchemaDxe_INF_File + "\n")
|
364 | 372 | fo.write("!endif\n")
|
365 | 373 | else:
|
366 |
| - fo.write("!if $(REDFISH_" + RedfishCs.ResourceType.upper() + "_" + SchemaVersion.upper() + ") OR $(REDFISH_CLIENT_ALL_AUTOGENED)\n") |
| 374 | + fo.write("!if ($(REDFISH_" + RedfishCs.ResourceType.upper() + "_" + SchemaVersion.upper() + ") == TRUE) OR ($(REDFISH_CLIENT_ALL_AUTOGENED) == TRUE)\n") |
367 | 375 | fo.write(" " + self.Edk2RedfishJsonCsPackagePath + "RedfishClientPkg/Converter/" + RedfishCs.ResourceType + "/" + SchemaVersion + "/" + RedfishCsSchemaDxe_INF_File + "\n")
|
368 |
| - fo.write("!endif\n") |
| 376 | + fo.write("!endif\n") |
369 | 377 | fo.close()
|
370 | 378 |
|
| 379 | + # |
| 380 | + # edk2 library DSC |
| 381 | + # |
371 | 382 | fo = open(self.Edk2RedfishIntpOutputDir + os.path.normpath("/" + self.Edk2RedfishIntpLibDsc),"a")
|
372 | 383 | if SchemaVersion == "":
|
373 |
| - fo.write("!if $(REDFISH_" + RedfishCs.ResourceType.upper() + ") OR $(REDFISH_CLIENT_ALL_AUTOGENED)\n") |
| 384 | + fo.write("!if ($(REDFISH_" + RedfishCs.ResourceType.upper() + ") == TRUE) OR ($(REDFISH_CLIENT_ALL_AUTOGENED) == TRUE)\n") |
374 | 385 | fo.write(" " + self.LibClass + "|" + self.Edk2RedfishJsonCsPackagePath + "RedfishClientPkg/ConverterLib" + Edk2BindingDir + "/" + RedfishCs.ResourceType + "/Lib.inf" + "\n")
|
375 | 386 | fo.write("!endif\n")
|
376 | 387 | else:
|
377 |
| - fo.write("!if $(REDFISH_" + RedfishCs.ResourceType.upper() + "_" + SchemaVersion.upper() + ") OR $(REDFISH_CLIENT_ALL_AUTOGENED)\n") |
| 388 | + fo.write("!if ($(REDFISH_" + RedfishCs.ResourceType.upper() + "_" + SchemaVersion.upper() + ") == TRUE) OR ($(REDFISH_CLIENT_ALL_AUTOGENED) == TRUE)\n") |
378 | 389 | fo.write(" " + self.LibClass + "|" + self.Edk2RedfishJsonCsPackagePath + "RedfishClientPkg/ConverterLib" + Edk2BindingDir + "/" + RedfishCs.ResourceType + "/" + SchemaVersion + "/Lib.inf" + "\n")
|
379 |
| - fo.write("!endif\n") |
380 |
| - fo.close() |
| 390 | + fo.write("!endif\n") |
| 391 | + fo.close() |
| 392 | + # |
| 393 | + # edk2 driver FDF |
| 394 | + # |
| 395 | + fo = open(self.Edk2RedfishIntpOutputDir + os.path.normpath("/" + self.Edk2RedfishIntpFdf),"a") |
| 396 | + if SchemaVersion == "": |
| 397 | + fo.write("!if ($(REDFISH_" + RedfishCs.ResourceType.upper() + ") == TRUE) OR ($(REDFISH_CLIENT_ALL_AUTOGENED) == TRUE)\n") |
| 398 | + fo.write(" INF " + self.Edk2RedfishJsonCsPackagePath + "RedfishClientPkg/Converter/" + RedfishCs.ResourceType + "/" + RedfishCsSchemaDxe_INF_File + "\n") |
| 399 | + fo.write("!endif\n") |
| 400 | + else: |
| 401 | + fo.write("!if ($(REDFISH_" + RedfishCs.ResourceType.upper() + "_" + SchemaVersion.upper() + ") == TRUE) OR ($(REDFISH_CLIENT_ALL_AUTOGENED) == TRUE)\n") |
| 402 | + fo.write(" INF " + self.Edk2RedfishJsonCsPackagePath + "RedfishClientPkg/Converter/" + RedfishCs.ResourceType + "/" + SchemaVersion + "/" + RedfishCsSchemaDxe_INF_File + "\n") |
| 403 | + fo.write("!endif\n") |
| 404 | + fo.close() |
381 | 405 |
|
382 | 406 | fo = open(os.path.normpath(RedfishCsInterpreter_Source_Schema_dir + "/" + RedfishCsSchemaDxe_C_File),"w")
|
383 | 407 | Edk2RedfishIntpTempDxeCLines = self.Replacekeyworkds(Edk2RedfishIntpTempDxeCLines)
|
|
0 commit comments