From fc624b8806b10ad946066681c0fd797aa3b89c36 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Thu, 2 Apr 2026 16:10:43 +0300 Subject: [PATCH 1/8] t Signed-off-by: Valeriy Khorunzhin --- images/virt-artifact/werf.inc.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index f30560fba6..54a933900e 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -16,7 +16,8 @@ shell: install: - | echo "Git clone {{ $gitRepoName }} repository..." - git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch {{ $tag }} /src/kubevirt + echo "kek" + git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch v1.6.2-virtualization-no-bootable /src/kubevirt rm -rf /src/kubevirt/.git From 98162ba00c67f90958d53a61b23aa157f7a314bc Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Thu, 2 Apr 2026 18:08:03 +0300 Subject: [PATCH 2/8] t2 Signed-off-by: Valeriy Khorunzhin --- images/virt-artifact/werf.inc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index 54a933900e..b5c41855d3 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -16,7 +16,7 @@ shell: install: - | echo "Git clone {{ $gitRepoName }} repository..." - echo "kek" + echo "kek2" git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch v1.6.2-virtualization-no-bootable /src/kubevirt rm -rf /src/kubevirt/.git From 5a95a8f34367034b29c954d7f6810d3ab41a7018 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Tue, 7 Apr 2026 17:00:26 +0300 Subject: [PATCH 3/8] patch Signed-off-by: Valeriy Khorunzhin --- ...PortLib-for-debug-console-port-0x402.patch | 254 ++++++++++++++++++ images/edk2/werf.inc.yaml | 16 ++ 2 files changed, 270 insertions(+) create mode 100644 images/edk2/patches/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch diff --git a/images/edk2/patches/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch b/images/edk2/patches/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch new file mode 100644 index 0000000000..ceda7ca404 --- /dev/null +++ b/images/edk2/patches/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch @@ -0,0 +1,254 @@ +diff --git a/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c +new file mode 100644 +index 0000000000..4e4f20cf2d +--- /dev/null ++++ b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c +@@ -0,0 +1,160 @@ ++/** @file ++ Serial Port Library backed by the QEMU debug console (I/O port 0x402). ++ ++ Implements SerialPortLib by writing every byte to the I/O port specified ++ by PcdDebugIoPort (default 0x402). The port is detected at Initialize ++ time via the Bochs/QEMU magic read-back value 0xE9. ++ ++ Copyright (c) 2024, Intel Corporation. All rights reserved.
++ SPDX-License-Identifier: BSD-2-Clause-Patent ++**/ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#define BOCHS_DEBUG_PORT_MAGIC 0xE9 ++ ++STATIC BOOLEAN mDebugConDetected = FALSE; ++ ++/** ++ Initialize the serial device hardware. ++ ++ Probes the QEMU debug console port. If the magic value 0xE9 is read ++ back, the port is considered present. ++ ++ @retval RETURN_SUCCESS The debug console port was detected. ++ @retval RETURN_DEVICE_ERROR The debug console port is not available. ++**/ ++RETURN_STATUS ++EFIAPI ++SerialPortInitialize ( ++ VOID ++ ) ++{ ++ UINT16 Port; ++ ++ Port = PcdGet16 (PcdDebugIoPort); ++ if (IoRead8 (Port) == BOCHS_DEBUG_PORT_MAGIC) { ++ mDebugConDetected = TRUE; ++ return RETURN_SUCCESS; ++ } ++ ++ return RETURN_DEVICE_ERROR; ++} ++ ++/** ++ Write data to the QEMU debug console port. ++ ++ @param Buffer Pointer to the data buffer to be written. ++ @param NumberOfBytes Number of bytes to write. ++ ++ @retval 0 The debug console port is not present. ++ @retval >0 The number of bytes written. ++**/ ++UINTN ++EFIAPI ++SerialPortWrite ( ++ IN UINT8 *Buffer, ++ IN UINTN NumberOfBytes ++ ) ++{ ++ UINT16 Port; ++ UINTN Index; ++ ++ if (!mDebugConDetected) { ++ return 0; ++ } ++ ++ Port = PcdGet16 (PcdDebugIoPort); ++ for (Index = 0; Index < NumberOfBytes; Index++) { ++ IoWrite8 (Port, Buffer[Index]); ++ } ++ ++ return NumberOfBytes; ++} ++ ++/** ++ Read is not supported on the debug console port. ++ ++ @param Buffer Pointer to the data buffer to store data. ++ @param NumberOfBytes Number of bytes to read. ++ ++ @retval 0 Always returns 0 (not supported). ++**/ ++UINTN ++EFIAPI ++SerialPortRead ( ++ OUT UINT8 *Buffer, ++ IN UINTN NumberOfBytes ++ ) ++{ ++ return 0; ++} ++ ++/** ++ Polling is not supported on the debug console port. ++ ++ @retval FALSE Always returns FALSE. ++**/ ++BOOLEAN ++EFIAPI ++SerialPortPoll ( ++ VOID ++ ) ++{ ++ return FALSE; ++} ++ ++/** ++ Set control bits — not supported. ++ ++ @param Control Control bits to set. ++ ++ @retval RETURN_UNSUPPORTED Always. ++**/ ++RETURN_STATUS ++EFIAPI ++SerialPortSetControl ( ++ IN UINT32 Control ++ ) ++{ ++ return RETURN_UNSUPPORTED; ++} ++ ++/** ++ Get control bits — not supported. ++ ++ @param Control Pointer to receive control signals. ++ ++ @retval RETURN_UNSUPPORTED Always. ++**/ ++RETURN_STATUS ++EFIAPI ++SerialPortGetControl ( ++ OUT UINT32 *Control ++ ) ++{ ++ return RETURN_UNSUPPORTED; ++} ++ ++/** ++ Set serial attributes — not supported. ++ ++ @retval RETURN_UNSUPPORTED Always. ++**/ ++RETURN_STATUS ++EFIAPI ++SerialPortSetAttributes ( ++ IN OUT UINT64 *BaudRate, ++ IN OUT UINT32 *ReceiveFifoDepth, ++ IN OUT UINT32 *Timeout, ++ IN OUT EFI_PARITY_TYPE *Parity, ++ IN OUT UINT8 *DataBits, ++ IN OUT EFI_STOP_BITS_TYPE *StopBits ++ ) ++{ ++ return RETURN_UNSUPPORTED; ++} +diff --git a/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf +new file mode 100644 +index 0000000000..8b506f9020 +--- /dev/null ++++ b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf +@@ -0,0 +1,34 @@ ++## @file ++# Serial Port Library backed by the QEMU debug console (I/O port 0x402). ++# ++# This library instance implements SerialPortLib by writing bytes to the ++# I/O port configured via PcdDebugIoPort. It can be used together with ++# BaseDebugLibSerialPort to route DEBUG() output to the QEMU debug console. ++# ++# Copyright (c) 2024, Intel Corporation. All rights reserved.
++# SPDX-License-Identifier: BSD-2-Clause-Patent ++# ++## ++ ++[Defines] ++ INF_VERSION = 0x00010005 ++ BASE_NAME = BaseSerialPortLibDebugCon ++ FILE_GUID = 53A6F6C9-3297-4A36-95E0-68C5D2A4EA1F ++ MODULE_TYPE = BASE ++ VERSION_STRING = 1.0 ++ LIBRARY_CLASS = SerialPortLib ++ ++[Sources] ++ BaseSerialPortLibDebugCon.c ++ ++[Packages] ++ MdePkg/MdePkg.dec ++ OvmfPkg/OvmfPkg.dec ++ ++[LibraryClasses] ++ BaseLib ++ IoLib ++ PcdLib ++ ++[Pcd] ++ gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort ## CONSUMES +diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc +index 7ab6af3a69..b986ab13b5 100644 +--- a/OvmfPkg/OvmfPkgIa32.dsc ++++ b/OvmfPkg/OvmfPkgIa32.dsc +@@ -165,7 +165,11 @@ + CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf ++!ifdef $(DEBUG_ON_SERIAL_PORT) + SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf ++!else ++ SerialPortLib|OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf ++!endif + MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf + MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf + CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf +diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc +index e7fff78df9..a2535b548a 100644 +--- a/OvmfPkg/OvmfPkgIa32X64.dsc ++++ b/OvmfPkg/OvmfPkgIa32X64.dsc +@@ -170,7 +170,11 @@ + CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf ++!ifdef $(DEBUG_ON_SERIAL_PORT) + SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf ++!else ++ SerialPortLib|OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf ++!endif + MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf + MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf + CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf +diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc +index 556984bdaa..51e8fe2789 100644 +--- a/OvmfPkg/OvmfPkgX64.dsc ++++ b/OvmfPkg/OvmfPkgX64.dsc +@@ -182,7 +182,11 @@ + PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf ++!ifdef $(DEBUG_ON_SERIAL_PORT) + SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf ++!else ++ SerialPortLib|OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf ++!endif + MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf + MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf + CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf diff --git a/images/edk2/werf.inc.yaml b/images/edk2/werf.inc.yaml index 452ae9fe18..1f04bd78e9 100644 --- a/images/edk2/werf.inc.yaml +++ b/images/edk2/werf.inc.yaml @@ -53,6 +53,13 @@ git: stageDependencies: install: - '*.json' +- add: {{ .ModuleDir }}/images/{{ .ImageName }}/patches + to: /src/patches + includePaths: + - '*.patch' + stageDependencies: + install: + - '*.patch' - add: {{ .ModuleDir }}/images/{{ .ImageName }}/uefi-revocation-list to: /src/FIRMWARE includePaths: @@ -68,6 +75,8 @@ shell: - | cd /src + echo "1234567" + echo "Git clone Edk2 repository..." git clone \ --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} \ @@ -90,6 +99,13 @@ shell: submodule update --init --recursive --depth=1 fi + echo "Applying patches..." + for p in /src/patches/*.patch; do + [ -f "$p" ] || continue + echo "Applying $p" + git apply "$p" + done + --- image: {{ .ModuleNamePrefix }}{{ .ImageName }} From 31d7fa016710fd9ea2dfdf7c00e7baf3c71f5826 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Tue, 7 Apr 2026 19:21:24 +0300 Subject: [PATCH 4/8] t Signed-off-by: Valeriy Khorunzhin --- ...PortLib-for-debug-console-port-0x402.patch | 303 ++++++++++++++++++ images/edk2/werf.inc.yaml | 2 +- 2 files changed, 304 insertions(+), 1 deletion(-) diff --git a/images/edk2/patches/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch b/images/edk2/patches/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch index ceda7ca404..5294078562 100644 --- a/images/edk2/patches/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch +++ b/images/edk2/patches/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch @@ -1,3 +1,263 @@ +diff --git a/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch b/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch +new file mode 100644 +index 0000000000..ceda7ca404 +--- /dev/null ++++ b/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch +@@ -0,0 +1,254 @@ ++diff --git a/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c ++new file mode 100644 ++index 0000000000..4e4f20cf2d ++--- /dev/null +++++ b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c ++@@ -0,0 +1,160 @@ +++/** @file +++ Serial Port Library backed by the QEMU debug console (I/O port 0x402). +++ +++ Implements SerialPortLib by writing every byte to the I/O port specified +++ by PcdDebugIoPort (default 0x402). The port is detected at Initialize +++ time via the Bochs/QEMU magic read-back value 0xE9. +++ +++ Copyright (c) 2024, Intel Corporation. All rights reserved.
+++ SPDX-License-Identifier: BSD-2-Clause-Patent +++**/ +++ +++#include +++#include +++#include +++#include +++#include +++ +++#define BOCHS_DEBUG_PORT_MAGIC 0xE9 +++ +++STATIC BOOLEAN mDebugConDetected = FALSE; +++ +++/** +++ Initialize the serial device hardware. +++ +++ Probes the QEMU debug console port. If the magic value 0xE9 is read +++ back, the port is considered present. +++ +++ @retval RETURN_SUCCESS The debug console port was detected. +++ @retval RETURN_DEVICE_ERROR The debug console port is not available. +++**/ +++RETURN_STATUS +++EFIAPI +++SerialPortInitialize ( +++ VOID +++ ) +++{ +++ UINT16 Port; +++ +++ Port = PcdGet16 (PcdDebugIoPort); +++ if (IoRead8 (Port) == BOCHS_DEBUG_PORT_MAGIC) { +++ mDebugConDetected = TRUE; +++ return RETURN_SUCCESS; +++ } +++ +++ return RETURN_DEVICE_ERROR; +++} +++ +++/** +++ Write data to the QEMU debug console port. +++ +++ @param Buffer Pointer to the data buffer to be written. +++ @param NumberOfBytes Number of bytes to write. +++ +++ @retval 0 The debug console port is not present. +++ @retval >0 The number of bytes written. +++**/ +++UINTN +++EFIAPI +++SerialPortWrite ( +++ IN UINT8 *Buffer, +++ IN UINTN NumberOfBytes +++ ) +++{ +++ UINT16 Port; +++ UINTN Index; +++ +++ if (!mDebugConDetected) { +++ return 0; +++ } +++ +++ Port = PcdGet16 (PcdDebugIoPort); +++ for (Index = 0; Index < NumberOfBytes; Index++) { +++ IoWrite8 (Port, Buffer[Index]); +++ } +++ +++ return NumberOfBytes; +++} +++ +++/** +++ Read is not supported on the debug console port. +++ +++ @param Buffer Pointer to the data buffer to store data. +++ @param NumberOfBytes Number of bytes to read. +++ +++ @retval 0 Always returns 0 (not supported). +++**/ +++UINTN +++EFIAPI +++SerialPortRead ( +++ OUT UINT8 *Buffer, +++ IN UINTN NumberOfBytes +++ ) +++{ +++ return 0; +++} +++ +++/** +++ Polling is not supported on the debug console port. +++ +++ @retval FALSE Always returns FALSE. +++**/ +++BOOLEAN +++EFIAPI +++SerialPortPoll ( +++ VOID +++ ) +++{ +++ return FALSE; +++} +++ +++/** +++ Set control bits — not supported. +++ +++ @param Control Control bits to set. +++ +++ @retval RETURN_UNSUPPORTED Always. +++**/ +++RETURN_STATUS +++EFIAPI +++SerialPortSetControl ( +++ IN UINT32 Control +++ ) +++{ +++ return RETURN_UNSUPPORTED; +++} +++ +++/** +++ Get control bits — not supported. +++ +++ @param Control Pointer to receive control signals. +++ +++ @retval RETURN_UNSUPPORTED Always. +++**/ +++RETURN_STATUS +++EFIAPI +++SerialPortGetControl ( +++ OUT UINT32 *Control +++ ) +++{ +++ return RETURN_UNSUPPORTED; +++} +++ +++/** +++ Set serial attributes — not supported. +++ +++ @retval RETURN_UNSUPPORTED Always. +++**/ +++RETURN_STATUS +++EFIAPI +++SerialPortSetAttributes ( +++ IN OUT UINT64 *BaudRate, +++ IN OUT UINT32 *ReceiveFifoDepth, +++ IN OUT UINT32 *Timeout, +++ IN OUT EFI_PARITY_TYPE *Parity, +++ IN OUT UINT8 *DataBits, +++ IN OUT EFI_STOP_BITS_TYPE *StopBits +++ ) +++{ +++ return RETURN_UNSUPPORTED; +++} ++diff --git a/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf ++new file mode 100644 ++index 0000000000..8b506f9020 ++--- /dev/null +++++ b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf ++@@ -0,0 +1,34 @@ +++## @file +++# Serial Port Library backed by the QEMU debug console (I/O port 0x402). +++# +++# This library instance implements SerialPortLib by writing bytes to the +++# I/O port configured via PcdDebugIoPort. It can be used together with +++# BaseDebugLibSerialPort to route DEBUG() output to the QEMU debug console. +++# +++# Copyright (c) 2024, Intel Corporation. All rights reserved.
+++# SPDX-License-Identifier: BSD-2-Clause-Patent +++# +++## +++ +++[Defines] +++ INF_VERSION = 0x00010005 +++ BASE_NAME = BaseSerialPortLibDebugCon +++ FILE_GUID = 53A6F6C9-3297-4A36-95E0-68C5D2A4EA1F +++ MODULE_TYPE = BASE +++ VERSION_STRING = 1.0 +++ LIBRARY_CLASS = SerialPortLib +++ +++[Sources] +++ BaseSerialPortLibDebugCon.c +++ +++[Packages] +++ MdePkg/MdePkg.dec +++ OvmfPkg/OvmfPkg.dec +++ +++[LibraryClasses] +++ BaseLib +++ IoLib +++ PcdLib +++ +++[Pcd] +++ gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort ## CONSUMES ++diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc ++index 7ab6af3a69..b986ab13b5 100644 ++--- a/OvmfPkg/OvmfPkgIa32.dsc +++++ b/OvmfPkg/OvmfPkgIa32.dsc ++@@ -165,7 +165,11 @@ ++ CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf ++ IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf ++ OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf +++!ifdef $(DEBUG_ON_SERIAL_PORT) ++ SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf +++!else +++ SerialPortLib|OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf +++!endif ++ MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf ++ MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf ++ CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf ++diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc ++index e7fff78df9..a2535b548a 100644 ++--- a/OvmfPkg/OvmfPkgIa32X64.dsc +++++ b/OvmfPkg/OvmfPkgIa32X64.dsc ++@@ -170,7 +170,11 @@ ++ CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf ++ IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf ++ OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf +++!ifdef $(DEBUG_ON_SERIAL_PORT) ++ SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf +++!else +++ SerialPortLib|OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf +++!endif ++ MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf ++ MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf ++ CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf ++diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc ++index 556984bdaa..51e8fe2789 100644 ++--- a/OvmfPkg/OvmfPkgX64.dsc +++++ b/OvmfPkg/OvmfPkgX64.dsc ++@@ -182,7 +182,11 @@ ++ PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf ++ IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf ++ OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf +++!ifdef $(DEBUG_ON_SERIAL_PORT) ++ SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf +++!else +++ SerialPortLib|OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf +++!endif ++ MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf ++ MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf ++ CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf diff --git a/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c new file mode 100644 index 0000000000..4e4f20cf2d @@ -204,6 +464,49 @@ index 0000000000..8b506f9020 + +[Pcd] + gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort ## CONSUMES +diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +index d9f61757cf..cbf844df21 100644 +--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c ++++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +@@ -2020,6 +2020,12 @@ PlatformBootManagerUnableToBoot ( + EFI_BOOT_MANAGER_LOAD_OPTION BootManagerMenu; + UINTN Index; + ++ DEBUG (( ++ DEBUG_ERROR, ++ "%a: No bootable option or device was found. Falling back to Boot Manager Menu / EFI Shell.\n", ++ gEfiCallerBaseName ++ )); ++ + if (FeaturePcdGet (PcdBootRestrictToFirmware)) { + AsciiPrint ( + "%a: No bootable option was found.\n", +@@ -2034,6 +2040,12 @@ PlatformBootManagerUnableToBoot ( + // + Status = EfiBootManagerGetBootManagerMenu (&BootManagerMenu); + if (EFI_ERROR (Status)) { ++ DEBUG (( ++ DEBUG_ERROR, ++ "%a: Boot Manager Menu unavailable (Status = %r). System halted.\n", ++ gEfiCallerBaseName, ++ Status ++ )); + return; + } + +@@ -2066,6 +2078,12 @@ PlatformBootManagerUnableToBoot ( + } + } + ++ DEBUG (( ++ DEBUG_ERROR, ++ "%a: Entering Boot Manager Menu loop.\n", ++ gEfiCallerBaseName ++ )); ++ + for ( ; ;) { + EfiBootManagerBoot (&BootManagerMenu); + } diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 7ab6af3a69..b986ab13b5 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc diff --git a/images/edk2/werf.inc.yaml b/images/edk2/werf.inc.yaml index 1f04bd78e9..6858e6095c 100644 --- a/images/edk2/werf.inc.yaml +++ b/images/edk2/werf.inc.yaml @@ -75,7 +75,7 @@ shell: - | cd /src - echo "1234567" + echo "12345678" echo "Git clone Edk2 repository..." git clone \ From 746addf2c7e9684c6196288ab43351a36f9f2a22 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Wed, 8 Apr 2026 00:34:56 +0300 Subject: [PATCH 5/8] patch new Signed-off-by: Valeriy Khorunzhin --- images/edk2/patches/0001-0x402.patch | 62 ++ ...PortLib-for-debug-console-port-0x402.patch | 557 ------------------ images/edk2/werf.inc.yaml | 2 +- 3 files changed, 63 insertions(+), 558 deletions(-) create mode 100644 images/edk2/patches/0001-0x402.patch delete mode 100644 images/edk2/patches/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch diff --git a/images/edk2/patches/0001-0x402.patch b/images/edk2/patches/0001-0x402.patch new file mode 100644 index 0000000000..c87c0b0da3 --- /dev/null +++ b/images/edk2/patches/0001-0x402.patch @@ -0,0 +1,62 @@ +diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +index d9f61757cf..d2a0e5f6a1 100644 +--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c ++++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +@@ -2020,6 +2020,14 @@ PlatformBootManagerUnableToBoot ( + EFI_BOOT_MANAGER_LOAD_OPTION BootManagerMenu; + UINTN Index; + ++ { ++ STATIC CONST CHAR8 Msg[] = "No bootable device.\r\n"; ++ UINTN i; ++ for (i = 0; i < sizeof (Msg) - 1; i++) { ++ IoWrite8 (0x402, (UINT8)Msg[i]); ++ } ++ } ++ + if (FeaturePcdGet (PcdBootRestrictToFirmware)) { + AsciiPrint ( + "%a: No bootable option was found.\n", +diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c +index 9bacf9d8c7..ea78559516 100644 +--- a/ShellPkg/Application/Shell/Shell.c ++++ b/ShellPkg/Application/Shell/Shell.c +@@ -359,6 +359,14 @@ UefiMain ( + EFI_SIMPLE_TEXT_INPUT_PROTOCOL *OldConIn; + SPLIT_LIST *Split; + ++ { ++ STATIC CONST CHAR8 Msg[] = "No bootable device.\r\n"; ++ UINTN i; ++ for (i = 0; i < sizeof (Msg) - 1; i++) { ++ IoWrite8 (0x402, (UINT8)Msg[i]); ++ } ++ } ++ + if (PcdGet8 (PcdShellSupportLevel) > 3) { + return (EFI_UNSUPPORTED); + } +diff --git a/ShellPkg/Application/Shell/Shell.h b/ShellPkg/Application/Shell/Shell.h +index 89b4ac6b02..cd82e6f608 100644 +--- a/ShellPkg/Application/Shell/Shell.h ++++ b/ShellPkg/Application/Shell/Shell.h +@@ -42,6 +42,7 @@ + #include + #include + #include ++#include + + #include "ShellParametersProtocol.h" + #include "ShellProtocol.h" +diff --git a/ShellPkg/Application/Shell/Shell.inf b/ShellPkg/Application/Shell/Shell.inf +index f1e41de133..88b033bc35 100644 +--- a/ShellPkg/Application/Shell/Shell.inf ++++ b/ShellPkg/Application/Shell/Shell.inf +@@ -66,6 +66,7 @@ + SortLib + HandleParsingLib + UefiHiiServicesLib ++ IoLib + + [Guids] + gShellVariableGuid ## SOMETIMES_CONSUMES ## GUID diff --git a/images/edk2/patches/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch b/images/edk2/patches/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch deleted file mode 100644 index 5294078562..0000000000 --- a/images/edk2/patches/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch +++ /dev/null @@ -1,557 +0,0 @@ -diff --git a/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch b/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch -new file mode 100644 -index 0000000000..ceda7ca404 ---- /dev/null -+++ b/0001-OvmfPkg-Add-SerialPortLib-for-debug-console-port-0x402.patch -@@ -0,0 +1,254 @@ -+diff --git a/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c -+new file mode 100644 -+index 0000000000..4e4f20cf2d -+--- /dev/null -++++ b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c -+@@ -0,0 +1,160 @@ -++/** @file -++ Serial Port Library backed by the QEMU debug console (I/O port 0x402). -++ -++ Implements SerialPortLib by writing every byte to the I/O port specified -++ by PcdDebugIoPort (default 0x402). The port is detected at Initialize -++ time via the Bochs/QEMU magic read-back value 0xE9. -++ -++ Copyright (c) 2024, Intel Corporation. All rights reserved.
-++ SPDX-License-Identifier: BSD-2-Clause-Patent -++**/ -++ -++#include -++#include -++#include -++#include -++#include -++ -++#define BOCHS_DEBUG_PORT_MAGIC 0xE9 -++ -++STATIC BOOLEAN mDebugConDetected = FALSE; -++ -++/** -++ Initialize the serial device hardware. -++ -++ Probes the QEMU debug console port. If the magic value 0xE9 is read -++ back, the port is considered present. -++ -++ @retval RETURN_SUCCESS The debug console port was detected. -++ @retval RETURN_DEVICE_ERROR The debug console port is not available. -++**/ -++RETURN_STATUS -++EFIAPI -++SerialPortInitialize ( -++ VOID -++ ) -++{ -++ UINT16 Port; -++ -++ Port = PcdGet16 (PcdDebugIoPort); -++ if (IoRead8 (Port) == BOCHS_DEBUG_PORT_MAGIC) { -++ mDebugConDetected = TRUE; -++ return RETURN_SUCCESS; -++ } -++ -++ return RETURN_DEVICE_ERROR; -++} -++ -++/** -++ Write data to the QEMU debug console port. -++ -++ @param Buffer Pointer to the data buffer to be written. -++ @param NumberOfBytes Number of bytes to write. -++ -++ @retval 0 The debug console port is not present. -++ @retval >0 The number of bytes written. -++**/ -++UINTN -++EFIAPI -++SerialPortWrite ( -++ IN UINT8 *Buffer, -++ IN UINTN NumberOfBytes -++ ) -++{ -++ UINT16 Port; -++ UINTN Index; -++ -++ if (!mDebugConDetected) { -++ return 0; -++ } -++ -++ Port = PcdGet16 (PcdDebugIoPort); -++ for (Index = 0; Index < NumberOfBytes; Index++) { -++ IoWrite8 (Port, Buffer[Index]); -++ } -++ -++ return NumberOfBytes; -++} -++ -++/** -++ Read is not supported on the debug console port. -++ -++ @param Buffer Pointer to the data buffer to store data. -++ @param NumberOfBytes Number of bytes to read. -++ -++ @retval 0 Always returns 0 (not supported). -++**/ -++UINTN -++EFIAPI -++SerialPortRead ( -++ OUT UINT8 *Buffer, -++ IN UINTN NumberOfBytes -++ ) -++{ -++ return 0; -++} -++ -++/** -++ Polling is not supported on the debug console port. -++ -++ @retval FALSE Always returns FALSE. -++**/ -++BOOLEAN -++EFIAPI -++SerialPortPoll ( -++ VOID -++ ) -++{ -++ return FALSE; -++} -++ -++/** -++ Set control bits — not supported. -++ -++ @param Control Control bits to set. -++ -++ @retval RETURN_UNSUPPORTED Always. -++**/ -++RETURN_STATUS -++EFIAPI -++SerialPortSetControl ( -++ IN UINT32 Control -++ ) -++{ -++ return RETURN_UNSUPPORTED; -++} -++ -++/** -++ Get control bits — not supported. -++ -++ @param Control Pointer to receive control signals. -++ -++ @retval RETURN_UNSUPPORTED Always. -++**/ -++RETURN_STATUS -++EFIAPI -++SerialPortGetControl ( -++ OUT UINT32 *Control -++ ) -++{ -++ return RETURN_UNSUPPORTED; -++} -++ -++/** -++ Set serial attributes — not supported. -++ -++ @retval RETURN_UNSUPPORTED Always. -++**/ -++RETURN_STATUS -++EFIAPI -++SerialPortSetAttributes ( -++ IN OUT UINT64 *BaudRate, -++ IN OUT UINT32 *ReceiveFifoDepth, -++ IN OUT UINT32 *Timeout, -++ IN OUT EFI_PARITY_TYPE *Parity, -++ IN OUT UINT8 *DataBits, -++ IN OUT EFI_STOP_BITS_TYPE *StopBits -++ ) -++{ -++ return RETURN_UNSUPPORTED; -++} -+diff --git a/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf -+new file mode 100644 -+index 0000000000..8b506f9020 -+--- /dev/null -++++ b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf -+@@ -0,0 +1,34 @@ -++## @file -++# Serial Port Library backed by the QEMU debug console (I/O port 0x402). -++# -++# This library instance implements SerialPortLib by writing bytes to the -++# I/O port configured via PcdDebugIoPort. It can be used together with -++# BaseDebugLibSerialPort to route DEBUG() output to the QEMU debug console. -++# -++# Copyright (c) 2024, Intel Corporation. All rights reserved.
-++# SPDX-License-Identifier: BSD-2-Clause-Patent -++# -++## -++ -++[Defines] -++ INF_VERSION = 0x00010005 -++ BASE_NAME = BaseSerialPortLibDebugCon -++ FILE_GUID = 53A6F6C9-3297-4A36-95E0-68C5D2A4EA1F -++ MODULE_TYPE = BASE -++ VERSION_STRING = 1.0 -++ LIBRARY_CLASS = SerialPortLib -++ -++[Sources] -++ BaseSerialPortLibDebugCon.c -++ -++[Packages] -++ MdePkg/MdePkg.dec -++ OvmfPkg/OvmfPkg.dec -++ -++[LibraryClasses] -++ BaseLib -++ IoLib -++ PcdLib -++ -++[Pcd] -++ gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort ## CONSUMES -+diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc -+index 7ab6af3a69..b986ab13b5 100644 -+--- a/OvmfPkg/OvmfPkgIa32.dsc -++++ b/OvmfPkg/OvmfPkgIa32.dsc -+@@ -165,7 +165,11 @@ -+ CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf -+ IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf -+ OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf -++!ifdef $(DEBUG_ON_SERIAL_PORT) -+ SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf -++!else -++ SerialPortLib|OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf -++!endif -+ MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf -+ MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf -+ CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf -+diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc -+index e7fff78df9..a2535b548a 100644 -+--- a/OvmfPkg/OvmfPkgIa32X64.dsc -++++ b/OvmfPkg/OvmfPkgIa32X64.dsc -+@@ -170,7 +170,11 @@ -+ CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf -+ IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf -+ OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf -++!ifdef $(DEBUG_ON_SERIAL_PORT) -+ SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf -++!else -++ SerialPortLib|OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf -++!endif -+ MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf -+ MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf -+ CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf -+diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc -+index 556984bdaa..51e8fe2789 100644 -+--- a/OvmfPkg/OvmfPkgX64.dsc -++++ b/OvmfPkg/OvmfPkgX64.dsc -+@@ -182,7 +182,11 @@ -+ PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf -+ IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf -+ OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf -++!ifdef $(DEBUG_ON_SERIAL_PORT) -+ SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf -++!else -++ SerialPortLib|OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf -++!endif -+ MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf -+ MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf -+ CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf -diff --git a/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c -new file mode 100644 -index 0000000000..4e4f20cf2d ---- /dev/null -+++ b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.c -@@ -0,0 +1,160 @@ -+/** @file -+ Serial Port Library backed by the QEMU debug console (I/O port 0x402). -+ -+ Implements SerialPortLib by writing every byte to the I/O port specified -+ by PcdDebugIoPort (default 0x402). The port is detected at Initialize -+ time via the Bochs/QEMU magic read-back value 0xE9. -+ -+ Copyright (c) 2024, Intel Corporation. All rights reserved.
-+ SPDX-License-Identifier: BSD-2-Clause-Patent -+**/ -+ -+#include -+#include -+#include -+#include -+#include -+ -+#define BOCHS_DEBUG_PORT_MAGIC 0xE9 -+ -+STATIC BOOLEAN mDebugConDetected = FALSE; -+ -+/** -+ Initialize the serial device hardware. -+ -+ Probes the QEMU debug console port. If the magic value 0xE9 is read -+ back, the port is considered present. -+ -+ @retval RETURN_SUCCESS The debug console port was detected. -+ @retval RETURN_DEVICE_ERROR The debug console port is not available. -+**/ -+RETURN_STATUS -+EFIAPI -+SerialPortInitialize ( -+ VOID -+ ) -+{ -+ UINT16 Port; -+ -+ Port = PcdGet16 (PcdDebugIoPort); -+ if (IoRead8 (Port) == BOCHS_DEBUG_PORT_MAGIC) { -+ mDebugConDetected = TRUE; -+ return RETURN_SUCCESS; -+ } -+ -+ return RETURN_DEVICE_ERROR; -+} -+ -+/** -+ Write data to the QEMU debug console port. -+ -+ @param Buffer Pointer to the data buffer to be written. -+ @param NumberOfBytes Number of bytes to write. -+ -+ @retval 0 The debug console port is not present. -+ @retval >0 The number of bytes written. -+**/ -+UINTN -+EFIAPI -+SerialPortWrite ( -+ IN UINT8 *Buffer, -+ IN UINTN NumberOfBytes -+ ) -+{ -+ UINT16 Port; -+ UINTN Index; -+ -+ if (!mDebugConDetected) { -+ return 0; -+ } -+ -+ Port = PcdGet16 (PcdDebugIoPort); -+ for (Index = 0; Index < NumberOfBytes; Index++) { -+ IoWrite8 (Port, Buffer[Index]); -+ } -+ -+ return NumberOfBytes; -+} -+ -+/** -+ Read is not supported on the debug console port. -+ -+ @param Buffer Pointer to the data buffer to store data. -+ @param NumberOfBytes Number of bytes to read. -+ -+ @retval 0 Always returns 0 (not supported). -+**/ -+UINTN -+EFIAPI -+SerialPortRead ( -+ OUT UINT8 *Buffer, -+ IN UINTN NumberOfBytes -+ ) -+{ -+ return 0; -+} -+ -+/** -+ Polling is not supported on the debug console port. -+ -+ @retval FALSE Always returns FALSE. -+**/ -+BOOLEAN -+EFIAPI -+SerialPortPoll ( -+ VOID -+ ) -+{ -+ return FALSE; -+} -+ -+/** -+ Set control bits — not supported. -+ -+ @param Control Control bits to set. -+ -+ @retval RETURN_UNSUPPORTED Always. -+**/ -+RETURN_STATUS -+EFIAPI -+SerialPortSetControl ( -+ IN UINT32 Control -+ ) -+{ -+ return RETURN_UNSUPPORTED; -+} -+ -+/** -+ Get control bits — not supported. -+ -+ @param Control Pointer to receive control signals. -+ -+ @retval RETURN_UNSUPPORTED Always. -+**/ -+RETURN_STATUS -+EFIAPI -+SerialPortGetControl ( -+ OUT UINT32 *Control -+ ) -+{ -+ return RETURN_UNSUPPORTED; -+} -+ -+/** -+ Set serial attributes — not supported. -+ -+ @retval RETURN_UNSUPPORTED Always. -+**/ -+RETURN_STATUS -+EFIAPI -+SerialPortSetAttributes ( -+ IN OUT UINT64 *BaudRate, -+ IN OUT UINT32 *ReceiveFifoDepth, -+ IN OUT UINT32 *Timeout, -+ IN OUT EFI_PARITY_TYPE *Parity, -+ IN OUT UINT8 *DataBits, -+ IN OUT EFI_STOP_BITS_TYPE *StopBits -+ ) -+{ -+ return RETURN_UNSUPPORTED; -+} -diff --git a/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf -new file mode 100644 -index 0000000000..8b506f9020 ---- /dev/null -+++ b/OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf -@@ -0,0 +1,34 @@ -+## @file -+# Serial Port Library backed by the QEMU debug console (I/O port 0x402). -+# -+# This library instance implements SerialPortLib by writing bytes to the -+# I/O port configured via PcdDebugIoPort. It can be used together with -+# BaseDebugLibSerialPort to route DEBUG() output to the QEMU debug console. -+# -+# Copyright (c) 2024, Intel Corporation. All rights reserved.
-+# SPDX-License-Identifier: BSD-2-Clause-Patent -+# -+## -+ -+[Defines] -+ INF_VERSION = 0x00010005 -+ BASE_NAME = BaseSerialPortLibDebugCon -+ FILE_GUID = 53A6F6C9-3297-4A36-95E0-68C5D2A4EA1F -+ MODULE_TYPE = BASE -+ VERSION_STRING = 1.0 -+ LIBRARY_CLASS = SerialPortLib -+ -+[Sources] -+ BaseSerialPortLibDebugCon.c -+ -+[Packages] -+ MdePkg/MdePkg.dec -+ OvmfPkg/OvmfPkg.dec -+ -+[LibraryClasses] -+ BaseLib -+ IoLib -+ PcdLib -+ -+[Pcd] -+ gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort ## CONSUMES -diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c -index d9f61757cf..cbf844df21 100644 ---- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c -+++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c -@@ -2020,6 +2020,12 @@ PlatformBootManagerUnableToBoot ( - EFI_BOOT_MANAGER_LOAD_OPTION BootManagerMenu; - UINTN Index; - -+ DEBUG (( -+ DEBUG_ERROR, -+ "%a: No bootable option or device was found. Falling back to Boot Manager Menu / EFI Shell.\n", -+ gEfiCallerBaseName -+ )); -+ - if (FeaturePcdGet (PcdBootRestrictToFirmware)) { - AsciiPrint ( - "%a: No bootable option was found.\n", -@@ -2034,6 +2040,12 @@ PlatformBootManagerUnableToBoot ( - // - Status = EfiBootManagerGetBootManagerMenu (&BootManagerMenu); - if (EFI_ERROR (Status)) { -+ DEBUG (( -+ DEBUG_ERROR, -+ "%a: Boot Manager Menu unavailable (Status = %r). System halted.\n", -+ gEfiCallerBaseName, -+ Status -+ )); - return; - } - -@@ -2066,6 +2078,12 @@ PlatformBootManagerUnableToBoot ( - } - } - -+ DEBUG (( -+ DEBUG_ERROR, -+ "%a: Entering Boot Manager Menu loop.\n", -+ gEfiCallerBaseName -+ )); -+ - for ( ; ;) { - EfiBootManagerBoot (&BootManagerMenu); - } -diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc -index 7ab6af3a69..b986ab13b5 100644 ---- a/OvmfPkg/OvmfPkgIa32.dsc -+++ b/OvmfPkg/OvmfPkgIa32.dsc -@@ -165,7 +165,11 @@ - CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf - OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf -+!ifdef $(DEBUG_ON_SERIAL_PORT) - SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf -+!else -+ SerialPortLib|OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf -+!endif - MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf - MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf -diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc -index e7fff78df9..a2535b548a 100644 ---- a/OvmfPkg/OvmfPkgIa32X64.dsc -+++ b/OvmfPkg/OvmfPkgIa32X64.dsc -@@ -170,7 +170,11 @@ - CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf - OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf -+!ifdef $(DEBUG_ON_SERIAL_PORT) - SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf -+!else -+ SerialPortLib|OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf -+!endif - MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf - MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf -diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc -index 556984bdaa..51e8fe2789 100644 ---- a/OvmfPkg/OvmfPkgX64.dsc -+++ b/OvmfPkg/OvmfPkgX64.dsc -@@ -182,7 +182,11 @@ - PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf - OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf -+!ifdef $(DEBUG_ON_SERIAL_PORT) - SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf -+!else -+ SerialPortLib|OvmfPkg/Library/BaseSerialPortLibDebugCon/BaseSerialPortLibDebugCon.inf -+!endif - MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf - MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf - CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf diff --git a/images/edk2/werf.inc.yaml b/images/edk2/werf.inc.yaml index 6858e6095c..ed80f0d4f5 100644 --- a/images/edk2/werf.inc.yaml +++ b/images/edk2/werf.inc.yaml @@ -75,7 +75,7 @@ shell: - | cd /src - echo "12345678" + echo "123456789" echo "Git clone Edk2 repository..." git clone \ From e280b5d07763888ec13ec0341b4f343dd9be381e Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Wed, 8 Apr 2026 10:01:41 +0300 Subject: [PATCH 6/8] t Signed-off-by: Valeriy Khorunzhin --- images/virt-artifact/werf.inc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index b5c41855d3..9516a63b35 100644 --- a/images/virt-artifact/werf.inc.yaml +++ b/images/virt-artifact/werf.inc.yaml @@ -16,7 +16,7 @@ shell: install: - | echo "Git clone {{ $gitRepoName }} repository..." - echo "kek2" + echo "kek23" git clone --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} --branch v1.6.2-virtualization-no-bootable /src/kubevirt rm -rf /src/kubevirt/.git From 0c3d53c455c15b201d9f97fa1dd2b30e7c5ae737 Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Wed, 8 Apr 2026 11:26:03 +0300 Subject: [PATCH 7/8] prerefactor Signed-off-by: Valeriy Khorunzhin --- api/core/v1alpha2/vmcondition/condition.go | 1 + .../pkg/controller/vm/internal/lifecycle.go | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/api/core/v1alpha2/vmcondition/condition.go b/api/core/v1alpha2/vmcondition/condition.go index 6abfecbe0c..0a7554ea0f 100644 --- a/api/core/v1alpha2/vmcondition/condition.go +++ b/api/core/v1alpha2/vmcondition/condition.go @@ -172,6 +172,7 @@ const ( ReasonPodTerminating RunningReason = "PodTerminating" ReasonPodNotFound RunningReason = "PodNotFound" ReasonPodConditionMissing RunningReason = "PodConditionMissing" + ReasonBootFailed RunningReason = "BootFailed" ReasonGuestNotRunning RunningReason = "GuestNotRunning" ) diff --git a/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go b/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go index 347068a476..5543d396bd 100644 --- a/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go +++ b/images/virtualization-artifact/pkg/controller/vm/internal/lifecycle.go @@ -193,6 +193,14 @@ func (h *LifeCycleHandler) syncRunning(ctx context.Context, vm *v1alpha2.Virtual if kvvmi != nil { vm.Status.Node = kvvmi.Status.NodeName + for _, c := range kvvmi.Status.Conditions { + if string(c.Type) == "BootFailed" { + cb.Reason(vmcondition.ReasonBootFailed).Status(metav1.ConditionFalse).Message(c.Reason) + conditions.SetCondition(cb, &vm.Status.Conditions) + return + } + } + if vm.Status.Phase == v1alpha2.MachineRunning { cb.Reason(vmcondition.ReasonVirtualMachineRunning).Status(metav1.ConditionTrue) conditions.SetCondition(cb, &vm.Status.Conditions) From 9c44bf70608214c295866e86f6998f51ac2e3c1e Mon Sep 17 00:00:00 2001 From: Valeriy Khorunzhin Date: Thu, 9 Apr 2026 10:32:37 +0300 Subject: [PATCH 8/8] build files refactoring Signed-off-by: Valeriy Khorunzhin --- ...atch => 001-isa-debug-port-no-bootable-device-message.patch} | 0 images/edk2/patches/README.md | 2 ++ images/edk2/werf.inc.yaml | 2 -- 3 files changed, 2 insertions(+), 2 deletions(-) rename images/edk2/patches/{0001-0x402.patch => 001-isa-debug-port-no-bootable-device-message.patch} (100%) create mode 100644 images/edk2/patches/README.md diff --git a/images/edk2/patches/0001-0x402.patch b/images/edk2/patches/001-isa-debug-port-no-bootable-device-message.patch similarity index 100% rename from images/edk2/patches/0001-0x402.patch rename to images/edk2/patches/001-isa-debug-port-no-bootable-device-message.patch diff --git a/images/edk2/patches/README.md b/images/edk2/patches/README.md new file mode 100644 index 0000000000..d67a2993ca --- /dev/null +++ b/images/edk2/patches/README.md @@ -0,0 +1,2 @@ +# 001-isa-debug-port-no-bootable-device-message.patch +If an EFI “No bootable device” error occurs, or the system drops into the EFI shell, output “No bootable device.” to the ISA debug port. \ No newline at end of file diff --git a/images/edk2/werf.inc.yaml b/images/edk2/werf.inc.yaml index ed80f0d4f5..686a9d016f 100644 --- a/images/edk2/werf.inc.yaml +++ b/images/edk2/werf.inc.yaml @@ -75,8 +75,6 @@ shell: - | cd /src - echo "123456789" - echo "Git clone Edk2 repository..." git clone \ --depth=1 $(cat /run/secrets/SOURCE_REPO)/{{ $gitRepoUrl }} \