From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uNlBJ3Jx12FFQwAAgWs5BA (envelope-from ) for ; Thu, 06 Jan 2022 23:47:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 0B7OH3Jx12GzkQAAG6o9tA (envelope-from ) for ; Thu, 06 Jan 2022 23:47:14 +0100 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 B379136684 for ; Thu, 6 Jan 2022 23:47:13 +0100 (CET) Received: from localhost ([::1]:42686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5bXM-0006Xe-RC for larch@yhetil.org; Thu, 06 Jan 2022 17:47:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5bXE-0006XU-Av for guix-patches@gnu.org; Thu, 06 Jan 2022 17:47:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49665) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5bXC-0006sY-10 for guix-patches@gnu.org; Thu, 06 Jan 2022 17:47:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n5bXB-0008OP-OP for guix-patches@gnu.org; Thu, 06 Jan 2022 17:47:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53063] [PATCH wip-harden-installer 00/14] General improvements to the installer Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Jan 2022 22:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53063 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53063@debbugs.gnu.org Cc: Josselin Poiret X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164150917232194 (code B ref -1); Thu, 06 Jan 2022 22:47:01 +0000 Received: (at submit) by debbugs.gnu.org; 6 Jan 2022 22:46:12 +0000 Received: from localhost ([127.0.0.1]:42568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5bWO-0008NB-8G for submit@debbugs.gnu.org; Thu, 06 Jan 2022 17:46:12 -0500 Received: from lists.gnu.org ([209.51.188.17]:43512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5bWJ-0008N1-Cw for submit@debbugs.gnu.org; Thu, 06 Jan 2022 17:46:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5bWJ-0005tV-6Q for guix-patches@gnu.org; Thu, 06 Jan 2022 17:46:07 -0500 Received: from jpoiret.xyz ([206.189.101.64]:34120) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5bWE-0006io-D3 for guix-patches@gnu.org; Thu, 06 Jan 2022 17:46:06 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 1797E184D98; Thu, 6 Jan 2022 22:45:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1641509159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=8rsB9L5rpCgDPZJNg41WqEQS+KVE4/rUk8PIXa7h89c=; b=CvGcIC1Y5caKCOcCcI8kwipMuyfyZCqBlNp/y/vMbOmi8gHvuGqVypPgk+dmkD2njhn+Ny zLUPLcbhPKsDga5tNdbV4GK6hkRfpPusyyibyNvBmC3kO8q9NYYvdm/xS8kdLL2G6UyTjz v0XnHoMtTp+hNFN3ANQk+x5H7PXbCLJt0sJBe0Yv60CxIefsuv5RN18kqs8nzeRclZUHZu 0TrD9aGOj4lhGWjeBhH6PVgKWDJZknD8ZO7sH8JU08avNEYkg0BfKGIZQzAM9EY+LAeEAr P/x/gCHzwZLlWqnVQEmgH1RZP0aChjHZjXcKVJI0rRAMcd1gDXqh7BTCFI3NjA== Date: Thu, 6 Jan 2022 23:45:45 +0100 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: ++++ Received-SPF: pass client-ip=206.189.101.64; envelope-from=dev@jpoiret.xyz; helo=jpoiret.xyz X-Spam_score_int: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.499, FROM_SUSPICIOUS_NTLD_FP=0.001, PDS_OTHER_BAD_TLD=1.999, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches From: Josselin Poiret via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1641509234; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=8rsB9L5rpCgDPZJNg41WqEQS+KVE4/rUk8PIXa7h89c=; b=BPMbkF2159r6Ii6LfKvhx6jMEVImwNj2YC91kb4SoemO+KUnYGYFs2/iwAlEH23+YZetx4 OAcw8uCafUd5NtnPS2upcDGeUIHP2SyzgblG5Hg3pZdAJ5z68c6LS4cTjaqlym4N5OozTy psEv36S9d16wXA3Y9/uuhLh6CBldiObuqRqCFDORyFWZdtLotvyOic7jPHf/u/4MprNAPq vul4D2Qez0QsLmEe6atK38o9VLHZ6WGwOw2IV/3E5szrEOcbUslibFE0g/w9KPUnE3wrKI VTyq0DklTx2FYB/V8E46AFvkm3Scb8RXMFnYi6BQ/bLwIiZXzgz/tr5phm4Tqw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641509234; a=rsa-sha256; cv=none; b=Euu9Y5QwMm4Mfiry/xHBU9X9d2FX7hwvYPXwCDRxyja8VsgadrqBT0pArYfw6ir1L8Naxh oM54+1VrKmq0FgVld8j+92rr+j9BMIquoPh+jtGgmsznC0pZu63Q+CjX6KgTsAUSB/LNOe usm9Mn/j+Q5w999jD5fITydgh9Hb6zpqURIAm6zyQOWBCCPOcIUwZon78ey4aaCi0yK3A8 zPKpm0Dk8qWMvlV2QrtSY21+wJrCoy4SVWI1UfgqXQa8M54FA+AlhKjkrj6S7MI4lK6ZIF 8fulGofHidVh7UP0qh1P6rfA7ib6+PC7m9uZZXtPOIR5e9nyJrpTmWuAogHyzA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=CvGcIC1Y; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Spam-Score: -3.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=CvGcIC1Y; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Queue-Id: B379136684 X-Spam-Score: -3.30 X-Migadu-Scanner: scn1.migadu.com X-TUID: 25yZcegN9l9V Hello everyone, Here are some miscellaneous improvements to the installer. Here is a run down of the bigger changes: * Patches 2 to 4 move logging from simply putting everything in syslog to a more flexible approach, logging lines to multiple targets. One new target is a per-install /tmp/installer.{DATETIME}.log. * Patches 5 and 6 add a new alternative to invoke (or system*), which forks to a new child process with a pipe back to the main process, sets stdout and stderr to that pipe followed by execlp'ing the command, while the main process reads from the pipe and applies some configurable procedures to each line of output. This lets us log all external command output using the same facility as the installer itself, while displaying everything to the user. Patch 6 is "optional", as it is there simply to avoid getting "Error in finalization thread: Success". * Patches 7 to 9 add a parameter run-command-in-installer, that is an installer-specific way of running external commands. Here, the Newt installer one simply suspends newt and runs the command in the terminal. * Patch 13 modifies the installer step aborting mechanism to use general prompts instead of the exception system. This was done so that a following patchset (which will hopefully be coming soon) is able to abort an installer step from an exception handling code that is outside of the run-installer-steps. You could also say that it is cleaner :). * Patch 14 adds a new confirmation page before running any external command, with the possibility to abort the current installer step. The next step should be moving installer-program in (gnu installer) to use SRFI-34/35 exception handling over the current throw/catch one, as the current code doesn't display those properly. Josselin Poiret (14): installer: Use define instead of let at top-level. installer: Generalize logging facility. installer: Use new installer-log-line everywhere. installer: Un-export syslog syntax. installer: Capture external commands output. installer: Disable automatic finalization for child thread. installer: Add installer-specific run command process. installer: Use run-command-in-installer in (gnu installer parted). installer: Use the command capturing facility for guix init. installer: Raise condition when mklabel fails. installer: Fix run-file-textbox-page when edit-button is #f. installer: Replace run-command by invoke in newt/page.scm. installer: Use named prompt to abort or break installer steps. installer: Add confirmation page when running external commands. gnu/installer.scm | 15 ++- gnu/installer/final.scm | 23 +--- gnu/installer/newt.scm | 22 ++- gnu/installer/newt/ethernet.scm | 8 +- gnu/installer/newt/final.scm | 22 +-- gnu/installer/newt/keymap.scm | 8 +- gnu/installer/newt/locale.scm | 25 ++-- gnu/installer/newt/network.scm | 16 +-- gnu/installer/newt/page.scm | 22 +-- gnu/installer/newt/partition.scm | 10 +- gnu/installer/newt/services.scm | 16 +-- gnu/installer/newt/timezone.scm | 4 +- gnu/installer/newt/user.scm | 5 +- gnu/installer/newt/welcome.scm | 2 +- gnu/installer/newt/wifi.scm | 4 +- gnu/installer/parted.scm | 104 +++++++------- gnu/installer/record.scm | 7 +- gnu/installer/steps.scm | 127 ++++++++--------- gnu/installer/utils.scm | 225 +++++++++++++++++++++++++++---- 19 files changed, 389 insertions(+), 276 deletions(-) -- 2.34.0