grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v2 1/1] kern/dl: Add module version check


From: Zhang Boyang
Subject: Re: [RFC PATCH v2 1/1] kern/dl: Add module version check
Date: Fri, 23 Dec 2022 16:18:43 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1

Hi,

On 2022/12/22 14:31, Glenn Washburn wrote:
On Wed, 21 Dec 2022 20:11:57 +0800
Zhang Boyang <zhangboyang.id@gmail.com> wrote:
+      grub_printf_ (N_("warning: module %.63s has incorrect version:
%.63s != %s\n"),
+                   mod->name, modver, PACKAGE_VERSION);

I don't quite like this, but I could live with it. I mostly don't like
it because I don't want to get spammed with a lot of these warning
messages. But maybe this is the best of the bad set of options.


I sent a V3 patch at https://lists.gnu.org/archive/html/grub-devel/2022-12/msg00280.html , in which can disable this warning at build time, however I personally don't like it.

I think preloading modules is a good solution for you. e.g. run `insmod foobar` before switching $root/$prefix. This also eliminate the possibility of GRUB crashing because of mismatched modules. For a comprehensive list of modules, please see $GRUB_MODULES in https://salsa.debian.org/grub-team/grub/-/blob/master/debian/build-efi-images

If you think this solution is good to you, I want to drop V3 and submit a improved V2 as V4, because it's cleaner.

One thing to note is I believe that this will take GRUB out
of graphical mode and put it into text mode. This doesn't affect me
(right now) though.


I tested on i386-pc and x86_64-efi and there is no such behavior.

Another thing is that, for the use case of loading a grub.cfg from a
different GRUB installation, this message from version mismatched
modules loaded in the sourcing of the script will be displayed for a
fraction of a second until the menu from the sourced grub.cfg is
displayed. So it may not be helpful for the user.


What about adding a 100ms sleep when the warning is displayed? By the way, this can also be workaround by preloading modules.

This isn't likely an issue for loopback.cfg because usually the module
loading is done implicitly and all the commands are generally inside
the menu entries. In this case, printing to the screen seems like a
good idea because directly after the module loading the commands will
run, which might crash GRUB. So if the crash hangs the machine the user
will see this message and have a clue.


Best Regards,
Zhang Boyang

Glenn




reply via email to

[Prev in Thread] Current Thread [Next in Thread]