diff options
author | Mike Beaton <mjsbeaton@gmail.com> | 2024-09-13 08:17:40 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2025-01-16 23:06:40 +0000 |
commit | 7d958e55a499f29733576a5862bb3136d1af995d (patch) | |
tree | cb89a5ec4d8af2c603a7b2068986d419ad22f478 | |
parent | e8de4716609c2ff3d239a28dabb012b73f52061a (diff) | |
download | edk2-7d958e55a499f29733576a5862bb3136d1af995d.tar.gz |
ArmVirtPkg/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 a follow up patch will exclude the shell from
secure boot enabled firmware images.
The same update was previously applied to OvmfPkg by
6862b9d538d96363635677198899e1669e591259.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
-rw-r--r-- | ArmVirtPkg/PlatformCI/PlatformBuildLib.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ArmVirtPkg/PlatformCI/PlatformBuildLib.py b/ArmVirtPkg/PlatformCI/PlatformBuildLib.py index 3abab09141..ccc61feaff 100644 --- a/ArmVirtPkg/PlatformCI/PlatformBuildLib.py +++ b/ArmVirtPkg/PlatformCI/PlatformBuildLib.py @@ -5,6 +5,7 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent
##
import os
+import shutil
import logging
import io
@@ -206,7 +207,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")
Built_FV = os.path.join(OutputPath_FV, "QEMU_EFI.fd")
@@ -217,7 +219,17 @@ class PlatformBuilder(UefiBuilder, BuildSettingsManager): additional = b'\0' * ((64 * 1024 * 1024)-fvfile.tell())
fvfile.write(additional)
- # QEMU must be on that path
+ # 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{"AA64" if arch == "AARCH64" else arch}.EFI')
+ if os.path.exists(src):
+ logging.info("copy %s -> %s", src, dst)
+ shutil.copyfile(src, dst)
+
+ # QEMU must be on the path
# Unique Command and Args parameters per ARCH
if (self.env.GetValue("TARGET_ARCH").upper() == "AARCH64"):
|