render / rpms / edk2

Forked from rpms/edk2 2 months ago
Clone

Blame SOURCES/0015-ArmVirtPkg-take-PcdResizeXterm-from-the-QEMU-command.patch

b6c182
From 3f9662c435278564640be672f0c4e17e535f1765 Mon Sep 17 00:00:00 2001
7fdf80
From: Laszlo Ersek <lersek@redhat.com>
7fdf80
Date: Sun, 26 Jul 2015 08:02:50 +0000
7fdf80
Subject: ArmVirtPkg: take PcdResizeXterm from the QEMU command line (RH only)
7fdf80
b6c182
Notes about the RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] ->
b6c182
RHEL-8.5/20210520-e1999b264f1f [edk2-stable202105] rebase:
b6c182
b6c182
- no change
b6c182
1d2c45
Notes about the RHEL-8.2/20190904-37eef91017ad [edk2-stable201908] ->
1d2c45
RHEL-8.3/20200603-ca407c7246bf [edk2-stable202005] rebase:
1d2c45
1d2c45
- Resolve leading context divergence in "ArmVirtPkg/ArmVirtQemu.dsc",
1d2c45
  arising from upstream commits:
1d2c45
1d2c45
  - 82662a3b5f56 ("ArmVirtPkg/PlatformPeiLib: discover the TPM base
1d2c45
                  address from the DT", 2020-03-04)
1d2c45
1d2c45
  - ddd34a818315 ("ArmVirtPkg/ArmVirtQemu: enable TPM2 support in the PEI
1d2c45
                  phase", 2020-03-04)
1d2c45
1d2c45
  - cdc3fa54184a ("ArmVirtPkg: control PXEv4 / PXEv6 boot support from the
1d2c45
                  QEMU command line", 2020-04-28)
1d2c45
1d2c45
- Rework the downstream patch quite a bit, paralleling the upstream work
1d2c45
  done for <https://bugzilla.tianocore.org/show_bug.cgi?id=2681> in commit
1d2c45
  range 64ab457d1f21..cdc3fa54184a:
1d2c45
1d2c45
  - Refresh copyright year in TerminalPcdProducerLib.{inf,c}. Also replace
1d2c45
    open-coded BSDL with "SPDX-License-Identifier: BSD-2-Clause-Patent".
1d2c45
1d2c45
  - Simplify LIBRARY_CLASS: this lib instance is meant to be consumed only
1d2c45
    via NULL class resolution (basically: as a plugin), so use NULL for
1d2c45
    LIBRARY_CLASS, not "TerminalPcdProducerLib|DXE_DRIVER".
1d2c45
1d2c45
  - Sort the [Packages] section alphabetically in the INF file.
1d2c45
1d2c45
  - Replace the open-coded GetNamedFwCfgBoolean() function with a call to
1d2c45
    QemuFwCfgParseBool(), from QemuFwCfgSimpleParserLib.
1d2c45
1d2c45
  - Add the SOMETIMES_PRODUCES usage comment in the [Pcd] section of the
1d2c45
    INF file.
1d2c45
1dc609
Notes about the RHEL-8.1/20190308-89910a39dcfd [edk2-stable201903] ->
1dc609
RHEL-8.2/20190904-37eef91017ad [edk2-stable201908] rebase:
1dc609
1dc609
- no change
1dc609
7fdf80
Notes about the RHEL-8.0/20180508-ee3198e672e2 ->
7fdf80
RHEL-8.1/20190308-89910a39dcfd rebase:
7fdf80
7fdf80
- no change
7fdf80
7fdf80
Notes about the RHEL-7.6/ovmf-20180508-2.gitee3198e672e2.el7 ->
7fdf80
RHEL-8.0/20180508-ee3198e672e2 rebase:
7fdf80
7fdf80
- reorder the rebase changelog in the commit message so that it reads like
7fdf80
  a blog: place more recent entries near the top
7fdf80
- no changes to the patch body
7fdf80
7fdf80
Notes about the 20171011-92d07e48907f -> 20180508-ee3198e672e2 rebase:
7fdf80
7fdf80
- no change
7fdf80
7fdf80
Notes about the 20170228-c325e41585e3 -> 20171011-92d07e48907f rebase:
7fdf80
7fdf80
- Refresh downstream-only commit d4564d39dfdb against context changes in
7fdf80
  "ArmVirtPkg/ArmVirtQemu.dsc" from upstream commit 7e5f1b673870
7fdf80
  ("ArmVirtPkg/PlatformHasAcpiDtDxe: allow guest level ACPI disable
7fdf80
  override", 2017-03-29).
7fdf80
7fdf80
Notes about the 20160608b-988715a -> 20170228-c325e41585e3 rebase:
7fdf80
7fdf80
- Adapt commit 6b97969096a3 to the fact that upstream has deprecated such
7fdf80
  setter functions for dynamic PCDs that don't return a status code (such
7fdf80
  as PcdSetBool()). Employ PcdSetBoolS(), and assert that it succeeds --
7fdf80
  there's really no circumstance in this case when it could fail.
7fdf80
7fdf80
Contributed-under: TianoCore Contribution Agreement 1.0
7fdf80
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
7fdf80
(cherry picked from commit d4564d39dfdbf74e762af43314005a2c026cb262)
7fdf80
(cherry picked from commit c9081ebe3bcd28e5cce4bf58bd8d4fca12f9af7c)
7fdf80
(cherry picked from commit 8e92730c8e1cdb642b3b3e680e643ff774a90c65)
7fdf80
(cherry picked from commit 9448b6b46267d8d807fac0c648e693171bb34806)
1dc609
(cherry picked from commit 232fcf06f6b3048b7c2ebd6931f23186b3852f04)
1d2c45
(cherry picked from commit 8338545260fbb423f796d5196faaaf8ff6e1ed99)
b6c182
(cherry picked from commit a5f7a57bf390f1f340ff1d1f1884a73716817ef1)
7fdf80
---
1d2c45
 ArmVirtPkg/ArmVirtQemu.dsc                    |  7 +++-
1d2c45
 .../TerminalPcdProducerLib.c                  | 34 +++++++++++++++++++
1d2c45
 .../TerminalPcdProducerLib.inf                | 33 ++++++++++++++++++
1d2c45
 3 files changed, 73 insertions(+), 1 deletion(-)
7fdf80
 create mode 100644 ArmVirtPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c
7fdf80
 create mode 100644 ArmVirtPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
7fdf80
7fdf80
diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
b6c182
index 54d637163c..41a26c8d18 100644
7fdf80
--- a/ArmVirtPkg/ArmVirtQemu.dsc
7fdf80
+++ b/ArmVirtPkg/ArmVirtQemu.dsc
b6c182
@@ -280,6 +280,8 @@
1d2c45
   gEfiSecurityPkgTokenSpaceGuid.PcdTpm2HashMask|0
1d2c45
 !endif
7fdf80
 
7fdf80
+  gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE
7fdf80
+
7fdf80
 [PcdsDynamicHii]
7fdf80
   gArmVirtTokenSpaceGuid.PcdForceNoAcpi|L"ForceNoAcpi"|gArmVirtVariableGuid|0x0|FALSE|NV,BS
7fdf80
 
b6c182
@@ -382,7 +384,10 @@
7fdf80
   MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
7fdf80
   MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
7fdf80
   MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
7fdf80
-  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
7fdf80
+  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf {
7fdf80
+    <LibraryClasses>
7fdf80
+      NULL|ArmVirtPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
7fdf80
+  }
7fdf80
   MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
7fdf80
 
7fdf80
   MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
7fdf80
diff --git a/ArmVirtPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c b/ArmVirtPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c
7fdf80
new file mode 100644
1d2c45
index 0000000000..bfd3a6a535
7fdf80
--- /dev/null
7fdf80
+++ b/ArmVirtPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.c
1d2c45
@@ -0,0 +1,34 @@
7fdf80
+/** @file
7fdf80
+*  Plugin library for setting up dynamic PCDs for TerminalDxe, from fw_cfg
7fdf80
+*
1d2c45
+*  Copyright (C) 2015-2020, Red Hat, Inc.
7fdf80
+*  Copyright (c) 2014, Linaro Ltd. All rights reserved.
7fdf80
+*
1d2c45
+*  SPDX-License-Identifier: BSD-2-Clause-Patent
7fdf80
+**/
7fdf80
+
7fdf80
+#include <Library/DebugLib.h>
7fdf80
+#include <Library/PcdLib.h>
1d2c45
+#include <Library/QemuFwCfgSimpleParserLib.h>
7fdf80
+
7fdf80
+#define UPDATE_BOOLEAN_PCD_FROM_FW_CFG(TokenName)                             \
7fdf80
+          do {                                                                \
7fdf80
+            BOOLEAN       Setting;                                            \
7fdf80
+            RETURN_STATUS PcdStatus;                                          \
7fdf80
+                                                                              \
1d2c45
+            if (!RETURN_ERROR (QemuFwCfgParseBool (                           \
7fdf80
+                    "opt/org.tianocore.edk2.aavmf/" #TokenName, &Setting))) { \
7fdf80
+              PcdStatus = PcdSetBoolS (TokenName, Setting);                   \
7fdf80
+              ASSERT_RETURN_ERROR (PcdStatus);                                \
7fdf80
+            }                                                                 \
7fdf80
+          } while (0)
7fdf80
+
7fdf80
+RETURN_STATUS
7fdf80
+EFIAPI
7fdf80
+TerminalPcdProducerLibConstructor (
7fdf80
+  VOID
7fdf80
+  )
7fdf80
+{
7fdf80
+  UPDATE_BOOLEAN_PCD_FROM_FW_CFG (PcdResizeXterm);
7fdf80
+  return RETURN_SUCCESS;
7fdf80
+}
7fdf80
diff --git a/ArmVirtPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf b/ArmVirtPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
7fdf80
new file mode 100644
1d2c45
index 0000000000..a51dbd1670
7fdf80
--- /dev/null
7fdf80
+++ b/ArmVirtPkg/Library/TerminalPcdProducerLib/TerminalPcdProducerLib.inf
1d2c45
@@ -0,0 +1,33 @@
7fdf80
+## @file
7fdf80
+#  Plugin library for setting up dynamic PCDs for TerminalDxe, from fw_cfg
7fdf80
+#
1d2c45
+#  Copyright (C) 2015-2020, Red Hat, Inc.
7fdf80
+#  Copyright (c) 2014, Linaro Ltd. All rights reserved.
7fdf80
+#
1d2c45
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
7fdf80
+##
7fdf80
+
7fdf80
+[Defines]
7fdf80
+  INF_VERSION                    = 0x00010005
7fdf80
+  BASE_NAME                      = TerminalPcdProducerLib
7fdf80
+  FILE_GUID                      = 4a0c5ed7-8c42-4c01-8f4c-7bf258316a96
7fdf80
+  MODULE_TYPE                    = BASE
7fdf80
+  VERSION_STRING                 = 1.0
1d2c45
+  LIBRARY_CLASS                  = NULL
7fdf80
+  CONSTRUCTOR                    = TerminalPcdProducerLibConstructor
7fdf80
+
7fdf80
+[Sources]
7fdf80
+  TerminalPcdProducerLib.c
7fdf80
+
7fdf80
+[Packages]
1d2c45
+  MdeModulePkg/MdeModulePkg.dec
7fdf80
+  MdePkg/MdePkg.dec
7fdf80
+  OvmfPkg/OvmfPkg.dec
7fdf80
+
7fdf80
+[LibraryClasses]
7fdf80
+  DebugLib
7fdf80
+  PcdLib
1d2c45
+  QemuFwCfgSimpleParserLib
7fdf80
+
7fdf80
+[Pcd]
1d2c45
+  gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm ## SOMETIMES_PRODUCES
7fdf80
-- 
b6c182
2.27.0
7fdf80