From patchwork Tue Jun 21 11:19:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 40207 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7659F27BBEA; Tue, 21 Jun 2022 12:20:25 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 45F3727BBE9 for ; Tue, 21 Jun 2022 12:20:25 +0100 (BST) Received: from localhost ([::1]:36236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3bvk-0007AG-Cj for patchwork@mira.cbaines.net; Tue, 21 Jun 2022 07:20:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3bvO-00077i-7o for guix-patches@gnu.org; Tue, 21 Jun 2022 07:20:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37119) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3bvN-0006FE-Uh for guix-patches@gnu.org; Tue, 21 Jun 2022 07:20:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o3bvN-0005Te-OY for guix-patches@gnu.org; Tue, 21 Jun 2022 07:20:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56122] [PATCH] guix system: Inline menu-entries in to bootcfg in perform-action. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Jun 2022 11:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56122 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56122@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165581034820983 (code B ref -1); Tue, 21 Jun 2022 11:20:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Jun 2022 11:19:08 +0000 Received: from localhost ([127.0.0.1]:59249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3buV-0005SN-SY for submit@debbugs.gnu.org; Tue, 21 Jun 2022 07:19:08 -0400 Received: from lists.gnu.org ([209.51.188.17]:42470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3buU-0005SF-Il for submit@debbugs.gnu.org; Tue, 21 Jun 2022 07:19:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3buU-0006HT-6V for guix-patches@gnu.org; Tue, 21 Jun 2022 07:19:06 -0400 Received: from mira.cbaines.net ([212.71.252.8]:36388) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3buS-0006BZ-7o for guix-patches@gnu.org; Tue, 21 Jun 2022 07:19:05 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:54d1:d5d4:280e:f699]) by mira.cbaines.net (Postfix) with ESMTPSA id 9FDB227BBE9 for ; Tue, 21 Jun 2022 12:19:01 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 8f20f767 for ; Tue, 21 Jun 2022 11:19:00 +0000 (UTC) From: Christopher Baines Date: Tue, 21 Jun 2022 12:19:00 +0100 Message-Id: <20220621111900.9229-1-mail@cbaines.net> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Received-SPF: pass client-ip=212.71.252.8; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This avoids an exception when generating images, where the reading of boot parameters fails. * guix/scripts/system.scm (perform-action): Inline menu-entries in to bootcfg. --- guix/scripts/system.scm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 63e3b9b934..b9084a401c 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -800,11 +800,6 @@ (define* (perform-action action image (define println (cut format #t "~a~%" <>)) - (define menu-entries - (if (eq? 'init action) - '() - (map boot-parameters->menu-entry (profile-boot-parameters)))) - (define os (image-operating-system image)) @@ -813,7 +808,11 @@ (define bootloader (define bootcfg (and (memq action '(init reconfigure)) - (operating-system-bootcfg os menu-entries))) + (operating-system-bootcfg + os + (if (eq? action 'init) + '() + (map boot-parameters->menu-entry (profile-boot-parameters)))))) (when (eq? action 'reconfigure) (maybe-suggest-running-guix-pull)