All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Nikita Ermakov <arei@altlinux.org>,
	Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Atish Patra <Atish.Patra@wdc.com>,
	Daniel Kiper <dkiper@net-space.pl>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	GRUB development mailing list <grub-devel@gnu.org>,
	Daniel Kiper <dkiper@net-space.pl>
Subject: Re: [PATCH 1/8] loader/linux: permit NULL argument for argv[] in grub_initrd_load()
Date: Fri, 28 May 2021 21:17:57 +0200	[thread overview]
Message-ID: <cc99e559-41aa-e823-b19b-bc82589928c1@gmx.de> (raw)
In-Reply-To: <20210528130457.13501-2-arei@altlinux.org>

On 5/28/21 3:04 PM, Nikita Ermakov wrote:
> From: Ard Biesheuvel <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 3fe390f17..8c0138177 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);

Why do we need the argv[] argument at all? Can't we always print
initrd_ctx->components[i].file->name?

Best regards

Heinrich

>   	  grub_initrd_close (initrd_ctx);
>   	  return grub_errno;
>   	}
>



  reply	other threads:[~2021-05-28 19:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28 13:04 [PATCH 0/8] Add LoadFile2 and riscv Linux loader Nikita Ermakov
2021-05-28 13:04 ` [PATCH 1/8] loader/linux: permit NULL argument for argv[] in grub_initrd_load() Nikita Ermakov
2021-05-28 19:17   ` Heinrich Schuchardt [this message]
2021-05-28 13:04 ` [PATCH 2/8] efi: add definition of LoadFile2 protocol Nikita Ermakov
2021-05-28 19:27   ` Heinrich Schuchardt
2021-05-28 13:04 ` [PATCH 3/8] efi: implemented LoadFile2 initrd loading protocol for Linux Nikita Ermakov
2021-05-28 19:49   ` Heinrich Schuchardt
2021-05-28 13:04 ` [PATCH 4/8] linux: ignore FDT unless we need to modify it Nikita Ermakov
2021-05-28 13:04 ` [PATCH 5/8] loader: Move arm64 linux loader to common code Nikita Ermakov
2021-05-28 13:04 ` [PATCH 6/8] RISC-V: Update image header Nikita Ermakov
2021-05-28 13:04 ` [PATCH 7/8] RISC-V: Use common linux loader Nikita Ermakov
2021-05-28 13:04 ` [PATCH 8/8] linux: Make load_file2_guid and device_path_guid static Nikita Ermakov
2021-05-28 19:54   ` Heinrich Schuchardt

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=cc99e559-41aa-e823-b19b-bc82589928c1@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=Atish.Patra@wdc.com \
    --cc=ard.biesheuvel@arm.com \
    --cc=arei@altlinux.org \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=leif.lindholm@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.