summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2024-02-22 11:13:57 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-02-25 17:38:07 +0000
commitbc982869dd3e69ffd374fd968d378b5d954f66e8 (patch)
treeedbab72a43eeae28bcd60f21a43eed0cd8a26345
parent8d7c48e0e7e4fbf202226561ae4f2aa214cdfdbe (diff)
downloadedk2-bc982869dd3e69ffd374fd968d378b5d954f66e8.tar.gz
edk2-bc982869dd3e69ffd374fd968d378b5d954f66e8.tar.bz2
edk2-bc982869dd3e69ffd374fd968d378b5d954f66e8.zip
OvmfPkg/CI: copy shell to virtual drive
Place the EFI shell as EFI/BOOT/BOOT{ARCH}.EFI on the virtual drive. This allows the "run to shell" CI test case to work even in case the shell is not included in the firmware image. This is needed because an followup patch will exclude the shell from secure boot enabled firmware images. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jiewen Yao <Jiewen.yao@intel.com> Message-Id: <20240222101358.67818-12-kraxel@redhat.com>
-rw-r--r--OvmfPkg/PlatformCI/PlatformBuildLib.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/OvmfPkg/PlatformCI/PlatformBuildLib.py b/OvmfPkg/PlatformCI/PlatformBuildLib.py
index f829738cdd..00d454954b 100644
--- a/OvmfPkg/PlatformCI/PlatformBuildLib.py
+++ b/OvmfPkg/PlatformCI/PlatformBuildLib.py
@@ -5,6 +5,7 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
import os
+import shutil
import logging
import io
@@ -181,7 +182,8 @@ class PlatformBuilder( UefiBuilder, BuildSettingsManager):
def FlashRomImage(self):
VirtualDrive = os.path.join(self.env.GetValue("BUILD_OUTPUT_BASE"), "VirtualDrive")
- os.makedirs(VirtualDrive, exist_ok=True)
+ VirtualDriveBoot = os.path.join(VirtualDrive, "EFI", "BOOT")
+ os.makedirs(VirtualDriveBoot, exist_ok=True)
OutputPath_FV = os.path.join(self.env.GetValue("BUILD_OUTPUT_BASE"), "FV")
if (self.env.GetValue("QEMU_SKIP") and
@@ -189,6 +191,14 @@ class PlatformBuilder( UefiBuilder, BuildSettingsManager):
logging.info("skipping qemu boot test")
return 0
+ # copy shell to VirtualDrive
+ for arch in self.env.GetValue("TARGET_ARCH").split():
+ src = os.path.join(self.env.GetValue("BUILD_OUTPUT_BASE"), arch, "Shell.efi")
+ dst = os.path.join(VirtualDriveBoot, f'BOOT{arch}.EFI')
+ if os.path.exists(src):
+ logging.info("copy %s -> %s", src, dst)
+ shutil.copyfile(src, dst)
+
#
# QEMU must be on the path
#