From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0G/PJ4rfe2c7qgAA62LTzQ:P1 (envelope-from ) for ; Mon, 06 Jan 2025 13:50:02 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 0G/PJ4rfe2c7qgAA62LTzQ (envelope-from ) for ; Mon, 06 Jan 2025 14:50:02 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=p0khYsZj; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=jQCmKIEe; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1736171402; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=RBUnqShOXK3MZ4IzcTItTNUeF82xpxakxwHD2rRpi+s=; b=LXSNrJP+c2b2J7hNJFwwjwV6EdFTrzOO1yHxXnnyIsVyN5haL5CeafPD1xk7D+NP8CzXmn IJZgFY7ABVg/0FsHVijm5DncfasHnmtJ88Snr2+kvNNyYQ8xDQh84Ycq8xP2LwaZVqX26u Tx1sXwIL/eMkrBCIo4ezUzYfwivENZl5jy26mRrpelhoYo4pBsRTK/wuSII6OnKTKJRP+j +LiDr648DmnKEwhffefuS8ShsOKiy+61J7ypsujA/4OwfkWvgFOIOsc+mwACyE3WYAhHzD fXDec5UbbkDz8L2QKTF1uiM5g5VCwFZo3KV0x1x2lC996clUqOBXi2AhYnW/8A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=p0khYsZj; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=jQCmKIEe; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1736171402; a=rsa-sha256; cv=none; b=iMoa9tEbHHcTbXysSgYqLz6xSsc6w1J4LeHtthZEKFkZbgvV7GlXv+qo73V7x5vnawvWLI zwdJyFXYgZGfpPlbMzMv/cbRPqgNZHK6IfKIAj1YFhcSrF1WxSr5Ym7R8YJ09H1lYZR6UY Se6s22e8/01K+b6Z0oXYP4C2cYTy61Zn3MFdbTo9EYKBzamKksRqAAyNaMuxscuqttsGN2 anGX9pCS7gCtcoFXRj/6vSUGLUw204nHl8PsgoiHJKcStWrByBdfngJYyst2PiCVQpjcMz 4eFOAPRRYjmKui5b8R+8J4MpGVUe85O7kJ6Q0ZVXM2K/1tHM+sqCRZp3bmsmOA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5B17A8652B for ; Mon, 06 Jan 2025 14:50:02 +0100 (CET) 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?Q?=E2=80=98load-system-for-kexec=E2=80=99?= 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=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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.79 X-Spam-Score: -3.79 X-Migadu-Queue-Id: 5B17A8652B X-Migadu-Scanner: mx10.migadu.com X-TUID: Tmklb+97FbvR 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))))) ;;; -- 2.47.1