On Thu, 25 Aug 2022 12:24:17 +0800
Michael Chang <mch...@suse.com> wrote:
<...> 
> Apparently there's missing grub_set_install_backup_ponr between
> successful image embedding and grub_install_register_ieee1275 and we
> should fix that as well.

Thanks for the feedback; I've sent v2.

<...>
> > +  if (linux_kmod_load("nvram"))
> > +    grub_util_error (_("%s: kernel module not found"), "nvram");
> > +  fd = open ("/dev/nvram", O_RDWR);
> > +  if (fd == -1)
> > +    grub_util_error ("/dev/nvram: %s", strerror(errno));
<...> 
> I'm wondering why it is needed. The nvram module should be loaded
> on-demand via linux kernel's request_module() and modalias trick
> whever /dev/nvram is accessed.

It was based on another patch that did so but without the extra
checking, I guess both are wrong.

It's enough checking /dev/nvram is operational; it's necessary
to fail early because other commands down the line may get ENODEV if
the module fails to load (e.g. the file may have been removed). I moved
this to an earlier point in grub-install.

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to