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/edk2/patches/001-isa-debug-port-no-bootable-device-message.patch b/images/edk2/patches/001-isa-debug-port-no-bootable-device-message.patch new file mode 100644 index 0000000000..c87c0b0da3 --- /dev/null +++ b/images/edk2/patches/001-isa-debug-port-no-bootable-device-message.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/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 452ae9fe18..686a9d016f 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: @@ -90,6 +97,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 }} diff --git a/images/virt-artifact/werf.inc.yaml b/images/virt-artifact/werf.inc.yaml index f30560fba6..9516a63b35 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 "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 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)