From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GKBRN5dy12F5UwAAgWs5BA (envelope-from ) for ; Thu, 06 Jan 2022 23:52:07 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0OYLM5dy12F7EwAAauVa8A (envelope-from ) for ; Thu, 06 Jan 2022 23:52:07 +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 89A8E40517 for ; Thu, 6 Jan 2022 23:52:07 +0100 (CET) Received: from localhost ([::1]:49850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5bc6-0003c5-QS for larch@yhetil.org; Thu, 06 Jan 2022 17:52:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5bZC-0007Yn-BW for guix-patches@gnu.org; Thu, 06 Jan 2022 17:49:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5bZC-00075h-1I for guix-patches@gnu.org; Thu, 06 Jan 2022 17:49:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n5bZC-00006A-0V for guix-patches@gnu.org; Thu, 06 Jan 2022 17:49:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53063] [PATCH wip-harden-installer 09/14] installer: Use the command capturing facility for guix init. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Jan 2022 22:49:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53063 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53063@debbugs.gnu.org Cc: Josselin Poiret Received: via spool by 53063-submit@debbugs.gnu.org id=B53063.164150932532712 (code B ref 53063); Thu, 06 Jan 2022 22:49:05 +0000 Received: (at 53063) by debbugs.gnu.org; 6 Jan 2022 22:48:45 +0000 Received: from localhost ([127.0.0.1]:42618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5bYq-0008VO-Rk for submit@debbugs.gnu.org; Thu, 06 Jan 2022 17:48:45 -0500 Received: from jpoiret.xyz ([206.189.101.64]:36436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5bYm-0008UA-5I for 53063@debbugs.gnu.org; Thu, 06 Jan 2022 17:48:40 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 744B8184F80; Thu, 6 Jan 2022 22:48:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1641509319; 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: in-reply-to:in-reply-to:references:references; bh=2124ep4QWSUzJKvALK+yOtDYxU0fi0Wa/urQsXhoZDo=; b=JcYlu3InM0QFDCHCHuriE8KNVZyfGVDmdh4piAvxS/D/RwcoFXkwDTSp2lwQ8js+6tvfUh bu+Ull98yOpaSZ+AnzhW7chcjtebebs9uK3EMhIvX1mv3MHQcPo9ZR8gB1l+XXqAP/79de V+j/M74sVh9rouraLtA01rH9XN8CUZleevJigJ/IE1b4AuRhsHTsw5jPE68PVKUnsJLxKR +HPAuyyl1TgyeaDPQwNqtxWAIiILw8bXypJ6j8mt72mU4njA/z1cp4dt2lcHQLNl1UbW4g T5a+fyD4+b3nEFKmCon0v7xM4dIyr1xvde5nnI24JbJ8GPwwykDXe9ikVX9Aeg== Date: Thu, 6 Jan 2022 23:48:07 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: / 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=1641509527; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=2124ep4QWSUzJKvALK+yOtDYxU0fi0Wa/urQsXhoZDo=; b=qv19sDMsoj73i8zAUxAE/5prKQ7Irans7Id5FLCz7GtJzQkG3fOB8IbWJ99VFj5rMMP5sa fr28WiFU1NcFUIyJdE2kmdixtAgpDLqr7YbpmuEQTxKrXHJTgbbx1Lq0HVqwr+DJzp58xT EH3dzT3cVyUaGfkhnhiKjFMAIxlV5ZPQxT6Q4h1S4YxP/DvkdKJ0CcUe1QCG82Xg+ozbDp pxHtvDrD8W+kMQJHwxHKJHVr7uHcSrrlYFc0yGnumscMlKNcKBHrV4ZuXWLqC4+qVxnyEH eFkgOHeOqHjCtJRM4JYlugdRebd8NNmQNiwjCjRog2e+lwfGZQjL5BlkVXYjNg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641509527; a=rsa-sha256; cv=none; b=Lxk0cPZn/U4vZVutxUsqbdvp35UeNbWSQJPtiVFUzidZ9b6SQLjFd/zOKG8hl5NpCgFbbE kTzpI3qfzmbHghTl4vEWDb/f30nC6LV2XrMTyhgVSKuu8cNGPwdgrfCa/KKuIns2EPZYgV o3Itl3J38VCBn4QLdXTlDtaKgVHnrkNKrz4RFacrV8/IyPIZm93isRuWIcgHPnP3/Pxr9L 3a5XavGjTqqpOzW6s0jZMJ5o3P55Sdg6DrNtOGuxzY7fRX8fupI3X8rUCE2CGYbo1yF3BV exBTeIp39hqHCVrKdZLLz86t0n7HtyYOiFlY2cpJ4D6oVlNs2cOm80lldLD5bg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=JcYlu3In; 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.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=JcYlu3In; 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: 89A8E40517 X-Spam-Score: -3.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: sw8pxmc4wwST * gnu/installer/newt/final.scm (run-install-shell): Remove procedure, as run-command-in-installer now takes care of everything. (run-final-page): Directly use install-system. * gnu/installer/final.scm (install-system): Restore PATH inside the container, and use run-command-in-installer. --- gnu/installer/final.scm | 17 +++-------------- gnu/installer/newt/final.scm | 10 +--------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm index fbfac1f692..ba39dad354 100644 --- a/gnu/installer/final.scm +++ b/gnu/installer/final.scm @@ -169,6 +169,7 @@ (define (assert-exit x) (database-dir "/var/guix/db") (database-file (string-append database-dir "/db.sqlite")) (saved-database (string-append database-dir "/db.save")) + (path (getenv "PATH")) (ret #f)) (mkdir-p (%installer-target-dir)) @@ -205,20 +206,8 @@ (define (assert-exit x) (stop-service 'guix-daemon) (start-service 'guix-daemon (list (number->string (getpid)))) - (setvbuf (current-output-port) 'none) - (setvbuf (current-error-port) 'none) - - ;; If there are any connected clients, assume that we are running - ;; installation tests. In that case, dump the standard and error - ;; outputs to syslog. - (set! ret - (if (not (null? (current-clients))) - (with-output-to-file "/dev/console" - (lambda () - (with-error-to-file "/dev/console" - (lambda () - (run-command install-command))))) - (run-command install-command)))) + (setenv "PATH" path) + (set! ret (apply (run-command-in-installer) install-command))) (lambda () ;; Restart guix-daemon so that it does no keep the MNT namespace ;; alive. diff --git a/gnu/installer/newt/final.scm b/gnu/installer/newt/final.scm index efe422f4f4..07e8cf3864 100644 --- a/gnu/installer/newt/final.scm +++ b/gnu/installer/newt/final.scm @@ -98,14 +98,6 @@ (define (run-install-failed-page) (send-to-clients '(installation-failure)) #t))) -(define* (run-install-shell locale - #:key (users '())) - (clear-screen) - (newt-suspend) - (let ((install-ok? (install-system locale #:users users))) - (newt-resume) - install-ok?)) - (define (run-final-page result prev-steps) (define (wait-for-clients) (unless (null? (current-clients)) @@ -129,7 +121,7 @@ (define (wait-for-clients) user-partitions (configuration->file configuration) (run-config-display-page #:locale locale) - (run-install-shell locale #:users users)))) + (install-system locale #:users users)))) (if install-ok? (run-install-success-page) (run-install-failed-page)))) -- 2.34.0