[edk2-devel] [PATCH v3 4/4] ArmVirtPkg: Add varpolicy shell command

Michael Kubacki posted 4 patches 2 years, 3 months ago
[edk2-devel] [PATCH v3 4/4] ArmVirtPkg: Add varpolicy shell command
Posted by Michael Kubacki 2 years, 3 months ago
From: Michael Kubacki <michael.kubacki@microsoft.com>

Adds the varpolicy EFI shell command to all DSC files that
currently include other dynamic shell commands from ShellPkg.

This command allows variable policies to be dumped in the EFI
shell for convenient auditing and debug.

Use the command in the EFI shell as follows:

- `"varpolicy"` dumps platform variables
- `"varpolicy -?"` shows help text
- `"varpolicy -b"` pages output as expected
- `"varpolicy -s"` shows accurate variable statistic information
- `"varpolicy -p"` shows accurate UEFI variable policy information
- `"varpolicy-v -b"` dumps all information including variable data hex dump

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Julien Grall <julien@xen.org>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
 ArmVirtPkg/ArmVirt.dsc.inc           | 4 ++++
 ArmVirtPkg/ArmVirtCloudHv.fdf        | 1 +
 ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 1 +
 ArmVirtPkg/ArmVirtXen.fdf            | 1 +
 4 files changed, 7 insertions(+)

diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index 4ed86b979e1a..fe6488ee9910 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -393,6 +393,10 @@ [Components.common]
     <PcdsFixedAtBuild>
       gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
   }
+  ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf {
+    <PcdsFixedAtBuild>
+      gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
+  }
   OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf {
     <PcdsFixedAtBuild>
       gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
diff --git a/ArmVirtPkg/ArmVirtCloudHv.fdf b/ArmVirtPkg/ArmVirtCloudHv.fdf
index a5f172d79bfc..56d1ea6e8c1b 100644
--- a/ArmVirtPkg/ArmVirtCloudHv.fdf
+++ b/ArmVirtPkg/ArmVirtCloudHv.fdf
@@ -169,6 +169,7 @@ [FV.FvMain]
   INF ShellPkg/Application/Shell/Shell.inf
   INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
   INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
+  INF ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
   INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
 
   #
diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
index 2894bc853a46..9b3e37d5c998 100644
--- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
+++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
@@ -103,6 +103,7 @@ [FV.FvMain]
   INF ShellPkg/Application/Shell/Shell.inf
   INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
   INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
+  INF ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
   INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
 
   #
diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf
index 770fbf7289be..ea835551b375 100644
--- a/ArmVirtPkg/ArmVirtXen.fdf
+++ b/ArmVirtPkg/ArmVirtXen.fdf
@@ -180,6 +180,7 @@ [FV.FvMain]
   INF ShellPkg/Application/Shell/Shell.inf
   INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
   INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
+  INF ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
   INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
 
   #
-- 
2.42.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110343): https://edk2.groups.io/g/devel/message/110343
Mute This Topic: https://groups.io/mt/102284388/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 4/4] ArmVirtPkg: Add varpolicy shell command
Posted by Ard Biesheuvel 2 years, 3 months ago
On Mon, 30 Oct 2023 at 21:31, <mikuback@linux.microsoft.com> wrote:
>
> From: Michael Kubacki <michael.kubacki@microsoft.com>
>
> Adds the varpolicy EFI shell command to all DSC files that
> currently include other dynamic shell commands from ShellPkg.
>
> This command allows variable policies to be dumped in the EFI
> shell for convenient auditing and debug.
>
> Use the command in the EFI shell as follows:
>
> - `"varpolicy"` dumps platform variables
> - `"varpolicy -?"` shows help text
> - `"varpolicy -b"` pages output as expected
> - `"varpolicy -s"` shows accurate variable statistic information
> - `"varpolicy -p"` shows accurate UEFI variable policy information
> - `"varpolicy-v -b"` dumps all information including variable data hex dump
>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Julien Grall <julien@xen.org>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Leif Lindholm <quic_llindhol@quicinc.com>
> Cc: Sami Mujawar <sami.mujawar@arm.com>
> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

> ---
>  ArmVirtPkg/ArmVirt.dsc.inc           | 4 ++++
>  ArmVirtPkg/ArmVirtCloudHv.fdf        | 1 +
>  ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 1 +
>  ArmVirtPkg/ArmVirtXen.fdf            | 1 +
>  4 files changed, 7 insertions(+)
>
> diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
> index 4ed86b979e1a..fe6488ee9910 100644
> --- a/ArmVirtPkg/ArmVirt.dsc.inc
> +++ b/ArmVirtPkg/ArmVirt.dsc.inc
> @@ -393,6 +393,10 @@ [Components.common]
>      <PcdsFixedAtBuild>
>        gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
>    }
> +  ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf {
> +    <PcdsFixedAtBuild>
> +      gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> +  }
>    OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf {
>      <PcdsFixedAtBuild>
>        gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> diff --git a/ArmVirtPkg/ArmVirtCloudHv.fdf b/ArmVirtPkg/ArmVirtCloudHv.fdf
> index a5f172d79bfc..56d1ea6e8c1b 100644
> --- a/ArmVirtPkg/ArmVirtCloudHv.fdf
> +++ b/ArmVirtPkg/ArmVirtCloudHv.fdf
> @@ -169,6 +169,7 @@ [FV.FvMain]
>    INF ShellPkg/Application/Shell/Shell.inf
>    INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
>    INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
> +  INF ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
>    INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
>
>    #
> diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> index 2894bc853a46..9b3e37d5c998 100644
> --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc
> @@ -103,6 +103,7 @@ [FV.FvMain]
>    INF ShellPkg/Application/Shell/Shell.inf
>    INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
>    INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
> +  INF ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
>    INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
>
>    #
> diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf
> index 770fbf7289be..ea835551b375 100644
> --- a/ArmVirtPkg/ArmVirtXen.fdf
> +++ b/ArmVirtPkg/ArmVirtXen.fdf
> @@ -180,6 +180,7 @@ [FV.FvMain]
>    INF ShellPkg/Application/Shell/Shell.inf
>    INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
>    INF ShellPkg/DynamicCommand/HttpDynamicCommand/HttpDynamicCommand.inf
> +  INF ShellPkg/DynamicCommand/VariablePolicyDynamicCommand/VariablePolicyDynamicCommand.inf
>    INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf
>
>    #
> --
> 2.42.0.windows.2
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110347): https://edk2.groups.io/g/devel/message/110347
Mute This Topic: https://groups.io/mt/102284388/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 4/4] ArmVirtPkg: Add varpolicy shell command
Posted by Laszlo Ersek 2 years, 3 months ago
On 10/30/23 23:36, Ard Biesheuvel wrote:
> On Mon, 30 Oct 2023 at 21:31, <mikuback@linux.microsoft.com> wrote:
>>
>> From: Michael Kubacki <michael.kubacki@microsoft.com>
>>
>> Adds the varpolicy EFI shell command to all DSC files that
>> currently include other dynamic shell commands from ShellPkg.
>>
>> This command allows variable policies to be dumped in the EFI
>> shell for convenient auditing and debug.
>>
>> Use the command in the EFI shell as follows:
>>
>> - `"varpolicy"` dumps platform variables
>> - `"varpolicy -?"` shows help text
>> - `"varpolicy -b"` pages output as expected
>> - `"varpolicy -s"` shows accurate variable statistic information
>> - `"varpolicy -p"` shows accurate UEFI variable policy information
>> - `"varpolicy-v -b"` dumps all information including variable data hex dump
>>
>> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Julien Grall <julien@xen.org>
>> Cc: Laszlo Ersek <lersek@redhat.com>
>> Cc: Leif Lindholm <quic_llindhol@quicinc.com>
>> Cc: Sami Mujawar <sami.mujawar@arm.com>
>> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
> 
> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

Queued via <https://github.com/tianocore/edk2/pull/4984>.



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110415): https://edk2.groups.io/g/devel/message/110415
Mute This Topic: https://groups.io/mt/102284388/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v3 4/4] ArmVirtPkg: Add varpolicy shell command
Posted by Laszlo Ersek 2 years, 3 months ago
On 10/31/23 14:43, Laszlo Ersek wrote:
> On 10/30/23 23:36, Ard Biesheuvel wrote:
>> On Mon, 30 Oct 2023 at 21:31, <mikuback@linux.microsoft.com> wrote:
>>>
>>> From: Michael Kubacki <michael.kubacki@microsoft.com>
>>>
>>> Adds the varpolicy EFI shell command to all DSC files that
>>> currently include other dynamic shell commands from ShellPkg.
>>>
>>> This command allows variable policies to be dumped in the EFI
>>> shell for convenient auditing and debug.
>>>
>>> Use the command in the EFI shell as follows:
>>>
>>> - `"varpolicy"` dumps platform variables
>>> - `"varpolicy -?"` shows help text
>>> - `"varpolicy -b"` pages output as expected
>>> - `"varpolicy -s"` shows accurate variable statistic information
>>> - `"varpolicy -p"` shows accurate UEFI variable policy information
>>> - `"varpolicy-v -b"` dumps all information including variable data hex dump
>>>
>>> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
>>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>>> Cc: Julien Grall <julien@xen.org>
>>> Cc: Laszlo Ersek <lersek@redhat.com>
>>> Cc: Leif Lindholm <quic_llindhol@quicinc.com>
>>> Cc: Sami Mujawar <sami.mujawar@arm.com>
>>> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
>>
>> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
> 
> Queued via <https://github.com/tianocore/edk2/pull/4984>.

merged as commit range
2e128302e608fbe2c03d1967dd7328bbdf07bab3~4..2e128302e608fbe2c03d1967dd7328bbdf07bab3



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#110424): https://edk2.groups.io/g/devel/message/110424
Mute This Topic: https://groups.io/mt/102284388/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-