Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1p8dGZ-0005fj-U3 for mharc-grub-devel@gnu.org; Fri, 23 Dec 2022 03:18:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p8dGX-0005fG-9J for grub-devel@gnu.org; Fri, 23 Dec 2022 03:18:53 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p8dGU-0006R6-Ms for grub-devel@gnu.org; Fri, 23 Dec 2022 03:18:52 -0500 Received: by mail-pj1-x1032.google.com with SMTP id gt4so4354228pjb.1 for ; Fri, 23 Dec 2022 00:18:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=1xvMUJn8SSJSx5eIzckGLblGGBy0R5B+DmjnYDK61ds=; b=K6ZiQdUZoFMDzUFVobVn6Zw2TAeFEgpN3EwphEW7GztgVzVqTneF09F+UJe0crNsUy 4hfe1jExOx+xNvYfYvN5ExXTa3XLRemZSBX6zyNGWF6CMOulIvnjmKZlG0riSF/3k5gz XB8GWgT6t+V9p2E/TwMgfhQb0U0bqusBl1VgESqmOWYtAu67L92IUjd8/OsuWgt0Jg+7 TrJ5cXmLz4s0bYMkEdZSUZse/7NKbRPbpZwWMG2CwMjdR0ZySwzeroblvx3k5hCf5+cx Kbhd9lwYdnxHt3y35quo9QRTIUw2tSHxvOJcVWvaY+8GbNyZm3SMXKdT1NlEimeDWQd6 uzLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1xvMUJn8SSJSx5eIzckGLblGGBy0R5B+DmjnYDK61ds=; b=VqrUO+3XxsHkLG3tTVIP11Xlll4hEPBgQWKXUkgK7gclBye8CpVmcv6n+zhoPXjfL/ UtFBTO8oevhnGeAI49lYLSpnXw93NZFpPZRRXg6wLZku7IbwW9uOWgIZXXifRYwpwdZf yvMrL6DEwayh2aocxeX9CleXiyFgrHzhgdChkObWMtRNlr5MEZWp+G/busyh9zYSz714 hgbjkOc1GmRFPejjF5Ydi3Nz4wJ3XG1DYIwinCtv3mx2fc/739RuUZms6v4tDbwok3Xq 26RmY6GHfejGpowLmPrYZzc2kCzWFoE2DT9pfVkDSb7Xs0/30RsbuJHvpBZcSqO+lulu yKgA== X-Gm-Message-State: AFqh2kqHHayI1UtunQYfBktr0n6KZ7fn25umBwvVaEWKPNR59tv+cLZo mHd62t0SOmdHQ869DNBn9UE= X-Google-Smtp-Source: AMrXdXuDcQD89apXheAvisDXd5VEH+uf/ZihZWPa9U/G45k4Wtbl7E3mH2sQXJGP+9L57rtC+FHngw== X-Received: by 2002:a17:90a:309:b0:223:7513:adfd with SMTP id 9-20020a17090a030900b002237513adfdmr9983501pje.3.1671783529029; Fri, 23 Dec 2022 00:18:49 -0800 (PST) Received: from [0.0.0.0] (ec2-13-113-80-70.ap-northeast-1.compute.amazonaws.com. [13.113.80.70]) by smtp.gmail.com with ESMTPSA id 31-20020a63145f000000b0047048c201e3sm1841413pgu.33.2022.12.23.00.18.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Dec 2022 00:18:48 -0800 (PST) Message-ID: <788ab27b-e708-8de4-a980-20b9e612af7a@gmail.com> Date: Fri, 23 Dec 2022 16:18:43 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [RFC PATCH v2 1/1] kern/dl: Add module version check Content-Language: en-US To: development@efficientek.com Cc: grub-devel@gnu.org, dkiper@net-space.pl, rharwood@redhat.com, pete@akeo.ie, scdbackup@gmx.net, didier@slint.fr References: <20221221121157.121707-1-zhangboyang.id@gmail.com> <20221222003142.7f6b96d0@crass-HP-ZBook-15-G2> From: Zhang Boyang In-Reply-To: <20221222003142.7f6b96d0@crass-HP-ZBook-15-G2> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=zhangboyang.id@gmail.com; helo=mail-pj1-x1032.google.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-1.148, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2022 08:18:53 -0000 Hi, On 2022/12/22 14:31, Glenn Washburn wrote: > On Wed, 21 Dec 2022 20:11:57 +0800 > Zhang Boyang 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 >