mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-25 00:52:45 -04:00
efi/libstub: Make initrd file loader configurable
Loading an initrd passed via the kernel command line is deprecated: it is limited to files that reside in the same volume as the one the kernel itself was loaded from, and we have more flexible ways to achieve the same. So make it configurable so new architectures can decide not to enable it. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
@@ -121,13 +121,13 @@ static int find_file_option(const efi_char16_t *cmdline, int cmdline_len,
|
||||
* We only support loading a file from the same filesystem as
|
||||
* the kernel image.
|
||||
*/
|
||||
static efi_status_t handle_cmdline_files(efi_loaded_image_t *image,
|
||||
const efi_char16_t *optstr,
|
||||
int optstr_size,
|
||||
unsigned long soft_limit,
|
||||
unsigned long hard_limit,
|
||||
unsigned long *load_addr,
|
||||
unsigned long *load_size)
|
||||
efi_status_t handle_cmdline_files(efi_loaded_image_t *image,
|
||||
const efi_char16_t *optstr,
|
||||
int optstr_size,
|
||||
unsigned long soft_limit,
|
||||
unsigned long hard_limit,
|
||||
unsigned long *load_addr,
|
||||
unsigned long *load_size)
|
||||
{
|
||||
const efi_char16_t *cmdline = image->load_options;
|
||||
int cmdline_len = image->load_options_size / 2;
|
||||
@@ -239,21 +239,3 @@ err_close_volume:
|
||||
efi_free(alloc_size, alloc_addr);
|
||||
return status;
|
||||
}
|
||||
|
||||
efi_status_t efi_load_dtb(efi_loaded_image_t *image,
|
||||
unsigned long *load_addr,
|
||||
unsigned long *load_size)
|
||||
{
|
||||
return handle_cmdline_files(image, L"dtb=", sizeof(L"dtb=") - 2,
|
||||
ULONG_MAX, ULONG_MAX, load_addr, load_size);
|
||||
}
|
||||
|
||||
efi_status_t efi_load_initrd(efi_loaded_image_t *image,
|
||||
unsigned long *load_addr,
|
||||
unsigned long *load_size,
|
||||
unsigned long soft_limit,
|
||||
unsigned long hard_limit)
|
||||
{
|
||||
return handle_cmdline_files(image, L"initrd=", sizeof(L"initrd=") - 2,
|
||||
soft_limit, hard_limit, load_addr, load_size);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user