From unknown Sun Jun 22 22:40:28 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#36876 <36876@debbugs.gnu.org> To: bug#36876 <36876@debbugs.gnu.org> Subject: Status: guix system delete-generations removes custom boot menu entries Reply-To: bug#36876 <36876@debbugs.gnu.org> Date: Mon, 23 Jun 2025 05:40:28 +0000 retitle 36876 guix system delete-generations removes custom boot menu entri= es reassign 36876 guix submitter 36876 Jesse Gibbons severity 36876 important thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 31 11:49:07 2019 Received: (at submit) by debbugs.gnu.org; 31 Jul 2019 15:49:07 +0000 Received: from localhost ([127.0.0.1]:52936 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsqqh-0003E9-C1 for submit@debbugs.gnu.org; Wed, 31 Jul 2019 11:49:07 -0400 Received: from lists.gnu.org ([209.51.188.17]:47404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hsqqe-0003Dz-Np for submit@debbugs.gnu.org; Wed, 31 Jul 2019 11:49:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35932) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsqqd-0003RH-Mv for bug-guix@gnu.org; Wed, 31 Jul 2019 11:49:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsqqc-0008OE-Tq for bug-guix@gnu.org; Wed, 31 Jul 2019 11:49:03 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:33798) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsqqc-0008Nx-KX for bug-guix@gnu.org; Wed, 31 Jul 2019 11:49:02 -0400 Received: by mail-pg1-x533.google.com with SMTP id n9so26006970pgc.1 for ; Wed, 31 Jul 2019 08:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=0MS9+QpG2nJJeDyJ5hYuEWGXPqavnz+qII16d4vfRbI=; b=H5Q6kvdTNEB9TPVU7uE4Mvfg4xGDx8dWedwIalvpttyBkwMN89+8iQ+va68PwVxrF5 3TNg8jebVNHogYjvR4mLH3JL8yjNAb0+JRJOf86ZpSctmWXH8ewO6zGn1eQRq8nTSaR6 VpmzZ1oEIeEAn3/WdxbOGoirDWKYYkr9d0QMdC/esugDoADGSZBdwXHG2PBg2U9B9W4I W79AqTR6ZvGYX90YMHZrMV2SMxkGDZmjMF5dYXgEmV55H55nfmoK+vMkOqfMCZRJDD5y ZzRKHmXSpumRWfC4APTDqRYqVUCnURtSZ0k275OEaHvbOjgJRNXxTSalmv5HLZTm/6ns nTkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-transfer-encoding; bh=0MS9+QpG2nJJeDyJ5hYuEWGXPqavnz+qII16d4vfRbI=; b=YsV+mbsbrqJ4fVLMsJJaAnv+lWyjtNqJrkDHwrkxgQYI2cy20GsmbGp9AWiK/q5KL8 zVqhArzi/3D9R2mamJ2ODm/bmcMFgcZNfd3gqSRki2Up2ACPY1vpp013D82RJKP4V+Wx uFcq2ktB5OEbiiqD3JSm1oSaIEPKVq14TibLZ+usWxkzf31qHXkcPBZSKH2v4aI32ToE VElgCEnfbJW20g1wTT5sA87Rz6btoaGJIgrXnk9V5GMSp7cy+XH1WnMv+PvKlb7c1EsR tINDCoifOySL95b8JKPJxxlxgGhUrVeVjMk3BWpUpI41fF5zVnh2EMsBuTyzbi853IaM YDTw== X-Gm-Message-State: APjAAAUzZ56oTTvA+hpwqxFOO/vUsOSByqDHKgk8iRT1ZZk9afkt/m+3 G28F3JtJIWil5H81r7WPUl3tBZwn0Bw= X-Google-Smtp-Source: APXvYqyDfFjJXy1MtWi6KFp6U1T29RaqaLo1tLaLMHtesK3G+w05hhjNE2vFzdhAo5bK9Y5n7TPZNQ== X-Received: by 2002:a17:90a:c391:: with SMTP id h17mr3652787pjt.131.1564588141195; Wed, 31 Jul 2019 08:49:01 -0700 (PDT) Received: from localhost ([199.68.53.171]) by smtp.gmail.com with ESMTPSA id r2sm86907650pfl.67.2019.07.31.08.48.59 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 08:49:00 -0700 (PDT) Date: Wed, 31 Jul 2019 09:48:57 -0600 From: Jesse Gibbons To: bug-guix@gnu.org Subject: guix system delete-generations removes custom boot menu entries Message-ID: <20190731094857.28829b11@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::533 X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit 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: -2.1 (--) I dual-booted Guix with another gnu/linux-libre distro. My configuration includes the other distro in the grub menu. When I run "sudo guix system delete-generations" the changes to the grub menu drop the other distro with the older system generations of guix. My current work-around for this is to run "guix system reconfigure ..." which includes the boot menu entries specified in the configuration. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 05 12:09:14 2019 Received: (at 36876) by debbugs.gnu.org; 5 Aug 2019 16:09:14 +0000 Received: from localhost ([127.0.0.1]:35732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hufXu-0007fM-3Z for submit@debbugs.gnu.org; Mon, 05 Aug 2019 12:09:14 -0400 Received: from mx.sdf.org ([205.166.94.20]:58406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hufXq-0007f9-EW for 36876@debbugs.gnu.org; Mon, 05 Aug 2019 12:09:12 -0400 Received: from Epsilon (pool-173-76-53-40.bstnma.fios.verizon.net [173.76.53.40]) (authenticated (0 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id x75G96hw017563 (using TLSv1.2 with cipher AES256-GCM-SHA384 (256 bits) verified NO); Mon, 5 Aug 2019 16:09:07 GMT From: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) To: Jesse Gibbons Subject: Re: bug#36876: guix system delete-generations removes custom boot menu entries References: <20190731094857.28829b11@gmail.com> Date: Mon, 05 Aug 2019 12:05:57 -0400 In-Reply-To: <20190731094857.28829b11@gmail.com> (Jesse Gibbons's message of "Wed, 31 Jul 2019 09:48:57 -0600") Message-ID: <8736ifzjfe.fsf@sdf.lonestar.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36876 Cc: 36876@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain Hi Jesse, Jesse Gibbons writes: > I dual-booted Guix with another gnu/linux-libre distro. > My configuration includes the other distro in the grub menu. When I run > "sudo guix system delete-generations" the changes to the grub menu drop > the other distro with the older system generations of guix. > > My current work-around for this is to run "guix system reconfigure ..." > which includes the boot menu entries specified in the configuration. Thanks for reporting this; it's a rather serious issue. The problem lies in the 'reinstall-bootloader' procedure. Chiefly, it uses the default bootloader configuration for whatever it can find using 'lookup-bootloader-by-name' and generates menu entries for the generations reachable from '%system-profile', which is quite a bit different from how 'guix system reconfigure' produces the bootloader configuration. It really isn't ideal. To quote a comment in 'system.scm': "[i]t will be enough to allow the system to boot." 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEa1VJLOiXAjQ2BGSm9Qb9Fp2P2VoFAl1IU+YACgkQ9Qb9Fp2P 2Vp/xhAAk/8YsIdUIUoAXsarGj/LJe4AuVhMJKR2uJGsgVUFbB1F825rSj6PTk7L Oa2l5BvRq3fuULT46zEzgCaE4LHu2xwe0FFjhKGPrsAx9I6AMHp1hItRwj3u57CC oFQBDOAKOQBqQT8h9ynJ45KdJ+dkzwmOYVXIp5/17FfjIefZOL0XTE7Bmr3ycd5y YW/n+B0LCrMPtdwVmFy999o0in/Z5BPh2RLLo/NW36viT+kafqSBAk9YymYqEbe4 H/uF7n5nb9Z/zWOlwj3gpDJ/TGU797TSVYSwZOFkO+dekYsw7PlesqQApXX3qfGe VgRSwSn22NwzwjyCgLGtvjgxEloV8pihodceznRZXi25Ld1N9DUQndN6Ryk65JiO RzLVGn/vfCq8yR5OOiWcQApd7Xz8XPXxe9fX9mkG/KJW6U4g8BjfjjwAvELsrKmg +6OFg0bUdn+Gr9OVZKAEVlgtThhxdGIpVFxXChBJdRK/K/QyZeY2DQarRhgkm3h5 vzKwBncEOOj+sQfDs09nT/1Bz/DjpQJpLT+FTsqRVGzfknzYVamKiKamm59RdxJS jI9EUTFLT/oqk254utSc8lhXBhemynKN+GiBV6uW45BqYKMtUgdRxFSyRn8XRThB BBebjQQhxGk9gliCsZMIJhWs26BsGrgEUwfAciJJfNypZWUoHbk= =ZPUK -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 05 23:12:55 2019 Received: (at 36876) by debbugs.gnu.org; 6 Aug 2019 03:12:55 +0000 Received: from localhost ([127.0.0.1]:36115 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hupuB-0007XJ-9d for submit@debbugs.gnu.org; Mon, 05 Aug 2019 23:12:55 -0400 Received: from mail-pg1-f176.google.com ([209.85.215.176]:40837) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hupu9-0007X7-Ft for 36876@debbugs.gnu.org; Mon, 05 Aug 2019 23:12:54 -0400 Received: by mail-pg1-f176.google.com with SMTP id w10so40761776pgj.7 for <36876@debbugs.gnu.org>; Mon, 05 Aug 2019 20:12:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:in-reply-to:references:date :mime-version:content-transfer-encoding; bh=Y5qzRQkYtg4rI7I60pHJe8Y4xJQs7mJr3dRlzyMPOL0=; b=Nere+sUOtprHof5BHYSy8Re8MVEuM1UYl9XKX7pXbJyMsQqO3O/NpD6kUdfk6rX76z kaYQhyjbq/usVtMGI6TOKoRGxZzFlyK3zTSaKfK7qpZ4NgSmgqEz8AmwxoE6DIYcn148 ag3UPuam055qrNd1awAkTWCBm9WwQdmwZPsdZbw9mNGcHg4OZgBtpGNa8tQ3OL4ZlZnM 8yLjG+1F08prw9ylvEUYjfR7E3DlN50v+mu+CKaO8+0pPb3Trtzb6pUJJzpF6yifPP8I INiFp/zN5miTiGfDg/E7D7IQ9XjrlN6SJsg4Kav4IlVTKqWss7aQeKD0PcXE6OJHaHnM cC7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:in-reply-to :references:date:mime-version:content-transfer-encoding; bh=Y5qzRQkYtg4rI7I60pHJe8Y4xJQs7mJr3dRlzyMPOL0=; b=AqF+/rBksVEl3jtAOBdzPESzzVm7GU3HhDhJwPjtERkjGNZVaMNI6fA4H7zh148n8c 2E3py4/+vrVGcHCy0aWMz6Q4ayc4UBZRAyiW7QiXoFAiQJEGjyFKAhRDD51XsJJ5uGah OE/G5qTD1o8VfbaXtlfvRkBl/0Dgjbw0DWFLkboffa0E9I5a2nRk2ICMu0xXFb1WYrF8 nSea8GRNN0LyBYaE8qA7t0xPOBKhztE+i4qfOcYcz19UUFZSKl2b9d5cB1+lRyR2sZf2 ysB5AxCeTbcQN2TPVu1+ZKEVo/5u/muhFcrliJlvw1lToM+VOVH1Q+pBDEFe//OoLOtc V6Vw== X-Gm-Message-State: APjAAAV9mECcTYl/2EsFKv6ehPOGFiTmTMVPFdEKHfSR7/Qr0vPqigwb JSeXLFZC1jSGw32nCRDyBAA= X-Google-Smtp-Source: APXvYqwu5RQ9RumtiKvtzvcLw2PTHhwwi1MKOW7iILSwN1Gcfb9DCVxowfMWiWVC4WDTZMX6VkOpXA== X-Received: by 2002:a63:b20f:: with SMTP id x15mr992854pge.453.1565061167579; Mon, 05 Aug 2019 20:12:47 -0700 (PDT) Received: from piranhaplant.local ([199.68.53.171]) by smtp.googlemail.com with ESMTPSA id a20sm16710767pjo.0.2019.08.05.20.12.45 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 20:12:46 -0700 (PDT) Message-ID: Subject: Re: bug#36876: guix system delete-generations removes custom boot menu entries From: Jesse Gibbons To: "Jakob L. Kreuze" In-Reply-To: <8736ifzjfe.fsf@sdf.lonestar.org> References: <20190731094857.28829b11@gmail.com> <8736ifzjfe.fsf@sdf.lonestar.org> Content-Type: text/plain; charset="UTF-8" Date: Mon, 05 Aug 2019 21:12:42 -0600 Mime-Version: 1.0 X-Mailer: Evolution 3.28.1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 36876 Cc: 36876@debbugs.gnu.org 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: -0.7 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 06 09:26:18 2019 Received: (at 36876) by debbugs.gnu.org; 6 Aug 2019 13:26:18 +0000 Received: from localhost ([127.0.0.1]:36590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1huzTm-0000S8-4r for submit@debbugs.gnu.org; Tue, 06 Aug 2019 09:26:18 -0400 Received: from mx.sdf.org ([205.166.94.20]:55698) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1huzTh-0000Rx-Ab for 36876@debbugs.gnu.org; Tue, 06 Aug 2019 09:26:16 -0400 Received: from Epsilon (pool-173-76-53-40.bstnma.fios.verizon.net [173.76.53.40]) (authenticated (0 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id x76DQB51000229 (using TLSv1.2 with cipher AES256-GCM-SHA384 (256 bits) verified NO); Tue, 6 Aug 2019 13:26:12 GMT From: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) To: Jesse Gibbons Subject: Re: bug#36876: guix system delete-generations removes custom boot menu entries References: <20190731094857.28829b11@gmail.com> <8736ifzjfe.fsf@sdf.lonestar.org> Date: Tue, 06 Aug 2019 09:22:59 -0400 In-Reply-To: (Jesse Gibbons's message of "Mon, 05 Aug 2019 21:12:42 -0600") Message-ID: <87y306xwb0.fsf@sdf.lonestar.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36876 Cc: 36876@debbugs.gnu.org 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 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Jesse Gibbons writes: > 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=20 > 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. I haven't tried it yet, but 'menuentry' seems as though it would be a fairly simple structure to parse. > These are just my thoughts. I would love to hear other downsides to my > solution. I prefer your suggestion to mine and think that the benefits may outweigh the costs in this case. This seems to fit into the Guix idea of purity a bit better than parsing a grub.cfg that may have been overwritten by another system. Regards, Jakob --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEa1VJLOiXAjQ2BGSm9Qb9Fp2P2VoFAl1JfzMACgkQ9Qb9Fp2P 2VrANQ//bnil91UBb5UGNEs2l/MPS2pLXGnnGuTbfFFBsvFDkL3YCnzLnAce1uRV /rYdU1zGu1HHM3dpN0AGuR5xXX9NKlCZTZcWKFGUBkaS0Tc7r3n7AKFbhTbal2M+ ViGAot6yWuSlghLN2xaBzFR+wqPtghOVAPR5GOZoW6XUpnMSiBtRNRlitR6rettG xm9clTCOkR8f2Cbrgwn/zq9TjXFlcQWhzDB8GSkFgzB+cgJhiuCXsNvYdXhCzNa0 CNxZRS1rxIaSMztWnicTHghN29AxzYNqJ22p3jk6X3WevNoxC4Yr/vIk5BHY1KLJ hl63bj4xTtrN9+8vpgE2UoLIGXGquxyLq5KIi08hu8aXa/C11QnPPiNZlirnghl2 EN7V8Psf2qvZYeXKC0+VbUuiZdHCllERA6+PabI+s6v+IwGWlRjQi/7Yk+e55DOW Y0leADS8HILIK3cMRvIxf/6WGktD/3zxsHMEy7nSePXqyyozfbPhbmAViOTDvh4f Mp4mjAbOER8RbkAXCP8CMlcvBYAWFxyBNflufCuHYEORe0ByY+zhDn3gzqPkuIoO 8f0W2aq/b4nCPIBMojgkVtR8ST88XTiNLVBA7cbAFbwBSRZASGWvyHliAu5F2goS XqyRydKPtnTagkkmRadokAEC5AniJKQ3lV5FQp+X7CPr26ToZzI= =vlA6 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 06 12:32:40 2019 Received: (at 36876) by debbugs.gnu.org; 6 Aug 2019 16:32:40 +0000 Received: from localhost ([127.0.0.1]:37706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hv2O8-000193-Fm for submit@debbugs.gnu.org; Tue, 06 Aug 2019 12:32:40 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:52560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hv2O6-00018n-Dj for 36876@debbugs.gnu.org; Tue, 06 Aug 2019 12:32:39 -0400 Received: from localhost (77.117.217.54.wireless.dyn.drei.com [77.117.217.54]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 26A29336212E; Tue, 6 Aug 2019 18:32:36 +0200 (CEST) Date: Tue, 6 Aug 2019 18:32:34 +0200 From: Danny Milosavljevic To: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) Subject: Re: bug#36876: guix system delete-generations removes custom boot menu entries Message-ID: <20190806183234.5e7714c2@scratchpost.org> In-Reply-To: <8736ifzjfe.fsf@sdf.lonestar.org> References: <20190731094857.28829b11@gmail.com> <8736ifzjfe.fsf@sdf.lonestar.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/AX2tY92m4G8OqHM5qxO6rfy"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 36876 Cc: 36876@debbugs.gnu.org, Jesse Gibbons 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.7 (-) --Sig_/AX2tY92m4G8OqHM5qxO6rfy Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Jakob, keep in mind that switching back to a previous generation could also entail= a switch of bootloader projects. It does you no good to parse the grub confi= g to find menu entries and then append them to u-boot. Fundamentally, it would be best if either the bootloader is part of the sta= te that guix manages (and each time uses), or it isn't; not both. Current situation: * If you select a previous generation in the boot menu, then the state that= is selected does NOT include the bootloader (i.e. it doesn't change the bootlo= ader or the bootloader config). * If you do "guix system reconfigure", the state that is saved includes only the bootloader in the boot sector (simplified) but not the bootloader insta= ller or the bootloader derivation. * If you do "guix system delete-generations", the state that is restored do= es not include the bootloader installer and previous bootloader configuration. Clearly, it's not nice to have these different things happen. It would be better if we retained the generation's bootloader installer and bootloader config and reinstalled it on each of those. So, I would suggest to retain the following for each system generation: * The bootloader package derivation * The bootloader config derivation * The bootloader installer derivation And to install the bootloader each time using the latter. This introduces cycles--not sure whether that's a problem or not. For the GC I think it's not a problem. --Sig_/AX2tY92m4G8OqHM5qxO6rfy Content-Type: application/pgp-signature Content-Description: Digitale Signatur von OpenPGP -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl1Jq6IACgkQ5xo1VCww uqX+MAf/SuzaBCxBH2Shxkh3c3JUJYnVPc9oW+MVvCou/sAwjeUkgI9LVz4lgaXA aLmknvllkHpWWi3sofBXqWQXqHSpu6PlJPMSSOadcPKTYc2J1oK0rMK4TWmLHqZk eqGdy9pAN06Fr56Vcl/OEqnEwCodFJ/Xv9kxGj5vS+6WtpDbdLDSmvQs2YkPAcc/ KaoNZBwYneMjAJV25EAq0i5jhCh3TmQkibl3FDdt8veURo+oAVf6B1gpXU12XRiS /PF2x6SERRMObz0jQXyGlzi6anFwXkRj9NKozfoKzwfncbqrTux/3EIDeUTQYvZS bkZ0ZDqXk6Lu40Byi54Oekn3XGnumg== =x0pE -----END PGP SIGNATURE----- --Sig_/AX2tY92m4G8OqHM5qxO6rfy-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 06 12:36:02 2019 Received: (at 36876) by debbugs.gnu.org; 6 Aug 2019 16:36:02 +0000 Received: from localhost ([127.0.0.1]:37710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hv2RO-0001FC-1l for submit@debbugs.gnu.org; Tue, 06 Aug 2019 12:36:02 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:52838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hv2RM-0001Em-7h for 36876@debbugs.gnu.org; Tue, 06 Aug 2019 12:36:00 -0400 Received: from localhost (77.117.217.54.wireless.dyn.drei.com [77.117.217.54]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 4054A33697C5; Tue, 6 Aug 2019 18:35:59 +0200 (CEST) Date: Tue, 6 Aug 2019 18:35:58 +0200 From: Danny Milosavljevic To: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) Subject: Re: bug#36876: guix system delete-generations removes custom boot menu entries Message-ID: <20190806183558.7d863a82@scratchpost.org> In-Reply-To: <20190806183234.5e7714c2@scratchpost.org> References: <20190731094857.28829b11@gmail.com> <8736ifzjfe.fsf@sdf.lonestar.org> <20190806183234.5e7714c2@scratchpost.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/gK80rg=0=d64sVF3ifPEoMK"; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 36876 Cc: 36876@debbugs.gnu.org, Jesse Gibbons 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.7 (-) --Sig_/gK80rg=0=d64sVF3ifPEoMK Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Addition: * If you do "guix system switch-generation", the state that is restored does not include the bootloader installer and previous bootloader configuration. --Sig_/gK80rg=0=d64sVF3ifPEoMK Content-Type: application/pgp-signature Content-Description: Digitale Signatur von OpenPGP -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl1JrG4ACgkQ5xo1VCww uqXwuAf/YBhjEfeoVHpKvG3yWhXyuSgXYVA823vL/ovJzOCNrJ0gOwN/oax8zYE4 RENwreE7cp0vvfWR7L5BC7Q3knU6+oXcfjvemLwmzYYE2vBwt7EuxQGy+Y7pyU3U ei16tooXaQPkU/fDXYLdYxGYAg3qYdpPmSE/nGB33LFTybiLt+Q/aDm5nFn9oWML XQ/8j+i+3MC1Ympx/jZvH7wPcmZ+XAKI5pf8I5JGpKGL61f8FfZKVeIxV1qBYxgY A2GrMa6kWXcyYocg4PwN2BpK/Q5fIpJTUHN/nsbkn2Qs9/Yal4fEFIjvluJr5xG/ BHMXMoc0XASl9gEKjqXRwIi0F45gpA== =2XFY -----END PGP SIGNATURE----- --Sig_/gK80rg=0=d64sVF3ifPEoMK-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 06 14:27:54 2019 Received: (at 36876) by debbugs.gnu.org; 6 Aug 2019 18:27:54 +0000 Received: from localhost ([127.0.0.1]:37758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hv4Bd-0004Km-Pa for submit@debbugs.gnu.org; Tue, 06 Aug 2019 14:27:54 -0400 Received: from mx.sdf.org ([205.166.94.20]:64895) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hv4Bb-0004Ke-Ej for 36876@debbugs.gnu.org; Tue, 06 Aug 2019 14:27:52 -0400 Received: from Upsilon (mobile-166-172-60-111.mycingular.net [166.172.60.111]) (authenticated (0 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id x76IRlPa021932 (using TLSv1.2 with cipher AES256-GCM-SHA384 (256 bits) verified NO); Tue, 6 Aug 2019 18:27:49 GMT From: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) To: Danny Milosavljevic Subject: Re: bug#36876: guix system delete-generations removes custom boot menu entries References: <20190731094857.28829b11@gmail.com> <8736ifzjfe.fsf@sdf.lonestar.org> <20190806183234.5e7714c2@scratchpost.org> Date: Tue, 06 Aug 2019 14:27:47 -0400 In-Reply-To: <20190806183234.5e7714c2@scratchpost.org> (Danny Milosavljevic's message of "Tue, 6 Aug 2019 18:32:34 +0200") Message-ID: <87k1bqdu8s.fsf@sdf.lonestar.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36876 Cc: 36876@debbugs.gnu.org, Jesse Gibbons 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 (-) --=-=-= Content-Type: text/plain Hi Danny, Danny Milosavljevic writes: > Hi Jakob, > > keep in mind that switching back to a previous generation could also entail a > switch of bootloader projects. It does you no good to parse the grub config to > find menu entries and then append them to u-boot. > > Fundamentally, it would be best if either the bootloader is part of the state > that guix manages (and each time uses), or it isn't; not both. > > Current situation: > > * If you select a previous generation in the boot menu, then the state that is > selected does NOT include the bootloader (i.e. it doesn't change the bootloader > or the bootloader config). > > * If you do "guix system reconfigure", the state that is saved includes only > the bootloader in the boot sector (simplified) but not the bootloader installer > or the bootloader derivation. > > * If you do "guix system delete-generations", the state that is restored does > not include the bootloader installer and previous bootloader configuration. > > Clearly, it's not nice to have these different things happen. > > It would be better if we retained the generation's bootloader installer > and bootloader config and reinstalled it on each of those. > > So, I would suggest to retain the following for each system generation: > > * The bootloader package derivation > * The bootloader config derivation > * The bootloader installer derivation > > And to install the bootloader each time using the latter. > > This introduces cycles--not sure whether that's a problem or not. > For the GC I think it's not a problem. Thank you for your comments -- after reading this and Jesse's suggestion, I'm quite confident that this is the way to go about it. Regards, Jakob --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEa1VJLOiXAjQ2BGSm9Qb9Fp2P2VoFAl1JxqMACgkQ9Qb9Fp2P 2Vqb8g//ZObyAhO6cNTFAHob4iC/ygNuKL3qVKKpe5fGOrsZaAgQFxRON+1pgUem RFMLdXaAqVbd26nthZSGZWTA1QYbEAEhwlapFv+1ZDIm9BAk0r+hz1TJ5Awz8AZW v4BM4MrzG6iZMJ8MBZ6t2II29H60J6hPk29DIYU67FW8NlsqKUdQOfl5jOAh99lq LDwjByhuCWzn02gZkfv7Sp8CRcYRxB67jy4byN2oH6VGpCqAr0MPOkP3vUIg7j5p onvmT3Pt5MSa60wwSo92EiNmmZYd/QyV/B1Rg7ug7+nIu3Mbu9r/MgpcJUFMMWRU /MPbZ8LU8D+YnI5D4y8tfQnGjw9qb1o/GtCDklu5CKNxJOV7115UyCMAy62/oXXI N5NfkygfM4KRbPk5FAV1RSVncwVaxPIb3xe+EY1717HJavA38MdB++cVMF+Mzb2k fAt/NL/5NYrAbi00Y1STZDvOjmQOndGemoeb8g0H3OC9X0yQH1zX9bf8oc/3Qcd2 4TSso5mBC06/rZAkTYkpaMyWVfwV5fpBop4fTdI4q5tn8hcB1dHAayfKItmbwBOk iCC97LsJUjGH8fDxz/yrq+qrk90nTunZdK0Bg9iCJJvKDAYrRQ8rw2j98Jv4TdTX gJ+anlbTc9e9IdN+xVI4foLNCRhAw2JLB/Jbdk8qWt79ezOOsJc= =wCog -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 23 08:29:19 2019 Received: (at 36876) by debbugs.gnu.org; 23 Aug 2019 12:29:19 +0000 Received: from localhost ([127.0.0.1]:39228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i18gx-0001Tz-6v for submit@debbugs.gnu.org; Fri, 23 Aug 2019 08:29:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i18gs-0001Tg-Tw for 36876@debbugs.gnu.org; Fri, 23 Aug 2019 08:29:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i18gm-0007L6-1x; Fri, 23 Aug 2019 08:29:09 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=48502 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1i18gf-0007c0-4H; Fri, 23 Aug 2019 08:29:02 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) Subject: Re: bug#36876: guix system delete-generations removes custom boot menu entries References: <20190731094857.28829b11@gmail.com> <8736ifzjfe.fsf@sdf.lonestar.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 Fructidor an 227 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 23 Aug 2019 14:28:59 +0200 In-Reply-To: <8736ifzjfe.fsf@sdf.lonestar.org> (Jakob L. Kreuze's message of "Mon, 05 Aug 2019 12:05:57 -0400") Message-ID: <87sgps6p6c.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36876 Cc: 36876@debbugs.gnu.org, Jesse Gibbons , Danny Milosavljevic 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: -3.3 (---) Hello! zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) skribis: > Jesse Gibbons writes: > >> I dual-booted Guix with another gnu/linux-libre distro. >> My configuration includes the other distro in the grub menu. When I run >> "sudo guix system delete-generations" the changes to the grub menu drop >> the other distro with the older system generations of guix. >> >> My current work-around for this is to run "guix system reconfigure ..." >> which includes the boot menu entries specified in the configuration. > > Thanks for reporting this; it's a rather serious issue. The problem lies > in the 'reinstall-bootloader' procedure. Chiefly, it uses the default > bootloader configuration for whatever it can find using > 'lookup-bootloader-by-name' and generates menu entries for the > generations reachable from '%system-profile', which is quite a bit > different from how 'guix system reconfigure' produces the bootloader > configuration. It really isn't ideal. To quote a comment in > 'system.scm': "[i]t will be enough to allow the system to boot." > > 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. I agree with Danny here that parsing the GRUB config wouldn=E2=80=99t be gr= eat. We have information about the user=E2=80=99s extra menu entries. The issue= , as I see it, as that this information is lost once the system is instantiated. But! We have the structure, that gets serialized with the system, and which we could extend with those extra menu entries. That way, the info would be preserved, and we can restore them upon =E2=80=98delete-generations=E2=80=99. records are bootloader-= independent, which is good. How does that sound? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 23 08:30:03 2019 Received: (at control) by debbugs.gnu.org; 23 Aug 2019 12:30:03 +0000 Received: from localhost ([127.0.0.1]:39231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i18he-0001Va-Ig for submit@debbugs.gnu.org; Fri, 23 Aug 2019 08:30:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i18hc-0001Uo-T2 for control@debbugs.gnu.org; Fri, 23 Aug 2019 08:30:01 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41484) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i18hW-0007du-2m for control@debbugs.gnu.org; Fri, 23 Aug 2019 08:29:55 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=48508 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1i18hT-0000P8-B9 for control@debbugs.gnu.org; Fri, 23 Aug 2019 08:29:52 -0400 Date: Fri, 23 Aug 2019 14:29:49 +0200 Message-Id: <87r25c6p4y.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #36876 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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: -3.3 (---) severity 36876 important quit From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 28 11:39:04 2019 Received: (at 36876) by debbugs.gnu.org; 28 Aug 2019 15:39:04 +0000 Received: from localhost ([127.0.0.1]:51087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i302K-0008DW-JF for submit@debbugs.gnu.org; Wed, 28 Aug 2019 11:39:04 -0400 Received: from ol.sdf.org ([205.166.94.20]:49260 helo=mx.sdf.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i302I-0008D2-SH for 36876@debbugs.gnu.org; Wed, 28 Aug 2019 11:39:03 -0400 Received: from Epsilon (pool-173-76-53-40.bstnma.fios.verizon.net [173.76.53.40]) (authenticated (0 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id x7SFd0p3022735 (using TLSv1.2 with cipher AES256-GCM-SHA384 (256 bits) verified NO); Wed, 28 Aug 2019 15:39:01 GMT From: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#36876: guix system delete-generations removes custom boot menu entries References: <20190731094857.28829b11@gmail.com> <8736ifzjfe.fsf@sdf.lonestar.org> <87sgps6p6c.fsf@gnu.org> Date: Wed, 28 Aug 2019 11:38:45 -0400 In-Reply-To: <87sgps6p6c.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 23 Aug 2019 14:28:59 +0200") Message-ID: <87lfvdpaey.fsf@sdf.lonestar.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 36876 Cc: 36876@debbugs.gnu.org, Jesse Gibbons , Danny Milosavljevic 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 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ludo, Ludovic Court=C3=A8s writes: > I agree with Danny here that parsing the GRUB config wouldn=E2=80=99t be = great. > > We have information about the user=E2=80=99s extra menu entries. The iss= ue, as > I see it, as that this information is lost once the system is > instantiated. > > But! We have the structure, that gets serialized with > the system, and which we could extend with those extra menu entries. > That way, the info would be preserved, and we can restore them upon > =E2=80=98delete-generations=E2=80=99. records are bootloade= r-independent, > which is good. > > How does that sound? Would that involve appending an additional field to for storing the previous entries? I think that would have the pleasant side-effect of making the code for deployment/reconfiguration simpler :) Regards, Jakob --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEa1VJLOiXAjQ2BGSm9Qb9Fp2P2VoFAl1moAUACgkQ9Qb9Fp2P 2VqHBg/+I9HKnOOKbVcDscLbE+OFIPGnVdtYBXrUV1e26Yu1pplaK/pI1SL7rV14 5Xl1v+rWKczR597yIglbqllgd4ERs+u+EU6Ke1EDzymAFg2J+qRqcacRecwneXFw OdMC+LtDc0m8nQRf2b2nnsC3BvUc4jF0c30sQGL0+Z/p/yGA+5q5UDBv2zPQ1258 L6MebpfNrYbR6HRObO+chDFM9CYEQNsS+ITfHJO+wAlKP9yEu3f8QjEyf08+t8Uv KiLcB/wNixPtA6bwOeyWx/TqDeYF0KoLHX5LXq/dqBbXXRt1A5eWgBQorcA9iQA1 LoyJOSYNdKNxA7SyZqTdxAyluDnhAJXX3Fv5SziGKxmoJEPSub243/LMqdiqOF3W cA681WGRc2FarK94kce5V43Xg/OBL7X9kWZETK58iRimJkpxXktMf8wtnMu2z2aw eNny6pWKVDLcWZAjb5LnrOo/yMJI+vL+4r1Y24Wfqr/0kEyHmzDJtcMPjJlOI9B8 Mf9WhnqgtC0sWNSTo3+MnToVqE9d3afaMNt20cgd5gRp/OlUiE/lUs2O6sTbyKpk 3TqIXVh2SJ40hdUMzw/91Bwd3p33aZwFABfcyv7FyY4sAqwavS+1YGPcyiy4y1dX m6uTgQ5y+jW1RMOn7SPX3KYg0dZGSrSQXPIUEZ+7q5JDmsf4ilE= =oEDu -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 28 17:40:17 2019 Received: (at 36876) by debbugs.gnu.org; 28 Aug 2019 21:40:17 +0000 Received: from localhost ([127.0.0.1]:51344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i35fs-0005NM-HP for submit@debbugs.gnu.org; Wed, 28 Aug 2019 17:40:17 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i35fo-0005Mz-QF for 36876@debbugs.gnu.org; Wed, 28 Aug 2019 17:40:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:56968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i35fg-0002mz-M4; Wed, 28 Aug 2019 17:40:04 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=48176 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1i35fb-0000QU-Gt; Wed, 28 Aug 2019 17:40:00 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) Subject: Re: bug#36876: guix system delete-generations removes custom boot menu entries References: <20190731094857.28829b11@gmail.com> <8736ifzjfe.fsf@sdf.lonestar.org> <87sgps6p6c.fsf@gnu.org> <87lfvdpaey.fsf@sdf.lonestar.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 11 Fructidor an 227 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 28 Aug 2019 23:39:55 +0200 In-Reply-To: <87lfvdpaey.fsf@sdf.lonestar.org> (Jakob L. Kreuze's message of "Wed, 28 Aug 2019 11:38:45 -0400") Message-ID: <87r255dl5g.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36876 Cc: 36876@debbugs.gnu.org, Jesse Gibbons , Danny Milosavljevic 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: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) skribis: > Ludovic Court=C3=A8s writes: > >> I agree with Danny here that parsing the GRUB config wouldn=E2=80=99t be= great. >> >> We have information about the user=E2=80=99s extra menu entries. The is= sue, as >> I see it, as that this information is lost once the system is >> instantiated. >> >> But! We have the structure, that gets serialized with >> the system, and which we could extend with those extra menu entries. >> That way, the info would be preserved, and we can restore them upon >> =E2=80=98delete-generations=E2=80=99. records are bootload= er-independent, >> which is good. >> >> How does that sound? > > Would that involve appending an additional field to > for storing the previous entries? I think that would have the pleasant > side-effect of making the code for deployment/reconfiguration simpler :) Oh that=E2=80=99d be nice. The attached patches should fix this. I=E2=80=99ve successfully deleted a generation on my system. :-) I don=E2=80=99t have extra menu entries thoug= h, so it=E2=80=99d be great if you could give it a try. Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-system-Add-bootloader-menu-entries-field-to-boot-par.patch Content-Transfer-Encoding: quoted-printable >From 0735c71707a5ea14e43e9adf6125801afa7db1ce Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Ludovic=3D20Court=3DC3=3DA8s?=3D Date: Wed, 28 Aug 2019 23:27:20 +0200 Subject: [PATCH 1/2] system: Add 'bootloader-menu-entries' field to . This allows us to keep track of the extra menu entries specified in the OS configuration. * gnu/system.scm ()[bootloader-menu-entries]: New field. (read-boot-parameters): Initialize it. (operating-system-boot-parameters): Likewise. (operating-system-boot-parameters-file): Serialize it. * gnu/bootloader.scm (menu-entry->sexp, sexp->menu-entry): New procedures. --- gnu/bootloader.scm | 34 ++++++++++++++++++++++++++++++++++ gnu/system.scm | 15 +++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm index a381f67145..03616c12ab 100644 --- a/gnu/bootloader.scm +++ b/gnu/bootloader.scm @@ -2,6 +2,7 @@ ;;; Copyright =C2=A9 2017 David Craven ;;; Copyright =C2=A9 2017 Mathieu Othacehe ;;; Copyright =C2=A9 2017 Leo Famulari +;;; Copyright =C2=A9 2019 Ludovic Court=C3=A8s ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,6 +24,7 @@ #:use-module (guix records) #:use-module (guix ui) #:use-module (srfi srfi-1) + #:use-module (ice-9 match) #:export (menu-entry menu-entry? menu-entry-label @@ -32,6 +34,9 @@ menu-entry-initrd menu-entry-device-mount-point =20 + menu-entry->sexp + sexp->menu-entry + bootloader bootloader? bootloader-name @@ -76,6 +81,35 @@ (default '())) ; list of string-valued gexps (initrd menu-entry-initrd)) ; file name of the initrd as a = gexp =20 +(define (menu-entry->sexp entry) + "Return ENTRY serialized as an sexp." + (match entry + (($ label device mount-point linux linux-arguments initrd) + `(menu-entry (version 0) + (label ,label) + (device ,device) + (device-mount-point ,mount-point) + (linux ,linux) + (linux-arguments ,linux-arguments) + (initrd ,initrd))))) + +(define (sexp->menu-entry sexp) + "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a +record." + (match sexp + (('menu-entry ('version 0) + ('label label) ('device device) + ('device-mount-point mount-point) + ('linux linux) ('linux-arguments linux-arguments) + ('initrd initrd) _ ...) + (menu-entry + (label label) + (device device) + (device-mount-point mount-point) + (linux linux) + (linux-arguments linux-arguments) + (initrd initrd))))) + ;;; ;;; Bootloader record. diff --git a/gnu/system.scm b/gnu/system.scm index 01be1243fe..a599ba2750 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -116,6 +116,7 @@ boot-parameters-label boot-parameters-root-device boot-parameters-bootloader-name + boot-parameters-bootloader-menu-entries boot-parameters-store-device boot-parameters-store-mount-point boot-parameters-kernel @@ -251,6 +252,8 @@ directly by the user." ;; OS's root file system, so it might be a device path like "/dev/sda3". (root-device boot-parameters-root-device) (bootloader-name boot-parameters-bootloader-name) + (bootloader-menu-entries ;list of + boot-parameters-bootloader-menu-entries) (store-device boot-parameters-store-device) (store-mount-point boot-parameters-store-mount-point) (kernel boot-parameters-kernel) @@ -297,6 +300,11 @@ file system labels." ((_ args) args) (#f 'grub))) ; for compatibility reasons. =20 + (bootloader-menu-entries + (match (assq 'bootloader-menu-entries rest) + ((_ . entries) (map sexp->menu-entry entries)) + (#f '()))) + ;; In the past, we would store the directory name of the kernel inst= ead ;; of the absolute file name of its image. Detect that and correct = it. (kernel (if (string=3D? linux (direct-store-path linux)) @@ -1005,6 +1013,8 @@ such as '--root' and '--load' to ." (operating-system-user-kernel-arguments os))) (initrd initrd) (bootloader-name bootloader-name) + (bootloader-menu-entries + (bootloader-configuration-menu-entries (operating-system-bootloader = os))) (store-device (ensure-not-/dev (file-system-device store))) (store-mount-point (file-system-mount-point store))))) =20 @@ -1046,6 +1056,11 @@ being stored into the \"parameters\" file)." #$(boot-parameters-kernel-arguments params)) (initrd #$(boot-parameters-initrd params)) (bootloader-name #$(boot-parameters-bootloader-name pa= rams)) + (bootloader-menu-entries + #$(map menu-entry->sexp + (or (and=3D> (operating-system-bootloader os) + bootloader-configuration-menu-entri= es) + '()))) (store (device #$(device->sexp (boot-parameters-store-device params= ))) --=20 2.23.0 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-guix-system-Reinstalling-the-bootloader-preserves-ex.patch >From f0c5d8f1479d899ce5e646f7a157c571c9b6d80c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 28 Aug 2019 23:31:28 +0200 Subject: [PATCH 2/2] guix system: Reinstalling the bootloader preserves extra menu entries. Fixes . Reported by Jesse Gibbons . Previously 'guix system delete-generations' or 'switch-generation' would lose the extra bootloader menu entries specified in the current system's configuration. This fixes that. * guix/scripts/system.scm (reinstall-bootloader): Turn PARAMS into a single . Adjust ENTRIES to include extra menu entries specified in PARAMS. --- guix/scripts/system.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 9fc3a10e98..27b014db68 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -384,12 +384,14 @@ STORE is an open connection to the store." (bootloader bootloader))) ;; Make the specified system generation the default entry. - (params (profile-boot-parameters %system-profile (list number))) + (params (first (profile-boot-parameters %system-profile + (list number)))) (old-generations (delv number (reverse (generation-numbers %system-profile)))) (old-params (profile-boot-parameters %system-profile old-generations)) - (entries (map boot-parameters->menu-entry params)) + (entries (cons (boot-parameters->menu-entry params) + (boot-parameters-bootloader-menu-entries params))) (old-entries (map boot-parameters->menu-entry old-params))) (run-with-store store (mlet* %store-monad -- 2.23.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 29 04:03:02 2019 Received: (at 36876) by debbugs.gnu.org; 29 Aug 2019 08:03:02 +0000 Received: from localhost ([127.0.0.1]:51551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i3FOX-0005FM-OO for submit@debbugs.gnu.org; Thu, 29 Aug 2019 04:03:02 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i3FOW-0005Ez-8E for 36876@debbugs.gnu.org; Thu, 29 Aug 2019 04:03:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:35257) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i3FOP-0002za-1m; Thu, 29 Aug 2019 04:02:53 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=60710 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1i3FON-0005RP-V3; Thu, 29 Aug 2019 04:02:52 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) Subject: Re: bug#36876: guix system delete-generations removes custom boot menu entries References: <20190731094857.28829b11@gmail.com> <8736ifzjfe.fsf@sdf.lonestar.org> <87sgps6p6c.fsf@gnu.org> <87lfvdpaey.fsf@sdf.lonestar.org> <87r255dl5g.fsf@gnu.org> Date: Thu, 29 Aug 2019 10:02:49 +0200 In-Reply-To: <87r255dl5g.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 28 Aug 2019 23:39:55 +0200") Message-ID: <877e6wl7py.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36876 Cc: 36876@debbugs.gnu.org, Jesse Gibbons , Danny Milosavljevic 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: -3.3 (---) Hi there! Ludovic Court=C3=A8s skribis: > The attached patches should fix this. I=E2=80=99ve successfully deleted a > generation on my system. :-) I don=E2=80=99t have extra menu entries tho= ugh, so > it=E2=80=99d be great if you could give it a try. So I tried it on my laptop: I added a dummy menu entry, reconfigured, rebooted, then ran =E2=80=9Cguix system delete-generations N=E2=80=9D, and = I confirm that it preserves the extra menu entry. There was a typo though: > --- a/gnu/system.scm > +++ b/gnu/system.scm > @@ -116,6 +116,7 @@ > boot-parameters-label > boot-parameters-root-device > boot-parameters-bootloader-name > + boot-parameters-bootloader-menu-entries > boot-parameters-store-device > boot-parameters-store-mount-point > boot-parameters-kernel > @@ -251,6 +252,8 @@ directly by the user." > ;; OS's root file system, so it might be a device path like "/dev/sda3= ". > (root-device boot-parameters-root-device) > (bootloader-name boot-parameters-bootloader-name) > + (bootloader-menu-entries ;list of > + boot-parameters-bootloader-menu-entries) > (store-device boot-parameters-store-device) > (store-mount-point boot-parameters-store-mount-point) > (kernel boot-parameters-kernel) > @@ -297,6 +300,11 @@ file system labels." > ((_ args) args) > (#f 'grub))) ; for compatibility reasons. >=20=20 > + (bootloader-menu-entries > + (match (assq 'bootloader-menu-entries rest) > + ((_ . entries) (map sexp->menu-entry entries)) ^ There shouldn=E2=80=99t be a dot here. I=E2=80=99ll go ahead and push these patches (with this correction) if ther= e are no objections. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 29 19:35:30 2019 Received: (at 36876-done) by debbugs.gnu.org; 29 Aug 2019 23:35:30 +0000 Received: from localhost ([127.0.0.1]:53050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i3Twv-0006tU-Qp for submit@debbugs.gnu.org; Thu, 29 Aug 2019 19:35:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45471) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1i3Twv-0006tF-4C for 36876-done@debbugs.gnu.org; Thu, 29 Aug 2019 19:35:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1i3Twp-0003Cs-IC; Thu, 29 Aug 2019 19:35:23 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36144 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1i3Two-00080D-TV; Thu, 29 Aug 2019 19:35:23 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) Subject: Re: bug#36876: guix system delete-generations removes custom boot menu entries References: <20190731094857.28829b11@gmail.com> <8736ifzjfe.fsf@sdf.lonestar.org> <87sgps6p6c.fsf@gnu.org> <87lfvdpaey.fsf@sdf.lonestar.org> <87r255dl5g.fsf@gnu.org> <877e6wl7py.fsf@gnu.org> Date: Fri, 30 Aug 2019 01:35:21 +0200 In-Reply-To: <877e6wl7py.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 29 Aug 2019 10:02:49 +0200") Message-ID: <87a7brh7eu.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 36876-done Cc: Danny Milosavljevic , 36876-done@debbugs.gnu.org, Jesse Gibbons 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: -3.3 (---) Pushed as c3e59de9b1340f1a0ef7e30dd2e4e7bf7b484ee9. Let me know if anything=E2=80=99s still not quite as expected! Ludo=E2=80=99. From unknown Sun Jun 22 22:40:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 27 Sep 2019 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator