From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Gibbons Subject: bug#36876: guix system delete-generations removes custom boot menu entries Date: Mon, 05 Aug 2019 21:12:42 -0600 Message-ID: References: <20190731094857.28829b11@gmail.com> <8736ifzjfe.fsf@sdf.lonestar.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:57111) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hupuJ-0008QV-17 for bug-guix@gnu.org; Mon, 05 Aug 2019 23:13:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hupuH-0003Fw-U3 for bug-guix@gnu.org; Mon, 05 Aug 2019 23:13:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55527) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hupuH-0003Fo-QZ for bug-guix@gnu.org; Mon, 05 Aug 2019 23:13:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hupuH-0007Xe-KR for bug-guix@gnu.org; Mon, 05 Aug 2019 23:13:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <8736ifzjfe.fsf@sdf.lonestar.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: "Jakob L. Kreuze" Cc: 36876@debbugs.gnu.org On Mon, 2019-08-05 at 12:05 -0400, Jakob L. Kreuze wrote: > ... > > I don't think this should be _too_ hard to fix. To me, parsing the > installed Grub configuration to get existing menu entries seems like > a > logical step forward. > > Thoughts from anyone else? > > Regards, > Jakob Alternatively, we could save in the store a derivation for the the grub config generated from the bootloader of the configuration. When the user calls "guix system delete-generations", the derivation can be run, and the remaining system generations (if any) can be appended in a menu like when the user calls "guix system reconfigure". (Although it does not work for me right now, I'm assuming "guix system delete-generations 2m" as described in the manual will be implemented in the future.) The immediate downsides I see to my solution: - It would take space in the store per generation, which can add up if the user does not often call "guix system delete-generations" and calls "guix system reconfigure" on a healthy basis. The user could just be reminded to call "guix system delete-generations" occasionally, and any official service that automatically updates the system via "guix system reconfigure" can (and considering how large a generation with a lot of updated system packages can get, probably should) also be configured to call "guix system delete-generations". - If someone hand-edits the grub config the changes would be lost. This is the case as it is right now, and grub options can be edited in the configuration, so I'm not too concerned about this. -It would be much simpler to identify menu entries generated by guix that are no longer in the store and remove them, and remove all empty submenus. Parsing would make hand-editing grub.cfg more dangerous than a solution that simply scraps the hand-made changes and rebuilds as I propose, because the user doing the hand-editing would not necessarily be aware what patterns the parser checks. It would also be inconsitent: edits to grub.cfg being scrapped when "guix system reconfigure" is called, but not when 'guix system delete-generations" is called looks to me like a good way to introduce a bug to the more adventurous "Murphy's Law"-type users down the road. These are just my thoughts. I would love to hear other downsides to my solution. -- -Jesse