From: Ard Biesheuvel <ard.biesheuvel@arm.com>
To: linux-efi@vger.kernel.org
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>,
grub-devel@gnu.org, daniel.kiper@oracle.com, leif@nuviainc.com
Subject: [PATCH 1/4] loader/linux: permit NULL argument for argv[] in grub_initrd_load()
Date: Fri, 23 Oct 2020 14:08:22 +0200 [thread overview]
Message-ID: <20201023120825.30466-2-ard.biesheuvel@arm.com> (raw)
In-Reply-To: <20201023120825.30466-1-ard.biesheuvel@arm.com>
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>
---
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
next prev parent reply other threads:[~2020-10-23 13:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-23 12:08 [PATCH 0/4] linux: implement LoadFile2 initrd loading Ard Biesheuvel
2020-10-23 12:08 ` Ard Biesheuvel [this message]
2020-10-23 12:08 ` [PATCH 2/4] efi: add definition of LoadFile2 protocol Ard Biesheuvel
2020-10-23 12:08 ` [PATCH 3/4] efi: implemented LoadFile2 initr loading protocol for Linux Ard Biesheuvel
2020-10-23 12:32 ` Leif Lindholm
2020-10-23 17:02 ` Ard Biesheuvel
2020-10-23 12:08 ` [PATCH 4/4] linux: ignore FDT unless we need to modify it Ard Biesheuvel
2020-10-23 12:47 ` Leif Lindholm
2020-10-23 13:12 ` Ard Biesheuvel
2020-10-23 13:16 ` Leif Lindholm
2020-10-23 12:50 ` [PATCH 0/4] linux: implement LoadFile2 initrd loading Leif Lindholm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201023120825.30466-2-ard.biesheuvel@arm.com \
--to=ard.biesheuvel@arm.com \
--cc=daniel.kiper@oracle.com \
--cc=grub-devel@gnu.org \
--cc=leif@nuviainc.com \
--cc=linux-efi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox