| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  | ## @file | 
					
						
							|  |  |  | # Firmware Management Protocol Device Package | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # This package provides an implementation of a Firmware Management Protocol | 
					
						
							|  |  |  | # instance that supports the update of firmware storage devices using UEFI | 
					
						
							|  |  |  | # Capsules.  The behavior of the Firmware Management Protocol instance is | 
					
						
							|  |  |  | # customized using libraries and PCDs. | 
					
						
							|  |  |  | # | 
					
						
							| 
									
										
										
										
											2020-10-16 04:42:38 +08:00
										 |  |  | # Copyright (c) Microsoft Corporation.<BR> | 
					
						
							| 
									
										
										
										
											2021-03-12 13:23:07 +08:00
										 |  |  | # Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR> | 
					
						
							| 
									
										
										
										
											2020-02-28 15:38:04 +08:00
										 |  |  | # Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> | 
					
						
							| 
									
										
										
										
											2021-10-12 20:30:43 +08:00
										 |  |  | # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR> | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2019-04-03 16:03:48 -07:00
										 |  |  | # SPDX-License-Identifier: BSD-2-Clause-Patent | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  | # | 
					
						
							|  |  |  | ## | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [Defines] | 
					
						
							|  |  |  |   PLATFORM_NAME                  = FmpDevicePkg | 
					
						
							|  |  |  |   PLATFORM_GUID                  = 0af3d540-27c6-11e8-828b-f8597177a00a | 
					
						
							|  |  |  |   PLATFORM_VERSION               = 0.1 | 
					
						
							|  |  |  |   DSC_SPECIFICATION              = 0x00010005 | 
					
						
							|  |  |  |   OUTPUT_DIRECTORY               = Build/FmpDevicePkg | 
					
						
							| 
									
										
										
										
											2025-09-15 07:57:28 -07:00
										 |  |  |   SUPPORTED_ARCHITECTURES        = IA32|X64|AARCH64|RISCV64|LOONGARCH64 | 
					
						
							| 
									
										
										
										
											2018-10-30 15:50:09 +08:00
										 |  |  |   BUILD_TARGETS                  = DEBUG|RELEASE|NOOPT | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  |   SKUID_IDENTIFIER               = DEFAULT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   # | 
					
						
							|  |  |  |   # Define ESRT GUIDs for Firmware Management Protocol instances | 
					
						
							|  |  |  |   # | 
					
						
							| 
									
										
										
										
											2018-07-28 09:11:19 +08:00
										 |  |  |   DEFINE SYSTEM_FMP_ESRT_GUID   = B461B3BD-E62A-4A71-841C-50BA4E500267 | 
					
						
							|  |  |  |   DEFINE DEVICE_FMP_ESRT_GUID   = 226034C4-8B67-4536-8653-D6EE7CE5A316 | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-26 15:45:19 +08:00
										 |  |  |   # | 
					
						
							|  |  |  |   # TRUE  - Build FmpDxe module for with storage access enabled | 
					
						
							|  |  |  |   # FALSE - Build FmpDxe module for with storage access disabled | 
					
						
							|  |  |  |   # | 
					
						
							|  |  |  |   DEFINE DEVICE_FMP_STORAGE_ACCESS_ENABLE = TRUE | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-12 13:27:21 +08:00
										 |  |  | !include UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-12 13:23:07 +08:00
										 |  |  | !include MdePkg/MdeLibs.dsc.inc | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  | [LibraryClasses] | 
					
						
							|  |  |  |   UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf | 
					
						
							|  |  |  |   UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf | 
					
						
							|  |  |  |   UefiLib|MdePkg/Library/UefiLib/UefiLib.inf | 
					
						
							|  |  |  |   UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf | 
					
						
							|  |  |  |   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf | 
					
						
							|  |  |  |   DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf | 
					
						
							|  |  |  |   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf | 
					
						
							|  |  |  |   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf | 
					
						
							|  |  |  |   PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf | 
					
						
							|  |  |  |   DebugLib|MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf | 
					
						
							|  |  |  |   DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf | 
					
						
							|  |  |  |   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf | 
					
						
							| 
									
										
										
										
											2021-10-19 11:11:04 +08:00
										 |  |  |   VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf | 
					
						
							| 
									
										
										
										
											2019-10-28 13:19:46 -07:00
										 |  |  | !ifdef CONTINUOUS_INTEGRATION | 
					
						
							|  |  |  |   BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf | 
					
						
							|  |  |  | !else | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  |   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf | 
					
						
							| 
									
										
										
										
											2019-10-28 13:19:46 -07:00
										 |  |  |   OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  |   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf | 
					
						
							| 
									
										
										
										
											2020-10-16 04:42:38 +08:00
										 |  |  |   RngLib|MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf | 
					
						
							| 
									
										
										
										
											2019-10-28 13:19:46 -07:00
										 |  |  | !endif | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  |   FmpAuthenticationLib|SecurityPkg/Library/FmpAuthenticationLibPkcs7/FmpAuthenticationLibPkcs7.inf | 
					
						
							|  |  |  |   CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf | 
					
						
							|  |  |  |   FmpPayloadHeaderLib|FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf | 
					
						
							|  |  |  |   FmpDeviceLib|FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf | 
					
						
							| 
									
										
										
										
											2020-05-12 13:27:07 +08:00
										 |  |  |   FmpDependencyLib|FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.inf | 
					
						
							| 
									
										
										
										
											2020-05-12 13:27:34 +08:00
										 |  |  |   FmpDependencyCheckLib|FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf | 
					
						
							| 
									
										
										
										
											2020-05-12 16:12:37 +08:00
										 |  |  |   FmpDependencyDeviceLib|FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf | 
					
						
							| 
									
										
										
										
											2019-06-03 20:33:43 +08:00
										 |  |  |   TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-23 15:35:58 -07:00
										 |  |  | # StackCheckLib is not linked for SEC modules by default, this package can link it against its SEC modules | 
					
						
							|  |  |  | [LibraryClasses.common.SEC] | 
					
						
							|  |  |  |   NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-26 15:40:37 +08:00
										 |  |  | [PcdsPatchableInModule] | 
					
						
							|  |  |  |   gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{0} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  | [Components] | 
					
						
							|  |  |  |   # | 
					
						
							|  |  |  |   # Libraries | 
					
						
							|  |  |  |   # | 
					
						
							|  |  |  |   FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf | 
					
						
							| 
									
										
										
										
											2019-08-11 13:36:46 +08:00
										 |  |  |   FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.inf | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  |   FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf | 
					
						
							|  |  |  |   FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf | 
					
						
							| 
									
										
										
										
											2020-05-12 13:27:07 +08:00
										 |  |  |   FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.inf | 
					
						
							| 
									
										
										
										
											2020-05-12 13:27:34 +08:00
										 |  |  |   FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependencyCheckLib.inf | 
					
						
							|  |  |  |   FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf | 
					
						
							| 
									
										
										
										
											2020-05-12 16:12:37 +08:00
										 |  |  |   FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  |   FmpDevicePkg/FmpDxe/FmpDxeLib.inf | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   # | 
					
						
							|  |  |  |   # Modules | 
					
						
							|  |  |  |   # | 
					
						
							| 
									
										
										
										
											2019-08-11 13:36:46 +08:00
										 |  |  |   FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf { | 
					
						
							|  |  |  |     <LibraryClasses> | 
					
						
							|  |  |  |       CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf | 
					
						
							|  |  |  |   } | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  |   FmpDevicePkg/FmpDxe/FmpDxe.inf { | 
					
						
							|  |  |  |     <Defines> | 
					
						
							|  |  |  |       # | 
					
						
							| 
									
										
										
										
											2018-07-28 09:11:19 +08:00
										 |  |  |       # FILE_GUID is used as ESRT GUID | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  |       # | 
					
						
							| 
									
										
										
										
											2018-07-28 09:11:19 +08:00
										 |  |  |       FILE_GUID = $(SYSTEM_FMP_ESRT_GUID) | 
					
						
							| 
									
										
										
										
											2019-07-26 15:40:37 +08:00
										 |  |  |     <PcdsFixedAtBuild> | 
					
						
							|  |  |  |       # | 
					
						
							|  |  |  |       # Unicode name string that is used to populate FMP Image Descriptor for this capsule update module | 
					
						
							|  |  |  |       # | 
					
						
							|  |  |  |       gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device" | 
					
						
							|  |  |  |       # | 
					
						
							|  |  |  |       # Certificates used to authenticate capsule update image | 
					
						
							|  |  |  |       # | 
					
						
							|  |  |  |       !include BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc | 
					
						
							|  |  |  |     <PcdsPatchableInModule> | 
					
						
							|  |  |  |       gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{GUID("$(SYSTEM_FMP_ESRT_GUID)")} | 
					
						
							| 
									
										
										
										
											2019-08-11 13:36:46 +08:00
										 |  |  |     <LibraryClasses> | 
					
						
							|  |  |  |       # | 
					
						
							|  |  |  |       # Use CapsuleUpdatePolicyLib that calls the Capsule Update Policy Protocol. | 
					
						
							|  |  |  |       # Depends on the CapsuleUpdatePolicyDxe module to produce the protocol. | 
					
						
							|  |  |  |       # Required for FmpDxe modules that are intended to be platform independent. | 
					
						
							|  |  |  |       # | 
					
						
							|  |  |  |       CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.inf | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   FmpDevicePkg/FmpDxe/FmpDxe.inf { | 
					
						
							|  |  |  |     <Defines> | 
					
						
							|  |  |  |       # | 
					
						
							|  |  |  |       # FILE_GUID is used as ESRT GUID | 
					
						
							|  |  |  |       # | 
					
						
							| 
									
										
										
										
											2018-07-28 09:11:19 +08:00
										 |  |  |       FILE_GUID = $(DEVICE_FMP_ESRT_GUID) | 
					
						
							| 
									
										
										
										
											2019-07-26 15:45:19 +08:00
										 |  |  |     <PcdsFeatureFlag> | 
					
						
							|  |  |  |       gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable|$(DEVICE_FMP_STORAGE_ACCESS_ENABLE) | 
					
						
							| 
									
										
										
										
											2019-07-26 15:40:37 +08:00
										 |  |  |     <PcdsFixedAtBuild> | 
					
						
							| 
									
										
										
										
											2019-07-26 15:45:19 +08:00
										 |  |  | !if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == FALSE | 
					
						
							|  |  |  |       # | 
					
						
							|  |  |  |       # Disable test key detection | 
					
						
							|  |  |  |       # | 
					
						
							|  |  |  |       gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceTestKeySha256Digest|{0} | 
					
						
							|  |  |  | !endif | 
					
						
							| 
									
										
										
										
											2019-07-26 15:40:37 +08:00
										 |  |  |       # | 
					
						
							|  |  |  |       # Unicode name string that is used to populate FMP Image Descriptor for this capsule update module | 
					
						
							|  |  |  |       # | 
					
						
							| 
									
										
										
										
											2019-07-26 15:45:19 +08:00
										 |  |  | !if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == TRUE | 
					
						
							| 
									
										
										
										
											2019-07-26 15:40:37 +08:00
										 |  |  |       gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device" | 
					
						
							| 
									
										
										
										
											2019-07-26 15:45:19 +08:00
										 |  |  | !else | 
					
						
							|  |  |  |       gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device No Storage Access" | 
					
						
							|  |  |  | !endif | 
					
						
							| 
									
										
										
										
											2019-07-26 15:40:37 +08:00
										 |  |  |       # | 
					
						
							|  |  |  |       # Certificates used to authenticate capsule update image | 
					
						
							|  |  |  |       # | 
					
						
							|  |  |  |       !include BaseTools/Source/Python/Pkcs7Sign/TestRoot.cer.gFmpDevicePkgTokenSpaceGuid.PcdFmpDevicePkcs7CertBufferXdr.inc | 
					
						
							|  |  |  |     <PcdsPatchableInModule> | 
					
						
							|  |  |  |       gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{GUID("$(DEVICE_FMP_ESRT_GUID)")} | 
					
						
							| 
									
										
										
										
											2019-08-11 13:36:46 +08:00
										 |  |  |     <LibraryClasses> | 
					
						
							|  |  |  |       # | 
					
						
							|  |  |  |       # Directly use a platform specific CapsuleUpdatePolicyLib instance. | 
					
						
							|  |  |  |       # Only works for FmpDxe modules that are build from sources and included | 
					
						
							|  |  |  |       # in a system firmware image. | 
					
						
							|  |  |  |       # | 
					
						
							|  |  |  |       CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf | 
					
						
							| 
									
										
										
										
											2018-04-04 10:31:50 -07:00
										 |  |  |   } | 
					
						
							| 
									
										
										
										
											2018-07-25 17:22:10 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-12 13:27:21 +08:00
										 |  |  |   # | 
					
						
							|  |  |  |   # Add UEFI Target Based Unit Tests | 
					
						
							|  |  |  |   # | 
					
						
							|  |  |  |   FmpDevicePkg/Test/UnitTest/Library/FmpDependencyLib/FmpDependencyLibUnitTestsUefi.inf | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 17:22:10 +08:00
										 |  |  | [BuildOptions] | 
					
						
							|  |  |  |   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES |