FmpDevicePkg.dsc 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. ## @file
  2. # Firmware Management Protocol Device Package
  3. #
  4. # This package provides an implementation of a Firmware Management Protocol
  5. # instance that supports the update of firmware storage devices using UEFI
  6. # Capsules. The behavior of the Firmware Management Protocol instance is
  7. # customized using libraries and PCDs.
  8. #
  9. # Copyright (c) Microsoft Corporation.<BR>
  10. # Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
  11. # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
  12. # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>
  13. #
  14. # SPDX-License-Identifier: BSD-2-Clause-Patent
  15. #
  16. ##
  17. [Defines]
  18. PLATFORM_NAME = FmpDevicePkg
  19. PLATFORM_GUID = 0af3d540-27c6-11e8-828b-f8597177a00a
  20. PLATFORM_VERSION = 0.1
  21. DSC_SPECIFICATION = 0x00010005
  22. OUTPUT_DIRECTORY = Build/FmpDevicePkg
  23. SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64|RISCV64|LOONGARCH64
  24. BUILD_TARGETS = DEBUG|RELEASE|NOOPT
  25. SKUID_IDENTIFIER = DEFAULT
  26. #
  27. # Define ESRT GUIDs for Firmware Management Protocol instances
  28. #
  29. DEFINE SYSTEM_FMP_ESRT_GUID = B461B3BD-E62A-4A71-841C-50BA4E500267
  30. DEFINE DEVICE_FMP_ESRT_GUID = 226034C4-8B67-4536-8653-D6EE7CE5A316
  31. #
  32. # TRUE - Build FmpDxe module for with storage access enabled
  33. # FALSE - Build FmpDxe module for with storage access disabled
  34. #
  35. DEFINE DEVICE_FMP_STORAGE_ACCESS_ENABLE = TRUE
  36. !include UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
  37. !include MdePkg/MdeLibs.dsc.inc
  38. [LibraryClasses]
  39. UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
  40. UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
  41. UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
  42. UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
  43. MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
  44. DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
  45. BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
  46. BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
  47. PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
  48. DebugLib|MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
  49. DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
  50. PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
  51. VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
  52. !ifdef CONTINUOUS_INTEGRATION
  53. BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
  54. !else
  55. IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
  56. OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
  57. BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
  58. RngLib|MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf
  59. !endif
  60. FmpAuthenticationLib|SecurityPkg/Library/FmpAuthenticationLibPkcs7/FmpAuthenticationLibPkcs7.inf
  61. CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
  62. FmpPayloadHeaderLib|FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
  63. FmpDeviceLib|FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
  64. FmpDependencyLib|FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.inf
  65. FmpDependencyCheckLib|FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
  66. FmpDependencyDeviceLib|FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
  67. TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
  68. [LibraryClasses.ARM, LibraryClasses.AARCH64]
  69. #
  70. # It is not possible to prevent the ARM compiler for generic intrinsic functions.
  71. # This library provides the intrinsic functions generate by a given compiler.
  72. # [LibraryClasses.ARM, LibraryClasses.AARCH64] and NULL mean link this library
  73. # into all ARM and AARCH64 images.
  74. #
  75. NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
  76. # Add support for stack protector
  77. NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
  78. [LibraryClasses.ARM]
  79. ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
  80. [PcdsPatchableInModule]
  81. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{0}
  82. [Components]
  83. #
  84. # Libraries
  85. #
  86. FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
  87. FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.inf
  88. FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
  89. FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
  90. FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.inf
  91. FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependencyCheckLib.inf
  92. FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
  93. FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
  94. FmpDevicePkg/FmpDxe/FmpDxeLib.inf
  95. #
  96. # Modules
  97. #
  98. FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf {
  99. <LibraryClasses>
  100. CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
  101. }
  102. FmpDevicePkg/FmpDxe/FmpDxe.inf {
  103. <Defines>
  104. #
  105. # FILE_GUID is used as ESRT GUID
  106. #
  107. FILE_GUID = $(SYSTEM_FMP_ESRT_GUID)
  108. <PcdsFixedAtBuild>
  109. #
  110. # Unicode name string that is used to populate FMP Image Descriptor for this capsule update module
  111. #
  112. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device"
  113. #
  114. # Certificates used to authenticate capsule update image
  115. #
  116. !include BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc
  117. <PcdsPatchableInModule>
  118. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{GUID("$(SYSTEM_FMP_ESRT_GUID)")}
  119. <LibraryClasses>
  120. #
  121. # Use CapsuleUpdatePolicyLib that calls the Capsule Update Policy Protocol.
  122. # Depends on the CapsuleUpdatePolicyDxe module to produce the protocol.
  123. # Required for FmpDxe modules that are intended to be platform independent.
  124. #
  125. CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.inf
  126. }
  127. FmpDevicePkg/FmpDxe/FmpDxe.inf {
  128. <Defines>
  129. #
  130. # FILE_GUID is used as ESRT GUID
  131. #
  132. FILE_GUID = $(DEVICE_FMP_ESRT_GUID)
  133. <PcdsFeatureFlag>
  134. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable|$(DEVICE_FMP_STORAGE_ACCESS_ENABLE)
  135. <PcdsFixedAtBuild>
  136. !if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == FALSE
  137. #
  138. # Disable test key detection
  139. #
  140. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceTestKeySha256Digest|{0}
  141. !endif
  142. #
  143. # Unicode name string that is used to populate FMP Image Descriptor for this capsule update module
  144. #
  145. !if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == TRUE
  146. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device"
  147. !else
  148. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device No Storage Access"
  149. !endif
  150. #
  151. # Certificates used to authenticate capsule update image
  152. #
  153. !include BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc
  154. <PcdsPatchableInModule>
  155. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{GUID("$(DEVICE_FMP_ESRT_GUID)")}
  156. <LibraryClasses>
  157. #
  158. # Directly use a platform specific CapsuleUpdatePolicyLib instance.
  159. # Only works for FmpDxe modules that are build from sources and included
  160. # in a system firmware image.
  161. #
  162. CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
  163. }
  164. #
  165. # Add UEFI Target Based Unit Tests
  166. #
  167. FmpDevicePkg/Test/UnitTest/Library/FmpDependencyLib/FmpDependencyLibUnitTestsUefi.inf
  168. [BuildOptions]
  169. *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES