2018-04-04 19:31:50 +02: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-15 22:42:38 +02:00
|
|
|
# Copyright (c) Microsoft Corporation.<BR>
|
2021-03-12 06:23:07 +01:00
|
|
|
# Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
|
2020-02-28 08:38:04 +01:00
|
|
|
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
|
2021-10-12 14:30:43 +02:00
|
|
|
# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.<BR>
|
2018-04-04 19:31:50 +02:00
|
|
|
#
|
2019-04-04 01:03:48 +02:00
|
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
2018-04-04 19:31:50 +02:00
|
|
|
#
|
|
|
|
##
|
|
|
|
|
|
|
|
[Defines]
|
|
|
|
PLATFORM_NAME = FmpDevicePkg
|
|
|
|
PLATFORM_GUID = 0af3d540-27c6-11e8-828b-f8597177a00a
|
|
|
|
PLATFORM_VERSION = 0.1
|
|
|
|
DSC_SPECIFICATION = 0x00010005
|
|
|
|
OUTPUT_DIRECTORY = Build/FmpDevicePkg
|
2021-10-12 14:30:43 +02:00
|
|
|
SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64|RISCV64|LOONGARCH64
|
2018-10-30 08:50:09 +01:00
|
|
|
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
|
2018-04-04 19:31:50 +02:00
|
|
|
SKUID_IDENTIFIER = DEFAULT
|
|
|
|
|
|
|
|
#
|
|
|
|
# Define ESRT GUIDs for Firmware Management Protocol instances
|
|
|
|
#
|
2018-07-28 03:11:19 +02:00
|
|
|
DEFINE SYSTEM_FMP_ESRT_GUID = B461B3BD-E62A-4A71-841C-50BA4E500267
|
|
|
|
DEFINE DEVICE_FMP_ESRT_GUID = 226034C4-8B67-4536-8653-D6EE7CE5A316
|
2018-04-04 19:31:50 +02:00
|
|
|
|
2019-07-26 09:45:19 +02: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 07:27:21 +02:00
|
|
|
!include UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
|
|
|
|
|
2021-03-12 06:23:07 +01:00
|
|
|
!include MdePkg/MdeLibs.dsc.inc
|
|
|
|
|
2018-04-04 19:31:50 +02: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 05:11:04 +02:00
|
|
|
VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf
|
2019-10-28 21:19:46 +01:00
|
|
|
!ifdef CONTINUOUS_INTEGRATION
|
|
|
|
BaseCryptLib|CryptoPkg/Library/BaseCryptLibNull/BaseCryptLibNull.inf
|
|
|
|
!else
|
2018-04-04 19:31:50 +02:00
|
|
|
IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
|
2019-10-28 21:19:46 +01:00
|
|
|
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
|
2018-04-04 19:31:50 +02:00
|
|
|
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
|
2020-10-15 22:42:38 +02:00
|
|
|
RngLib|MdePkg/Library/BaseRngLibNull/BaseRngLibNull.inf
|
2019-10-28 21:19:46 +01:00
|
|
|
!endif
|
2018-04-04 19:31:50 +02: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 07:27:07 +02:00
|
|
|
FmpDependencyLib|FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.inf
|
2020-05-12 07:27:34 +02:00
|
|
|
FmpDependencyCheckLib|FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
|
2020-05-12 10:12:37 +02:00
|
|
|
FmpDependencyDeviceLib|FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
|
2019-06-03 14:33:43 +02:00
|
|
|
TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
|
2018-04-04 19:31:50 +02:00
|
|
|
|
|
|
|
[LibraryClasses.ARM, LibraryClasses.AARCH64]
|
|
|
|
#
|
|
|
|
# It is not possible to prevent the ARM compiler for generic intrinsic functions.
|
2019-10-09 06:38:02 +02:00
|
|
|
# This library provides the intrinsic functions generate by a given compiler.
|
2018-04-04 19:31:50 +02:00
|
|
|
# [LibraryClasses.ARM, LibraryClasses.AARCH64] and NULL mean link this library
|
|
|
|
# into all ARM and AARCH64 images.
|
|
|
|
#
|
|
|
|
NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
|
|
|
|
|
|
|
|
# Add support for stack protector
|
|
|
|
NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
|
|
|
|
|
|
|
|
[LibraryClasses.ARM]
|
|
|
|
ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
|
|
|
|
|
2019-07-26 09:40:37 +02:00
|
|
|
[PcdsPatchableInModule]
|
|
|
|
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageTypeIdGuid|{0}
|
|
|
|
|
2018-04-04 19:31:50 +02:00
|
|
|
[Components]
|
|
|
|
#
|
|
|
|
# Libraries
|
|
|
|
#
|
|
|
|
FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
|
2019-08-11 07:36:46 +02:00
|
|
|
FmpDevicePkg/Library/CapsuleUpdatePolicyLibOnProtocol/CapsuleUpdatePolicyLibOnProtocol.inf
|
2018-04-04 19:31:50 +02:00
|
|
|
FmpDevicePkg/Library/FmpPayloadHeaderLibV1/FmpPayloadHeaderLibV1.inf
|
|
|
|
FmpDevicePkg/Library/FmpDeviceLibNull/FmpDeviceLibNull.inf
|
2020-05-12 07:27:07 +02:00
|
|
|
FmpDevicePkg/Library/FmpDependencyLib/FmpDependencyLib.inf
|
2020-05-12 07:27:34 +02:00
|
|
|
FmpDevicePkg/Library/FmpDependencyCheckLib/FmpDependencyCheckLib.inf
|
|
|
|
FmpDevicePkg/Library/FmpDependencyCheckLibNull/FmpDependencyCheckLibNull.inf
|
2020-05-12 10:12:37 +02:00
|
|
|
FmpDevicePkg/Library/FmpDependencyDeviceLibNull/FmpDependencyDeviceLibNull.inf
|
2018-04-04 19:31:50 +02:00
|
|
|
FmpDevicePkg/FmpDxe/FmpDxeLib.inf
|
|
|
|
|
|
|
|
#
|
|
|
|
# Modules
|
|
|
|
#
|
2019-08-11 07:36:46 +02:00
|
|
|
FmpDevicePkg/CapsuleUpdatePolicyDxe/CapsuleUpdatePolicyDxe.inf {
|
|
|
|
<LibraryClasses>
|
|
|
|
CapsuleUpdatePolicyLib|FmpDevicePkg/Library/CapsuleUpdatePolicyLibNull/CapsuleUpdatePolicyLibNull.inf
|
|
|
|
}
|
2018-04-04 19:31:50 +02:00
|
|
|
FmpDevicePkg/FmpDxe/FmpDxe.inf {
|
|
|
|
<Defines>
|
|
|
|
#
|
2018-07-28 03:11:19 +02:00
|
|
|
# FILE_GUID is used as ESRT GUID
|
2018-04-04 19:31:50 +02:00
|
|
|
#
|
2018-07-28 03:11:19 +02:00
|
|
|
FILE_GUID = $(SYSTEM_FMP_ESRT_GUID)
|
2019-07-26 09:40:37 +02: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 07:36:46 +02: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 19:31:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
FmpDevicePkg/FmpDxe/FmpDxe.inf {
|
|
|
|
<Defines>
|
|
|
|
#
|
|
|
|
# FILE_GUID is used as ESRT GUID
|
|
|
|
#
|
2018-07-28 03:11:19 +02:00
|
|
|
FILE_GUID = $(DEVICE_FMP_ESRT_GUID)
|
2019-07-26 09:45:19 +02:00
|
|
|
<PcdsFeatureFlag>
|
|
|
|
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceStorageAccessEnable|$(DEVICE_FMP_STORAGE_ACCESS_ENABLE)
|
2019-07-26 09:40:37 +02:00
|
|
|
<PcdsFixedAtBuild>
|
2019-07-26 09:45:19 +02:00
|
|
|
!if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == FALSE
|
|
|
|
#
|
|
|
|
# Disable test key detection
|
|
|
|
#
|
|
|
|
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceTestKeySha256Digest|{0}
|
|
|
|
!endif
|
2019-07-26 09:40:37 +02:00
|
|
|
#
|
|
|
|
# Unicode name string that is used to populate FMP Image Descriptor for this capsule update module
|
|
|
|
#
|
2019-07-26 09:45:19 +02:00
|
|
|
!if $(DEVICE_FMP_STORAGE_ACCESS_ENABLE) == TRUE
|
2019-07-26 09:40:37 +02:00
|
|
|
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device"
|
2019-07-26 09:45:19 +02:00
|
|
|
!else
|
|
|
|
gFmpDevicePkgTokenSpaceGuid.PcdFmpDeviceImageIdName|L"Sample Firmware Device No Storage Access"
|
|
|
|
!endif
|
2019-07-26 09:40:37 +02: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 07:36:46 +02: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 19:31:50 +02:00
|
|
|
}
|
2018-07-25 11:22:10 +02:00
|
|
|
|
2020-05-12 07:27:21 +02:00
|
|
|
#
|
|
|
|
# Add UEFI Target Based Unit Tests
|
|
|
|
#
|
|
|
|
FmpDevicePkg/Test/UnitTest/Library/FmpDependencyLib/FmpDependencyLibUnitTestsUefi.inf
|
|
|
|
|
2018-07-25 11:22:10 +02:00
|
|
|
[BuildOptions]
|
|
|
|
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
|