OvmfPkg: add 'initrd' shell command to expose Linux initrd via device path

Add a new 'initrd' command to the UEFI Shell that allows any file that is
accessible to the shell to be registered as the initrd that is returned
when Linux's EFI stub loader invokes the LoadFile2 protocol on its special
vendor media device path.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2564
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
Ard Biesheuvel
2020-02-26 20:43:39 +01:00
committed by mergify[bot]
parent 15bee1937f
commit 2632178bc6
3 changed files with 531 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
## @file
# Provides 'initrd' dynamic UEFI shell command to load a Linux initrd
# via its GUIDed vendor media path
#
# Copyright (c) 2020, Arm, Ltd. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
#
##
[Defines]
INF_VERSION = 1.27
BASE_NAME = LinuxInitrdDynamicShellCommand
FILE_GUID = 2f30da26-f51b-4b6f-85c4-31873c281bca
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = LinuxInitrdDynamicShellCommandEntryPoint
UNLOAD_IMAGE = LinuxInitrdDynamicShellCommandUnload
UEFI_HII_RESOURCE_SECTION = TRUE
#
# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 EBC
#
[Sources.common]
LinuxInitrdDynamicShellCommand.c
LinuxInitrdDynamicShellCommand.uni
[Packages]
MdePkg/MdePkg.dec
ShellPkg/ShellPkg.dec
MdeModulePkg/MdeModulePkg.dec
OvmfPkg/OvmfPkg.dec
[LibraryClasses]
DebugLib
DevicePathLib
HiiLib
MemoryAllocationLib
ShellLib
UefiBootServicesTableLib
UefiDriverEntryPoint
UefiHiiServicesLib
[Protocols]
gEfiDevicePathProtocolGuid ## SOMETIMES_PRODUCES
gEfiHiiPackageListProtocolGuid ## CONSUMES
gEfiLoadFile2ProtocolGuid ## SOMETIMES_PRODUCES
gEfiShellDynamicCommandProtocolGuid ## PRODUCES
[DEPEX]
TRUE