AmdSevBuild.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # @file
  2. # Script to Build OVMF UEFI firmware
  3. #
  4. # Copyright (c) Microsoft Corporation.
  5. # SPDX-License-Identifier: BSD-2-Clause-Patent
  6. ##
  7. import os
  8. import sys
  9. import subprocess
  10. sys.path.append(os.path.dirname(os.path.abspath(__file__)))
  11. from PlatformBuildLib import SettingsManager
  12. from PlatformBuildLib import PlatformBuilder
  13. # ####################################################################################### #
  14. # Common Configuration #
  15. # ####################################################################################### #
  16. class CommonPlatform():
  17. ''' Common settings for this platform. Define static data here and use
  18. for the different parts of stuart
  19. '''
  20. PackagesSupported = ("OvmfPkg",)
  21. ArchSupported = ("X64",)
  22. TargetsSupported = ("DEBUG", "RELEASE", "NOOPT")
  23. Scopes = ('ovmf', 'edk2-build')
  24. WorkspaceRoot = os.path.realpath(os.path.join(
  25. os.path.dirname(os.path.abspath(__file__)), "..", ".."))
  26. @classmethod
  27. def GetDscName(cls, ArchCsv: str) -> str:
  28. ''' return the DSC given the architectures requested.
  29. ArchCsv: csv string containing all architectures to build
  30. '''
  31. return "AmdSev/AmdSevX64.dsc"
  32. import PlatformBuildLib
  33. PlatformBuildLib.CommonPlatform = CommonPlatform
  34. # hack alert -- create dummy grub.efi
  35. subprocess.run(['touch', 'OvmfPkg/AmdSev/Grub/grub.efi'])
  36. subprocess.run(['ls', '-l', '--sort=time', 'OvmfPkg/AmdSev/Grub'])