From patchwork Mon Jan 6 12:58:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 36679 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 A686727BBEA; Mon, 6 Jan 2025 13:00:19 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED 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 534BD27BBE2 for ; Mon, 6 Jan 2025 13:00:18 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUmiM-00045h-2R; Mon, 06 Jan 2025 08:00:15 -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 1tUmiH-00043j-T5 for guix-patches@gnu.org; Mon, 06 Jan 2025 08:00:09 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tUmiG-0001uN-6x; Mon, 06 Jan 2025 08:00:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=T9xxGeO4xRkvWjUVaQbFT2D8Ty5il3JsrW87kTrL6xM=; b=p0khYsZjhCH7dZj8/0sLXvqtEoWHB/8P6qVcAXftJpZFSvQuQOc4NLDBF3AzDRooKBYt9MTgtOVnfebT/mDuHMcEmK5deVAirWfGlopDK3/OYP1Se2QI9zb9QJs56mcTNULkb7iYKXrR9+EYBwFzuJWQpVwkNrra1tY3u/4fVF//rrNipcjiZUVVp3ZBspozFGrAbJ75TQ1262F/7e3FjMvnQArhia6EGfEFEpWETbtZEoTLwi+Cmq6kH/KMHuQ9QNoY0arMEEnOCreER0WUJWpVsjCERNCA53xA+zZLnZdEv+iRtDqoTdLS3WcsagmJbPxTZAJQ+vFGys2ylKftcQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUmiC-0002Wz-Pv; Mon, 06 Jan 2025 08:00:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75402] [PATCH 3/3] reconfigure: Make =?utf-8?b?4oCYbG9hZC1z?= =?utf-8?b?eXN0ZW0tZm9yLWtleGVj4oCZ?= errors non-fatal. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 06 Jan 2025 13:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75402 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75402@debbugs.gnu.org Cc: Luis Guilherme Coelho , Ludovic =?utf-8?q?Court?= =?utf-8?q?=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 75402-submit@debbugs.gnu.org id=B75402.17361683509513 (code B ref 75402); Mon, 06 Jan 2025 13:00:04 +0000 Received: (at 75402) by debbugs.gnu.org; 6 Jan 2025 12:59:10 +0000 Received: from localhost ([127.0.0.1]:37170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUmhJ-0002TJ-EW for submit@debbugs.gnu.org; Mon, 06 Jan 2025 07:59:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50800) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUmhH-0002SY-E9 for 75402@debbugs.gnu.org; Mon, 06 Jan 2025 07:59:07 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUmhC-0001dj-5p; Mon, 06 Jan 2025 07:59:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=T9xxGeO4xRkvWjUVaQbFT2D8Ty5il3JsrW87kTrL6xM=; b=jQCmKIEeSG7y9Txz1dE6 4Cr3OcdzuDEwOlRT73Xz/zhgj/PBfv8bFIGl9U5RICqDHTqoxvBJ8PNn88TDjmVolLoJFuMZiuwmo qx8JnsqHqt4DUnT8yXRuwDTj8qOOlpftulkzglLax8O0b5IAttS1tObRhM4vc3KBC7byyShl6tuYa m6OAEzzXmwNHWEXa3TG8XIyAwVzoytQPgwnqWtSms0Z1uUg7Cd5cZtJRHraUukfH7lRDUXkGbVq/4 f8kluzvLLZNxuWajRR6/RFDAPicHL79NatnQKJIhKAJFcBKsMGwIPwxl77/zqYJlq8o0uP7CzuWO8 9kzK+s6ehIQJjg==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 6 Jan 2025 13:58:37 +0100 Message-ID: <7b6998df5bf49154493079c304e2362eb102b57c.1736168031.git.ludo@gnu.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: References: MIME-Version: 1.0 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Partially fixes . * guix/scripts/system/reconfigure.scm (load-system-for-kexec): Catch exceptions in the gexp. Report them outside. Reported-by: Luis Guilherme Coelho Change-Id: Iebcdc92e29b8623a55967d58a4f353abab01631a --- guix/scripts/system/reconfigure.scm | 33 +++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index 96e5bff351..d35980590d 100644 --- a/guix/scripts/system/reconfigure.scm +++ b/guix/scripts/system/reconfigure.scm @@ -230,10 +230,35 @@ (define* (upgrade-shepherd-services eval os) to-restart))))))) (define (load-system-for-kexec eval os) - "Load OS so that it can be rebooted into via kexec, if supported. Return -true on success." - (eval #~(and (string-contains %host-type "-linux") - (primitive-load #$(kexec-loading-program os))))) + "Load OS so that it can be rebooted into via kexec, if supported. Print a +warning in case of failure." + (mlet %store-monad + ((result (eval + #~(and (string-contains %host-type "-linux") + (with-exception-handler + (lambda (c) + (define kind-and-args? + (exception-predicate &exception-with-kind-and-args)) + + (list 'exception + (if (kind-and-args? c) + (call-with-output-string + (lambda (port) + (print-exception port #f + (exception-kind c) + (exception-args c)))) + (object->string c)))) + (lambda () + (primitive-load #$(kexec-loading-program os)) + 'success) + #:unwind? #t))))) + (match result + ('success + (return #t)) + (('exception message) + (warning (G_ "failed to load operating system for kexec: ~a~%") + message) + (return #f))))) ;;;