FmpDevicePkg.dsc 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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) 2016, Microsoft Corporation. All rights reserved.<BR>
  10. # Copyright (c) 2018 - 2020, 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. [LibraryClasses]
  37. UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
  38. UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
  39. UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
  40. UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
  41. MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
  42. DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
  43. BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
  44. BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
  45. PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
  46. DebugLib|MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
  47. DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
  48. PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
  49. !ifdef CONTINUOUS_INTEGRATION
  50. BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
  51. !else
  52. IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
  53. OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
  54. BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
  55. !endif
  56. FmpAuthenticationLib|SecurityPkg/Library/FmpAuthenticationLibPkcs7/FmpAuthenticationLibPkcs7.inf
  57. CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
  58. FmpPayloadHeaderLib|FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
  59. FmpDeviceLib|FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
  60. FmpDependencyLib|FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.inf
  61. FmpDependencyCheckLib|FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
  62. FmpDependencyDeviceLib|FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
  63. TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
  64. [LibraryClasses.ARM, LibraryClasses.AARCH64]
  65. #
  66. # It is not possible to prevent the ARM compiler for generic intrinsic functions.
  67. # This library provides the intrinsic functions generate by a given compiler.
  68. # [LibraryClasses.ARM, LibraryClasses.AARCH64] and NULL mean link this library
  69. # into all ARM and AARCH64 images.
  70. #
  71. NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
  72. # Add support for stack protector
  73. NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
  74. [LibraryClasses.ARM]
  75. ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
  76. [PcdsPatchableInModule]
  77. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{0}
  78. [Components]
  79. #
  80. # Libraries
  81. #
  82. FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
  83. FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.inf
  84. FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
  85. FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
  86. FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.inf
  87. FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependencyCheckLib.inf
  88. FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
  89. FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
  90. FmpDevicePkg/FmpDxe/FmpDxeLib.inf
  91. #
  92. # Modules
  93. #
  94. FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf {
  95. <LibraryClasses>
  96. CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
  97. }
  98. FmpDevicePkg/FmpDxe/FmpDxe.inf {
  99. <Defines>
  100. #
  101. # FILE_GUID is used as ESRT GUID
  102. #
  103. FILE_GUID = $(SYSTEM_FMP_ESRT_GUID)
  104. <PcdsFixedAtBuild>
  105. #
  106. # Unicode name string that is used to populate FMP Image Descriptor for this capsule update module
  107. #
  108. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device"
  109. #
  110. # Certificates used to authenticate capsule update image
  111. #
  112. !include BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc
  113. <PcdsPatchableInModule>
  114. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{GUID("$(SYSTEM_FMP_ESRT_GUID)")}
  115. <LibraryClasses>
  116. #
  117. # Use CapsuleUpdatePolicyLib that calls the Capsule Update Policy Protocol.
  118. # Depends on the CapsuleUpdatePolicyDxe module to produce the protocol.
  119. # Required for FmpDxe modules that are intended to be platform independent.
  120. #
  121. CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.inf
  122. }
  123. FmpDevicePkg/FmpDxe/FmpDxe.inf {
  124. <Defines>
  125. #
  126. # FILE_GUID is used as ESRT GUID
  127. #
  128. FILE_GUID = $(DEVICE_FMP_ESRT_GUID)
  129. <PcdsFeatureFlag>
  130. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable|$(DEVICE_FMP_STORAGE_ACCESS_ENABLE)
  131. <PcdsFixedAtBuild>
  132. !if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == FALSE
  133. #
  134. # Disable test key detection
  135. #
  136. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceTestKeySha256Digest|{0}
  137. !endif
  138. #
  139. # Unicode name string that is used to populate FMP Image Descriptor for this capsule update module
  140. #
  141. !if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == TRUE
  142. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device"
  143. !else
  144. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device No Storage Access"
  145. !endif
  146. #
  147. # Certificates used to authenticate capsule update image
  148. #
  149. !include BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc
  150. <PcdsPatchableInModule>
  151. gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{GUID("$(DEVICE_FMP_ESRT_GUID)")}
  152. <LibraryClasses>
  153. #
  154. # Directly use a platform specific CapsuleUpdatePolicyLib instance.
  155. # Only works for FmpDxe modules that are build from sources and included
  156. # in a system firmware image.
  157. #
  158. CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
  159. }
  160. #
  161. # Add UEFI Target Based Unit Tests
  162. #
  163. FmpDevicePkg/Test/UnitTest/Library/FmpDependencyLib/FmpDependencyLibUnitTestsUefi.inf
  164. [BuildOptions]
  165. *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES