diff --git a/images/edk2/patches/0001-OvmfPkg-write-no-bootable-device-to-ISA-debugcon-po.patch b/images/edk2/patches/0001-OvmfPkg-write-no-bootable-device-to-ISA-debugcon-po.patch new file mode 100644 index 0000000000..15ce4a2226 --- /dev/null +++ b/images/edk2/patches/0001-OvmfPkg-write-no-bootable-device-to-ISA-debugcon-po.patch @@ -0,0 +1,62 @@ +From: Deckhouse Virtualization +Date: Thu, 3 Apr 2026 00:00:00 +0000 +Subject: [PATCH] OvmfPkg: write "no bootable device" event to ISA debugcon port + +Write a short diagnostic message to I/O port 0x402 (QEMU isa-debugcon) +when PlatformBootManagerUnableToBoot() is called. This allows external +monitoring tools (e.g. KubeVirt virt-launcher) to detect VM boot +failures via the debugcon socket without requiring a DEBUG build. + +Unlike the DEBUG() macro, IoWrite8() is not compiled out in RELEASE +builds, so the message is always emitted regardless of build type. + +--- + OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 14 ++++++++++++++ + OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 1 + + 2 files changed, 15 insertions(+) + +diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +index 1234567..abcdefg 100644 +--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c ++++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +@@ -12,6 +12,7 @@ + #include + #include + #include + #include + #include ++#include + +@@ -2018,6 +2019,17 @@ PlatformBootManagerUnableToBoot ( + EFI_STATUS Status; + EFI_INPUT_KEY Key; + EFI_BOOT_MANAGER_LOAD_OPTION BootManagerMenu; + UINTN Index; + ++ // ++ // Write boot failure event to ISA debugcon port (0x402). ++ // Captured by QEMU isa-debugcon device. Works in RELEASE builds ++ // unlike the DEBUG() macro which is compiled out in RELEASE. ++ // ++ { ++ CONST CHAR8 *DebugMsg = "BdsDxe: No bootable option or device was found.\r\n"; ++ ++ while (*DebugMsg != '\0') { ++ IoWrite8 (0x402, (UINT8)*DebugMsg++); ++ } ++ } ++ + if (FeaturePcdGet (PcdBootRestrictToFirmware)) { + AsciiPrint ( + "%a: No bootable option was found.\n", +diff --git a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +index 1234567..abcdefg 100644 +--- a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf ++++ b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +@@ -43,6 +43,7 @@ + DevicePathLib + PciLib ++ IoLib + NvVarsFileLib + QemuFwCfgLib + QemuFwCfgS3Lib diff --git a/images/edk2/werf.inc.yaml b/images/edk2/werf.inc.yaml index 452ae9fe18..20059e68b3 100644 --- a/images/edk2/werf.inc.yaml +++ b/images/edk2/werf.inc.yaml @@ -60,6 +60,13 @@ git: stageDependencies: install: - '*.bin' +- add: {{ .ModuleDir }}/images/{{ .ImageName }}/patches + to: /src/patches + includePaths: + - '*.patch' + stageDependencies: + install: + - '*.patch' secrets: - id: SOURCE_REPO value: {{ $.SOURCE_REPO_GIT }} @@ -90,6 +97,12 @@ shell: submodule update --init --recursive --depth=1 fi + echo "Applying custom patches..." + for p in /src/patches/*.patch; do + echo "Applying $p ..." + git apply "$p" + done + --- image: {{ .ModuleNamePrefix }}{{ .ImageName }} diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index f30560fba6..b5c41855d3 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 "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