Skip to content

Commit

Permalink
ArmVirtPkg/CI: Copy shell to virtual drive
Browse files Browse the repository at this point in the history
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
6862b9d.

Signed-off-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Mike Beaton <[email protected]>
  • Loading branch information
mikebeaton committed Sep 13, 2024
1 parent 9caa370 commit ee23a41
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ArmVirtPkg/PlatformCI/PlatformBuildLib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
import os
import shutil
import logging
import io

Expand Down Expand Up @@ -206,7 +207,8 @@ def PlatformPostBuild(self):
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")
Expand All @@ -217,6 +219,15 @@ def FlashRomImage(self):
additional = b'\0' * ((64 * 1024 * 1024)-fvfile.tell())
fvfile.write(additional)

# 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 that path

# Unique Command and Args parameters per ARCH
Expand Down

0 comments on commit ee23a41

Please sign in to comment.