[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/8] loader/linux: permit NULL argument for argv[] in grub_ini
From: |
Ard Biesheuvel |
Subject: |
[PATCH v2 2/8] loader/linux: permit NULL argument for argv[] in grub_initrd_load() |
Date: |
Sun, 25 Oct 2020 14:49:35 +0100 |
grub_initrd_load() takes a char *argv[] argument which is only used
when an error occurs, to print the name of the file that caused the
error. In order to be able to split initrd loading from handling the
initrd command, let's permit argv to be NULL, and fall back to the
file names recorded in the file handles.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
---
grub-core/loader/linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c
index 3fe390f17ec6..8c01381778c6 100644
--- a/grub-core/loader/linux.c
+++ b/grub-core/loader/linux.c
@@ -317,7 +317,7 @@ grub_initrd_load (struct grub_linux_initrd_context
*initrd_ctx,
{
if (!grub_errno)
grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file
%s"),
- argv[i]);
+ argv ? argv[i] : initrd_ctx->components[i].file->name);
grub_initrd_close (initrd_ctx);
return grub_errno;
}
--
2.17.1
- [PATCH v2 0/8] linux: implement LoadFile2 initrd loading, Ard Biesheuvel, 2020/10/25
- [PATCH v2 1/8] linux/arm: fix ARM Linux header layout, Ard Biesheuvel, 2020/10/25
- [PATCH v2 2/8] loader/linux: permit NULL argument for argv[] in grub_initrd_load(),
Ard Biesheuvel <=
- [PATCH v2 3/8] efi: move MS-DOS stub out of generic PE header definition, Ard Biesheuvel, 2020/10/25
- [PATCH v2 4/8] linux/arm: unify ARM/arm64 vs Xen PE/COFF header handling, Ard Biesheuvel, 2020/10/25
- [PATCH v2 5/8] linux/arm: account for COFF headers appearing at unexpected offsets, Ard Biesheuvel, 2020/10/25
- [PATCH v2 6/8] efi: add definition of LoadFile2 protocol, Ard Biesheuvel, 2020/10/25
- [PATCH v2 7/8] efi: implement LoadFile2 initrd loading protocol for Linux, Ard Biesheuvel, 2020/10/25
- [PATCH v2 8/8] linux: ignore FDT unless we need to modify it, Ard Biesheuvel, 2020/10/25