From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:53179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPlso-00071g-PJ for guix-patches@gnu.org; Sun, 12 May 2019 06:39:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPlsn-0007X9-KR for guix-patches@gnu.org; Sun, 12 May 2019 06:39:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56637) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hPlsm-0007WH-3b for guix-patches@gnu.org; Sun, 12 May 2019 06:39:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hPlsm-0002te-0o for guix-patches@gnu.org; Sun, 12 May 2019 06:39:04 -0400 Subject: [bug#35697] [PATCH 5/8] linux-container: Compute essential services for THIS-OPERATING-SYSTEM. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sun, 12 May 2019 12:37:59 +0200 Message-Id: <20190512103802.17032-5-ludo@gnu.org> In-Reply-To: <20190512103802.17032-1-ludo@gnu.org> References: <20190512103802.17032-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 35697@debbugs.gnu.org Cc: Chris Marusich Previously, the 'essential-services' would correspond to the initial, non-containerized OS. Thus, all the file systems removed in 'container-essential-services' would actually still be there because the essential services would be computed on the non-containerized OS. This is a followup to 69cae3d3356a69b7fe69481338f760545995485e. * gnu/system/linux-container.scm (container-essential-services): Call 'operating-system-default-essential-services' to get the baseline services. (containerized-operating-system): Pass THIS-OPERATING-SYSTEM, not OS, to 'container-essential-services'. Add a dummy root file system to 'file-systems'. --- gnu/system/linux-container.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm index 5adec064f7..fc2e05a5bc 100644 --- a/gnu/system/linux-container.scm +++ b/gnu/system/linux-container.scm @@ -45,7 +45,7 @@ from OS that are needed on the bare metal and not in a container." (list (service-kind %linux-bare-metal-service) firmware-service-type system-service-type))) - (operating-system-essential-services os))) + (operating-system-default-essential-services os))) (cons (service system-service-type (let ((locale (operating-system-locale-directory os))) @@ -85,14 +85,20 @@ containerized OS. EXTRA-FILE-SYSTEMS is a list of file systems to add to OS." (operating-system (inherit os) (swap-devices '()) ; disable swap - (essential-services (container-essential-services os)) + (essential-services (container-essential-services this-operating-system)) (services (remove (lambda (service) (memq (service-kind service) useless-services)) (operating-system-user-services os))) (file-systems (append (map mapping->fs mappings) extra-file-systems - user-file-systems)))) + user-file-systems + + ;; Provide a dummy root file system. + (list (file-system + (mount-point "/") + (device "none") + (type "none"))))))) (define* (container-script os #:key (mappings '())) "Return a derivation of a script that runs OS as a Linux container. -- 2.21.0