summaryrefslogtreecommitdiffstats
path: root/ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2023-10-30 16:31:10 -0400
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-10-31 14:40:50 +0000
commitd4358a7f7629c996f80236588c95b62cd9c93584 (patch)
tree191250573385970bb47b6cc35897de0a2c0826b3 /ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
parentf3b2187d558b1540e65e86024423ee39fe6264aa (diff)
downloadedk2-d4358a7f7629c996f80236588c95b62cd9c93584.tar.gz
edk2-d4358a7f7629c996f80236588c95b62cd9c93584.tar.bz2
edk2-d4358a7f7629c996f80236588c95b62cd9c93584.zip
ShellPkg: Add varpolicy dynamic shell command and app
Adds a new module (dynamic shell command) to ShellPkg that lists variable policy information for all UEFI variables on the system. Some other UEFI variable related functionality is also included to give a greater sense of platform UEFI variable state. This command is intended to help make variable policies more transparent and easier to understand and configure on a platform. Like all dynamic shell commands, a platform only needs to include `VariablePolicyDynamicCommand.inf` in their flash image to have the command registered in their UEFI shell. Include the following lines in platform DSC (in DXE components section): ``` ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf { <PcdsFixedAtBuild> gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE } ``` Include the following line in platform FDF: ``` INF ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf ``` A standalone UEFI application can also be built that uses the same underlying functional code as the dynamic shell command. The path to use in the DSC and FDF for the app: ``` ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyApp.inf ``` Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Message-Id: <20231030203112.736-3-mikuback@linux.microsoft.com>
Diffstat (limited to 'ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf')
-rw-r--r--ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf61
1 files changed, 61 insertions, 0 deletions
diff --git a/ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf b/ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
new file mode 100644
index 0000000000..120e7339da
--- /dev/null
+++ b/ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
@@ -0,0 +1,61 @@
+## @file
+# A UEFI variable policy dynamic shell command that displays information
+# about UEFI variable policy configuration on the system.
+#
+# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 1.27
+ BASE_NAME = VariablePolicyDynamicCommand
+ FILE_GUID = 17D0EF2A-5933-4007-8950-5749169D3DC5
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ ENTRY_POINT = VariablePolicyDynamicCommandEntryPoint
+ UNLOAD_IMAGE = VariablePolicyDynamicCommandUnload
+ UEFI_HII_RESOURCE_SECTION = TRUE
+
+[Sources.common]
+ VariablePolicy.uni
+ VariablePolicy.h
+ VariablePolicy.c
+ VariablePolicyDynamicCommand.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+ ShellPkg/ShellPkg.dec
+
+[LibraryClasses]
+ BaseLib
+ BaseMemoryLib
+ DebugLib
+ HiiLib
+ MemoryAllocationLib
+ PrintLib
+ ShellLib
+ UefiBootServicesTableLib
+ UefiDriverEntryPoint
+ UefiHiiServicesLib
+ UefiRuntimeServicesTableLib
+
+[Protocols]
+ gEdkiiVariablePolicyProtocolGuid ## SOMETIMES_CONSUMES
+ gEfiHiiPackageListProtocolGuid ## CONSUMES
+ gEfiShellDynamicCommandProtocolGuid ## PRODUCES
+
+[Guids]
+ ## SOMETIMES_CONSUMES ## Variables in Vendor Namespace
+ gEfiCapsuleReportGuid
+ gEfiCapsuleVendorGuid
+ gEfiGlobalVariableGuid
+ gEfiMemoryOverwriteRequestControlLockGuid
+ gEfiMemoryTypeInformationGuid
+ gMtcVendorGuid
+ gShellAliasGuid
+ gShellVariableGuid
+
+[DEPEX]
+ TRUE