From unknown Mon Jun 16 23:27:21 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#44898 <44898@debbugs.gnu.org> To: bug#44898 <44898@debbugs.gnu.org> Subject: Status: [wishlist] Make the GRUB installation procedure smarter Reply-To: bug#44898 <44898@debbugs.gnu.org> Date: Tue, 17 Jun 2025 06:27:21 +0000 retitle 44898 [wishlist] Make the GRUB installation procedure smarter reassign 44898 guix submitter 44898 guixuser6392 severity 44898 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 26 20:26:22 2020 Received: (at submit) by debbugs.gnu.org; 27 Nov 2020 01:26:22 +0000 Received: from localhost ([127.0.0.1]:43339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kiSWj-0006F4-JT for submit@debbugs.gnu.org; Thu, 26 Nov 2020 20:26:22 -0500 Received: from lists.gnu.org ([209.51.188.17]:36470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kiQUn-00011p-6z for submit@debbugs.gnu.org; Thu, 26 Nov 2020 18:16:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiQUm-0002lB-Lc for bug-guix@gnu.org; Thu, 26 Nov 2020 18:16:13 -0500 Received: from mail-40135.protonmail.ch ([185.70.40.135]:18583) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kiQUh-0001p1-0K for bug-guix@gnu.org; Thu, 26 Nov 2020 18:16:12 -0500 Date: Thu, 26 Nov 2020 23:15:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1606432561; bh=EQLLR+rJSf5bbL24GCYDQY/ZbKIPlCXSYNZOCuhaoYE=; h=Date:To:From:Reply-To:Subject:From; b=fxOKqt41BnKKTB64TWZsVgBxQ76Ah5Fd9oj0rWFMUgSjpNCSOj2LUrBnxIuJES0B0 9re2wp9dzfGsk/x63zxSdf3t3WpbJE/O4pqwOc2Wjxr/EjqtTpMY9SekwOXV9/tbkf 6B7FlefvPM581em6e4qLGn9X/3Zs0I3Nz5f2c0VI= To: "bug-guix@gnu.org" From: guixuser6392 Subject: [wishlist] Make the GRUB installation procedure smarter Message-ID: <8xxH7oMlchpQqTKfkQXnJPhhoetZDQbFldlVKSNNlELUWA_WMMr3PLEjlUhsjrDQkWPwAinml4aAgLDArwcjehjdt0WrWOh9mPej2TxLgAE=@protonmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.7 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,FREEMAIL_REPLYTO_END_DIGIT shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Received-SPF: pass client-ip=185.70.40.135; envelope-from=guixuser6392@protonmail.com; helo=mail-40135.protonmail.ch X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLYTO_END_DIGIT=0.25, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 26 Nov 2020 20:26:20 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: guixuser6392 Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.8 (-) Every time the operating system is instantiated the GRUB boot-loader is ine= xplicitly re-installed. This behaviour leads to unsolicited changes to the = user's boot configuration on UEFI systems; and leads to unnecessary write o= perations on the ESP, and/or the MBR, which, in case they are abruptly abor= ted during the building of the install-bootloader derivation, can leave the= system in an unbootable state. Futhermore, frequent writes to the platform= 's NV-RAM may negatively impact its lifespan. NixOS stores the GRUB derivation as well as boot parameters in a state file= , and only re-installs the boot-loader if the computed state is different f= rom the stored state: https://github.com/NixOS/nixpkgs/blob/master/nixos/mo= dules/system/boot/loader/grub/install-grub.pl#L626. However, unless I am mi= staken, that alone will not prevent GRUB from altering the user's boot conf= iguration in a scenario, in which we want GRUB to be re-installed because i= t has received an update. To summarize, I think that consecutive grub-install invocations should not = be allowed to modify the user's boot configuration on UEFI systems, and tha= t we should teach Guix to only re-install the boot-loader if the boot param= eters has been changed and/or the GRUB package has been upgraded. Although other boot-loaders are not in the scope of this wish, brining thei= r installation procedures to the same high standard would be beneficial, to= o. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 27 16:42:34 2020 Received: (at 44898) by debbugs.gnu.org; 27 Nov 2020 21:42:34 +0000 Received: from localhost ([127.0.0.1]:46370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kilVh-0007Fd-M9 for submit@debbugs.gnu.org; Fri, 27 Nov 2020 16:42:34 -0500 Received: from mail-40132.protonmail.ch ([185.70.40.132]:12953) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kijvW-0002ia-F0 for 44898@debbugs.gnu.org; Fri, 27 Nov 2020 15:01:10 -0500 Date: Fri, 27 Nov 2020 20:00:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1606507259; bh=GdZYJ13slKI5nkuPDDcByh88Mi+qTx1o1XTSSISdIL4=; h=Date:To:From:Reply-To:Subject:From; b=PwtMKYVUmcyyPchouPYp4OlbEyW94fJpf0QdD7pkhGflhTG8T+Ck7D9Y3BLw8UIvr qVjigkNi7d+XZHoToIUrdQQbqJbZDfCd8Hf06GGsmXINYDNWgdbmVlcugbQo0cuNRr 1PkYkx5YX9/7LzvjCBwyRZ9PRoWf9e9U9RpkfcbU= To: "44898@debbugs.gnu.org" <44898@debbugs.gnu.org> From: guixuser6392 Subject: (No Subject) Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.7 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,FREEMAIL_REPLYTO_END_DIGIT shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I would like to clarify that whenever I wrote "boot parameters", I meant installation arguments passed to grub-install. Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 SLIGHTLY_BAD_SUBJECT Subject contains something slightly spammy 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [185.70.40.132 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (guixuser6392[at]protonmail.com) 0.2 FREEMAIL_REPLYTO_END_DIGIT Reply-To freemail username ends in digit (guixuser6392[at]protonmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (guixuser6392[at]protonmail.com) 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 44898 X-Mailman-Approved-At: Fri, 27 Nov 2020 16:42:32 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: guixuser6392 Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: I would like to clarify that whenever I wrote "boot parameters", I meant installation arguments passed to grub-install. Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 SLIGHTLY_BAD_SUBJECT Subject contains something slightly spammy -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [185.70.40.132 listed in wl.mailspike.net] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (guixuser6392[at]protonmail.com) 0.2 FREEMAIL_REPLYTO_END_DIGIT Reply-To freemail username ends in digit (guixuser6392[at]protonmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (guixuser6392[at]protonmail.com) 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager I would like to clarify that whenever I wrote "boot parameters", I meant in= stallation arguments passed to grub-install. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 04 21:50:41 2021 Received: (at 44898) by debbugs.gnu.org; 5 Sep 2021 01:50:41 +0000 Received: from localhost ([127.0.0.1]:48898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMhIv-00020l-0m for submit@debbugs.gnu.org; Sat, 04 Sep 2021 21:50:41 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:35546) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMhIs-00020X-OB for 44898@debbugs.gnu.org; Sat, 04 Sep 2021 21:50:39 -0400 Received: by mail-wr1-f43.google.com with SMTP id i6so4281681wrv.2 for <44898@debbugs.gnu.org>; Sat, 04 Sep 2021 18:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muradm-net.20150623.gappssmtp.com; s=20150623; h=user-agent:from:to:subject:date:message-id:mime-version; bh=DXQf8xaMUFdRnYxF3RTToGXq9aZ2nYaa8z4cORuMQoc=; b=XFGUmwQAJIphYUhnc6FBrVX8S8jW9zpZ8NiIom4TYEL9lLFQ9EyL2lyadBmoiimsk0 M6wEvS5TAqIZV3Kx94i5eS6krGD2DfSltzn/bY2VP9h475Dv8h5icm193l70GcOemPqd +zktqhvmEWpT3DgORYxZEFkgJNCecb60/Sno8WlSnFXsI6aPxqc8GTyDObHkBZYetAM9 Uy7VXZJMMQjRcrGmxUN2Dax6jfqQ5+D31AhQu3DOrQqlw3CtqF4BZVMs8JBf4MU6Xl4+ 2AR1bxQpULe65dIcIxaI+FssLefvoXGXCXOXX/UztHO/ydfipxAp634GR0OIll2cbEsR RMwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=DXQf8xaMUFdRnYxF3RTToGXq9aZ2nYaa8z4cORuMQoc=; b=MwUM0FD6qsq2dk4QWrNK0Y+SqEkSiJcSICuWdQ0qXU9VJAFmtoIIx14PIoA5O7YM4b 6uU8pqsbrXEvGuxP6MmL6/FRwT7Fyi2gRxZ+4XzLYkK6GtZ/G0RGq5mmsRJ/QpoB4Ms9 P45FUyJqKlwVj39yhAOwL4ky/PDLcPxNBVWRLpJP/4FXRvvIbtkVRGNyck18GmHDOX3l mJIXL8hGthVsfIKkL67Uh5cd2iIruZaWXcJSkt0DqnegKt9OrGJ4VN6ldywK9OSIGmce gFLT83CHrKYwHeIwaWdqO4GjkZBaDH9aBZDKHfM0+UHgMy7074nF3qlO7vZlNwtFnxTD iYog== X-Gm-Message-State: AOAM532jMcWFUuc0mB1Y/7I7vx12PCWiP28o8aOcuF274GI1QwugH+AZ 4DY5SrqILHs+A6bZdW5EdwrtYpfUpNj9DQ38 X-Google-Smtp-Source: ABdhPJx/FQ7BQGHZ5JmH+VhU+dKdZcc6+dufAQttTUlhdcJSutlldADaqNekmbc6mTkKnWRaPUKK8g== X-Received: by 2002:adf:e4ce:: with SMTP id v14mr6218555wrm.49.1630806632018; Sat, 04 Sep 2021 18:50:32 -0700 (PDT) Received: from nomad-lp1 ([176.234.10.27]) by smtp.gmail.com with ESMTPSA id t64sm3242758wma.48.2021.09.04.18.50.30 for <44898@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Sep 2021 18:50:31 -0700 (PDT) User-agent: mu4e 1.6.5; emacs 28.0.50 From: muradm To: 44898@debbugs.gnu.org Subject: RE: [wishlist] Make the GRUB installation procedure smarter Date: Sun, 05 Sep 2021 04:27:25 +0300 Message-ID: <875yvf94f1.fsf@muradm.net> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 44898 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) First I was using Guix on Lenovo Carbon X1 in parallel with Arch. Few times I experiences "NVRAM full" or similar problem, I don't recall now. Solution was to reset NVRAM by some procedure. Half a year now, I moved to System76 Lemur Pro, where I have only Guix alone. Here I have another problem, sometimes it simply does not boot, then I have to plug USB, and run grub-install manually to recover. As per discussion on IRC today, I would suggest the folowing regarding grub efi, I'm not using other bootloaders, but I suppose same logic may apply. There are two things about grub: 1) /boot/efi/EFI/Guix/grubx64.efi & NVRAM - these are changing very very rarely, only when grub version change, boot partition change. 2) /boot/grub/* - these are changing only when grub version change or new guix generation is created, then grub.cfg is getting updated. Currently, as far as I understand, both of them are getting installed with one script from this derivation: /gnu/store/...-install-bootloader.scm.drv It could be split into two, one which runs grub-install, i.e. #1 above, the other which covers #2 above, let's say bootloader-phase-1-install and bootloader-phase-2-install respectively. Then, each script can be executed only when derivation is changing. With the following exceptions: - must be executed anyway on "guix system init ..." - must be executed only if "guix system reconfigure --force-bootloader ..." Scripts them selves store grub version (via absolute path), thus if grub updated, derivations will change. If for some reason, grub and/or nvram getting broken on boot, user has to boot with some kind recovery media anyway.