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>
This commit is contained in:
Mike Beaton 2024-09-13 08:17:40 +01:00
parent 3feeca4e8c
commit a6631d1e6b
1 changed files with 14 additions and 2 deletions

View File

@ -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"):