FmpDevicePkg.dsc 8.0 KB

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