From patchwork Tue Jul 9 19:07:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jakob L. Kreuze" X-Patchwork-Id: 14548 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 A08F3171E8; Tue, 9 Jul 2019 20:10:02 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 5BDF7171E6 for ; Tue, 9 Jul 2019 20:10:02 +0100 (BST) Received: from localhost ([::1]:53126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkvV2-0003f1-1T for patchwork@mira.cbaines.net; Tue, 09 Jul 2019 15:10:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58784) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkvT9-0001bS-Jc for guix-patches@gnu.org; Tue, 09 Jul 2019 15:08:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkvT8-0003b4-7T for guix-patches@gnu.org; Tue, 09 Jul 2019 15:08:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53682) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkvT8-0003ai-2m for guix-patches@gnu.org; Tue, 09 Jul 2019 15:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hkvT7-00045X-QP for guix-patches@gnu.org; Tue, 09 Jul 2019 15:08:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36555] [PATCH v2 0/3] Refactor out common behavior for system reconfiguration. Resent-From: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 09 Jul 2019 19:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36555 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Lemmer Webber Received: via spool by 36555-submit@debbugs.gnu.org id=B36555.156269925615658 (code B ref 36555); Tue, 09 Jul 2019 19:08:01 +0000 Received: (at 36555) by debbugs.gnu.org; 9 Jul 2019 19:07:36 +0000 Received: from localhost ([127.0.0.1]:34264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkvSh-00044U-Sj for submit@debbugs.gnu.org; Tue, 09 Jul 2019 15:07:36 -0400 Received: from ol.sdf.org ([205.166.94.20]:58342 helo=mx.sdf.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkvSe-00044J-A4 for 36555@debbugs.gnu.org; Tue, 09 Jul 2019 15:07:33 -0400 Received: from Upsilon (mobile-166-171-185-38.mycingular.net [166.171.185.38]) (authenticated (0 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id x69J7MLs003653 (using TLSv1.2 with cipher AES256-GCM-SHA384 (256 bits) verified NO); Tue, 9 Jul 2019 19:07:30 GMT From: zerodaysfordays@sdf.lonestar.org (Jakob L. Kreuze) In-Reply-To: <87imsbtk3o.fsf@dustycloud.org> (Christopher Lemmer Webber's message of "Tue, 09 Jul 2019 09:26:19 -0400") References: <87imsci9sj.fsf@sdf.lonestar.org> <87imsbtk3o.fsf@dustycloud.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Date: Tue, 09 Jul 2019 15:07:20 -0400 Message-ID: <875zobvxg7.fsf_-_@sdf.lonestar.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 36555@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches I've implemented the features missing from 'switch-system-program', 'upgrade-services-program', and 'install-bootloader-program' and successfully ran the new 'guix system reconfigure' in a virtual machine. Also tests for 'switch-system-program' have been implement, but I realized that I'll need to be a bit more clever to test 'upgrade-services-program' and 'install-bootloader-program' -- the latter, in particular, requires boot parameters from the machine being tested at build time, so I suspect I'll have to provide some constant boot parameters to avoid spinning up the virtual machine outside of the test derivation. Anyway, I've reverted a change in my previous patch series that updated 'upgrade-shepherd-services' to use 'call-with-service-upgrade-info', since I'd neglected to check the parameters that it passes to 'mproc'. Basically, it _has_ to be called from 'upgrade-services-program', which already has some functionality comparible to 'shepherd-service-upgrade'. If someone could take a look and ensure that it sufficiently implements 'shepherd-service-upgrade', that would be greatly appreciated. On that note, I've changed 'upgrade-services-program' to collect Shepherd error messages as it goes. Is this the right way to go about it? My thinking is that, this way, both 'guix system reconfigure' and 'guix deploy' will be able to report Shepherd errors without stopping half-way through because Shepherd errors out. Either way, I believe this fixes the issue that Ricardo was having with 'guix deploy'. Regards, Jakob Jakob L. Kreuze (3): guix system: Add 'reconfigure' module. guix system: Reimplement 'reconfigure'. tests: Add reconfigure system test. Makefile.am | 1 + gnu/local.mk | 1 + gnu/machine/ssh.scm | 229 +++++++--------------------- gnu/tests/reconfigure.scm | 99 ++++++++++++ guix/scripts/system.scm | 143 +++++------------ guix/scripts/system/reconfigure.scm | 170 +++++++++++++++++++++ 6 files changed, 364 insertions(+), 279 deletions(-) create mode 100644 gnu/tests/reconfigure.scm create mode 100644 guix/scripts/system/reconfigure.scm